Page 1 of 1
AxWindowsMediaPlayer1
Posted: Fri Mar 04, 2011 4:24 am
by lesan101
Does anyone know how to play a windows media player video on a form, that is coming from the resources of the program??
the video is a .wmv <-- same as .wma i guess
i have a AxWindowsMediaPlayer1 already on form
but what the heck ?!?! i tried everything.
i want to pick it up of the resource not no C drive !
so does anyone know ?
Re: AxWindowsMediaPlayer1
Posted: Fri Mar 04, 2011 5:28 am
by Scottie1972
it would probly be best to just have the .wmv in the same location as the main program file, and just use this to open the .wmv
Code: Select allAxWindowMediaPlayer1.URL = Application.StartUpPath & "\myVideo.wmv"
If you where to exstract the video everythime you opened the program...it would take a long time to load depending on how large the video file is.
Re: AxWindowsMediaPlayer1
Posted: Fri Mar 04, 2011 12:46 pm
by lesan101
if that is the case, is it possible to extract whats in the resource into a folder in the desktop or something?
then the player will just pick it up by there. ?
Re: AxWindowsMediaPlayer1
Posted: Fri Mar 04, 2011 1:02 pm
by MrAksel
Yes you can use this code to save the movie resource to a file:
Code: Select allDim MovieData() As Byte
MovieData = My.Resources.Movie ' Change 'Movie' to the resource name
My.Computer.FileSystem.WriteAllBytes(Application.StartUpPath & "\myVideo.wmv", MovieData, False)
Then you can use Scottie's code.
Re: AxWindowsMediaPlayer1
Posted: Fri Mar 04, 2011 1:21 pm
by lesan101
Thank you MrAksel & Scottie1972 !
I have completed my program thanks to you.
out of curiosity, where does t extract it to?
Re: AxWindowsMediaPlayer1
Posted: Fri Mar 04, 2011 2:11 pm
by MrAksel
It extracts to the path where the application was started. For example if you ave your .exe file on your desktop, it would save the movie to the desktop