So, I have scoured the net for this one with no such luck.
I want to use MCISendString(or send command would work) to play videos, AND after a set amount of time, skip the video playing another in my "playlist".
Now, I have successfully programmed this to play a video, and when I CLICK a button, it nicely goes to the next video.
However, if I use a timer, it seems to start a new video instance and both play at the same time. I will assume it's another thread?
And, whilst I have your attention, how would I easily implement a closed-caption reader on asf files that support it with MCI?
-
-
Alright, after 2 weeks of nil and finding MY OWN post on loads of various RSS feeds, I am posting an update.
I found a "hack" to play files one after another.
Remember, MCI does NOT handle threads really well...even if we only have one, so a thread "handler" would still give "unexpected" results. So, I looked into windows messages.
So, when passing the command, as in lptstring="play FILENAME", we add "notify". So, the full string appears as: "play FILENAME notify".
Now, what does that do? Well, after a successful play of a file, it will send out a message. I had learned about this:
#define MM_MCINOTIFY 0x3B9
but I did not know how I could have MCI trigger it...however, a good search in the MSDN library turned up "notify" and everything went "smooth" from there...(except if you call MCISendString too much, you will end up with a NULL POINTER EXXCEPTION!!!)
Well....hope that helps anyone with similiar problems..
/* code snippet */
protected override void WndProc(ref Message mes)
{
if (mes.Msg == 0x3B9)
{
if (videoplayer!=null)
{
videoplayer.VideoClose();
videoplayer.PlayNextVideo(videoBox, this.Handle);
}
}
base.WndProc(ref mes);
}
/*end */
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.