Sign in to follow this  

Simple video player

This topic is 4190 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How could I make a very simple video player, using Visual Basic with Visual Studio 2005. I also have the DirectX SDK (june) installed. Basicly the only features I need for the player are: - you can define in code, where the sourcefile is loaded (.avi?) - play, stop, pause I tried to google some tutorials, but most of the good ones were for C#, but I really need it in Visual Basic. I read somewhere, that it could be done with DirectShow or with AudioVideoPlayback, but I understood that DirectShow is more simple? Is it possibly to draw the video on Surface, like a normal picture from file? [Edited by - Hoover85 on June 16, 2006 4:55:20 AM]

Share this post


Link to post
Share on other sites
Well, the thing I really want right now, is to just have a video playing in full screen mode behind the scene. After that, I'm going to put some graphics on it. The video is supposed to work like a backgroundimage. :)

Share this post


Link to post
Share on other sites
Ah well as a matter of fact I have a solution to that (doing the exact same thing in my own game! :) )... but I'm having huge problems when resetting the device/when the device is lost. I'll be happy to send you the library I wrote but it's not going to work after the device is lost (ctrl+alt+del, alt+tab out, screensaver, etc.).

Share this post


Link to post
Share on other sites
Hmm... I'we been testing this video drawing for a while now, and it seems that the easiest way to do it, is simply do following:

Dim testVideo As Video
Dim strVideoFile As String

'Assign the videopath
strVideoFile = "Test.wmv"
testVideo = Video.FromFile(strVideoFile)

'Then we just play the video
testVideo.Play()

The problem I now have, is that the video is automatically drawn into a new separate form. I need to be able to draw the video into an existing one. Is it even possible to draw it just like a normal picture, as shown below?

ssurface.DrawFast(xCoord, yCoord, picSurface, DrawFastFlags.SourceColorKey)

I think that I should somehow put the video into a surface, so I can put it to a other surface, just like I did with the picture. Or am I totally out of the track? :D

Share this post


Link to post
Share on other sites
Hmm... Now I found out, how to add this library for my project. I had to choose it from the browse menu, and then write: Imports MyRpg.Media

Ok, so far so good, but I'm in a bit of trouble again. ;)

I can't load the videofile for my video, because the Visual Studio says:

"Indirect reference is being made to assembly Microsoft.DirectX version 2.0.0.0, which contains 'MyRpg.Media.Video.FromFile'. This Project references a prior version of Microsoft.DirectX version 1.0.2902.0. To use 'MyRpg.Media.Video.FromFile', you must replace the reference to Microsoft.DirectX with version 2.0.0.0 or higher."

This is the line, where Visual Studio gives the error message above:
videoClip = Video.FromFile(tempDevice, sVideoFile)

I tried to import the DirectX 2.xxx something, but it didn't do any good. Still gave the same error message, and there isn't any other Microsoft.DirectX's to import than just two.

I'm just doing a test application, where I'm only going to view the video, so I guess I don't have to import anymore librarys for my project because the MyRpg replaces AudioVideoPlayback entirely?

Imports Microsoft.DirectX
Imports Microsoft.DirectX.Direct3D
Imports MyRpg.Media

Share this post


Link to post
Share on other sites
Ahh, well you have two choices here:
#1 Port your engine to MDX 2.0 (you only need the ONE reference to Microsoft.DirectX.DLL then because it contains everything)
#2 I can try to port the library to MDX 1.1 but I may not have the time...

Share this post


Link to post
Share on other sites

This topic is 4190 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this