Am trying to play the video with some of the basic controls included like play, pause and stop. If i use this code
hr = pControl->Run();
It waits for the video to complete so i cant pause the playing video.
so i used (responding to event)
#define WM_GRAPHNOTIFY WM_APP + 1
IMediaEventEx *g_pEvent = NULL;
g_pGraph->QueryInterface(IID_IMediaEventEx, (void **)&g_pEvent);
g_pEvent->SetNotifyWindow((OAHWND)g_hwnd, WM_GRAPHNOTIFY, 0);
if (g_pEvent == NULL)
LONG_PTR param1, param2;
while (SUCCEEDED(g_pEvent->GetEvent(&evCode, ¶m1, ¶m2, 0)))
g_pEvent->FreeEventParams(evCode, param1, param2);
case EC_COMPLETE: case EC_USERABORT: case EC_ERRORABORT:
g_pEvent->SetNotifyWindow(NULL, 0, 0);
g_pEvent = NULL;
I commented the waitforcompletion method, it executed sucessfully but the video was not played.
Your suggestions are welcome.