Best way to start play of a title and play all?
The functional demo I'm making has a list of several titles. Each title is played by selecting a button. These are the two methods I have tried for kicking off a title:
Player.playlist.titles["videoFoo"].chapters[0].top();
Player.playlist.titles["videoFoo"].jump("00:00:00:00", false);
First question: is one method better/more appropriate than the other?
I ask because it seems like the iHD simulator has trouble with the second method - sometimes the video is blank/black while you can hear the audio.
If you select a specific title I want that title to play and then end. However I want the option to select 'Play All' and go through all the titles from start to finish.
Second question: what is the best way to do this?I've considered making one set of titles that loop on themselves and another set that point to the next title onEnd. Seems like a hack though to declare all the titles twice to get this behavior.
Have all the titles loop on themselves, which I believe you are already doing. Then have a Play All button which creates a variable called PlayAll and set it true. Set up a event listener to listen for title_end. Have the event listener call a function that checks to see if the PlayAll is true or false. If it's true, have it jump to the next title. If it's false, do nothing and the current title will loop. The function could be set up with an if else structure or a switch statement.
Thanks for the reply. I looked up title_end in the Event Type Definition table to verify the name and found this example:
function titleEndHandler(evt) {
switch(evt.type) {
case evt.END:
....
}
}What I don't understand about this example is - what other case could there be besides evt.END? If the event is fired then a title has ended, right?