Sign in to follow this  

Direct Show Looping?

This topic is 2030 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

I'm still working on a game for school, and we're using direct show, but we can't get it to replay the video correctly. The only way we can figure out how to get it to loop is call IMediaControl::Render("video.wmv"). The problem with that is it opens up an entirely new window and plays the video in full resolution.

I know how to check if a video has completed it's duration, but how do I make it restart from the beginning without a new window?

I can't find anything useful on the web, or maybe im just overlooking something I dont know.

[code]
IGraphBuilder *pGraph;
IMediaControl *pControl;
IMediaEvent *pEvent;

pGraph->RenderFile(L"video.wmv");

pControl->Run();

while(true)
{
pEvent->GetEvent(&evCode,&param1,&param2,0);

switch(evCode)
{
case EC_COMPLETE:
// Restart
pControl->Stop();

// Right here i want to tell it to restart from beginning
pControl->RenderFile(L"video.wmv"); // <- Opens new window
pGraph-> RenderFile(L"video.wmv"); // <- As does this

// I'm guessing that i need to use filters somehow, but i have no clue where to begin with it
break;
}

pEvent->FreeEventParams(evCode,param1,param2);
}

[/code]

any help would be appreciated =) Edited by Muzzy A

Share this post


Link to post
Share on other sites

This topic is 2030 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