Jump to content

  • Log In with Google      Sign In   
  • Create Account


Direct Show Looping?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Muzzy A   Members   -  Reputation: 623

Like
0Likes
Like

Posted 26 June 2012 - 06:41 PM

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.

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);
}


any help would be appreciated =)

Edited by Muzzy A, 27 June 2012 - 04:48 PM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS