View Single Post
 
Old 09-18-2009, 09:01 AM
therealtomlapp therealtomlapp is offline
Freshman
 
Join Date: Jan 2009
Location: New Jersey
Posts: 40
Default

So im assuming I should first change this:

Public WithEvents VideoPlayer as Video

to:

Public VideoPlayer as Video

and get rid of the Handles clauses on the subs, then add the event handlers manually when creating/initializing the VideoPlayer

if VideoPlayer is Nothing then
VideoPlayer = New Video(strFilename)
else
VideoPlayer.Open(strFilename)
end if

AddHandler VideoPlayer.Ending, AddressOf VideoPlayer_Ending

I believe this will fix my initial problem of having to use a timer, which is awesome.

Still if there is anyone out there that knows about DirectX I still need help on having it not mess up the rest of my system every time I use it.

Just tried it and the event handler won't fire the second time around, even though I am adding it dynamically. So it plays the first video, then when it is over fires the event, which my code then executes VideoPlayer.dispose. Then the second video plays, then nothing happens.

I've read that the dispose function doesn't completely free up the resources for some reason. Basically the best case scenario is to take VideoPlayer back to square one every time, as if every video played was the first one.
Reply With Quote