Playing a short clip in preview window
I'm trying to figure out how to play a short looping clip of a title in a preview window.
The second step would be to have that clip change based on button focus.
The idea is I have several videos, all selectable by a separate button. When any given button has focus a short loop plays in the preview window.
Just like say chapter in a movie.
For now though I'd be happy with the first step.
This would be done through asyn video playback in the secondary player -- not sure if iHDSim beta that you currently have supports this feature though. I'll add it to the list of things to try out and post on my blog though :-)
If you have the specs, look into SecondaryVideoPlayer.play(uri, start, offset, stop, callback)
For example, to start playing a video from persistent storage in 5 seconds, and run it from the start of the clip for 30 seconds, you might say:
SecondaryVideoPlayer.play("file:///required/movie.wmv", "00:00:05:00",
"00:00:00:00", "00:00:30:00", callback );
function callback(status)
{
if (status != Player.FINISHED)
// Something wrong...
}
I was playing around with this and let me make sure we're talking about the same thing.
I'm *not* talking about PiP. I want a handful of video loops that will play inside a smaller window in the menu system. The will be tiny previews of the the main video. So you focus on a button and the video loop is changed to represent that button selection.
When you press the button, then the main video plays - taking up the entire screen.
Just like scene menus you see in SD videos, except imagine the scene windows are videos and not just static images.
The only two ways to play video are through the main video and the "PiP" (secondary video) -- but you can scale and crop the PiP (and move it anywhere you want on-screen) so that should work for you. You can have static images on all the buttons and then move / scale the PiP to be over the button that is pressed.
Is there a reason why you don't want to use the PiP? Obviously if you are playing the movie AND the "real" PIP AND the menu system, you won't be able to play both the PIP and the thumbnails at the same time..
Another approach (low-def, no audio) would be to creata multiple PNG screenshots (or a single MNG file) that contained frames of the video, and animate those. You could add sound separately with a WAV if you wanted to, but it wouldn't be guaranteed to be in sync.