PDA

View Full Version : Video Object Play/Pause


mindstitchdr
04-24-2007, 12:23 PM
I'm at a loss here and could use some help. I decided to switch the Media.Player object with a Video object so I could customize my slider to match my app a little better, and for some reason this code works on all videos except .mpg. I'm not really sure what is going on here (Maybe a bug) but if someone could point me in the right direction I would be greatfull.

I'm using a WinButton to play and pause the video.

mpstate = Video.GetState("Video1");

if (mpstate == VIDEO_PAUSED) then
Video.Play("Video1");
WinButton.SetText("Plugin8", "Pause");
else
Video.Pause("Video1");
WinButton.SetText("Plugin8", "Resume");

end

mindstitchdr
04-24-2007, 12:28 PM
Nevermind I got it. I added a Dialog.Message after the Get.State and the returns are 0 for paused and 2 for playing. The help file says the returns should be Video_Paused and Video_Playing. This is how I changed it and it works fine now:

mpstate = Video.GetState("Video1");
--Dialog.Message("Notice", mpstate, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

if (mpstate == 0) then
Video.Play("Video1");
WinButton.SetText("Plugin8", "Pause");
elseif (mpstate == 2)then
Video.Pause("Video1");
WinButton.SetText("Plugin8", "Resume");

end