PDA

View Full Version : Sync Graphics with Media Player Content



octane6228
02-06-2004, 07:25 AM
HI....Wondering if there's a way to have graphic images synced with a media player video ? Almost like chapter markers in a DVD video.....When the video hits a certain marker/time it would display the next graphic and so on...This way the graphics would be in sync with what the video was playing (talking head).

Hope that makes sense ?

Any help would be greatly appreciated.

Brett
02-06-2004, 08:17 AM
Sure, just start a page timer (Page.StartTimer) when the video starts. Then go to the page's "On Timer" event and whenever you hit the times that you want, use "Image.Load" to load a new image into an Image object on the page.

octane6228
02-06-2004, 11:51 AM
Corey....Could you post a sample of code that would show how this is done ?

Thanks in advance...

Corey
02-06-2004, 12:25 PM
Yeah OK, try this:

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

octane6228
02-06-2004, 01:08 PM
Ok....What if you want it to be in actual sysnc to the video time ? That way if they reque the video the graphics get requed as well. I was playing around with MediaPlayer.GetCurrentPos("Plugin1");
but so far no go....Any idea on how toget this to work ??

Thanks

Syverson
02-06-2004, 01:58 PM
Corey...When you use the "load image" command to bring up a number of images during a video or sound track on cue, does the earlier image get flushed from memory as the new image is loaded?

Cheers
Syverson

octane6228
02-06-2004, 04:12 PM
Hi Everyone, Adam in tech support helped me out on this one and works like a charm.....Here's the solution....

This can be accomplished using the timer and some actions. For example you could have a timer that fires every second that checks the current position and then does a small IF statement based on this.



So on Page -> Properties -> Actions -> On Show:

-- this will fire the timer every second.
Page.StartTimer(1000);



Then on Page -> Properties -> Actions -> On Timer:

-- get the current time
time = MediaPlayer.GetCurrentPos("Plugin1");

if time > 3 and time < 4 then
Image.Load("Image1", "AutoPlay\\Images\\11111111.jpg");

elseif
time > 33 and time < 34 then
Image.Load("Image1", "AutoPlay\\Images\\22222222.jpg");

elseif
time > 66 and time < 67 then
Image.Load("Image1", "AutoPlay\\Images\\33333333.jpg");
end





This works like a charm!!!!

Corey
02-06-2004, 06:30 PM
Not sure Syverson, I'm not on the programming team so the memory management issues are beyond my scope. Sorry...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Intrigued
02-06-2004, 08:05 PM
That snippet octane6228 reminds me of my volume control code in my most current project. Save, I put most into the Global Functions area.

Thank you for posting the solution to the situation!

[Late Edit] Now, would it be more optimal to have all loaded (all those images in question) and SetVisible == False at the start of the movie? Then just SetVisible == True when needed?[End]