|
|
How do I provide a "play all" feature? |
|
It's relatively easy to make a menu item (button) that will play all of your items.
Typically, people try to simply set the previous asset's "Jump when finished" option to the next asset to be played. The problem with this is if you also provide individual access to the items. In this scenario, when someone plays item two it will automatically go to item three, and then to four, etc., because each one still points to the next in line. What you really want is a way to play each item individually and allow the viewer to play everything sequentially without interruption. Scripting is your answer. My example below uses one menu, three video assets, and five scripts to accomplish the above. The assets for this example are named as follows:
Set one of the disc variables to PlayAll. I'm using Variable 1 for my example.
Here are the scripts I created for my example:
Set the disc's "Startup Action" to the "ResetAll" script. Set the disc's Remote Control "Menu" action to to "ResetAll" script. Create a "Play All" button on your menu. Set the button's "Jump when activated" option to "PlayAll Script".
As you can see above, this script sets the PlayAll variable to 1 and plays the Fuyu track. Wen Fuyu is done, you need to test whether to proceed to the next track, or go back to the Main Menu via the ResetAll script. This is the job of "Fuyu Exit Test". Select the Fuyu video object and set its "Jump when finished" option to "Fuyu Exit Test".
"Fuyu Exit Test" checks to see whether the PlayAll flag is set. If it is, it plays the indicated video track (in this case, Hatu). If the flag is not 1, then the script instructs the player to go to the Main Menu via the ResetAll script. Now, you basically repeat the same steps for the Hatu track, but substituting the "Hatu Exit Test" script for "Fuyu Exit Test". If the "Hatu Exit Test" finds the PlayAll flag set to 1, it plays the next track - Kouyou. When Kouyou finishes playing, we want it to run the final script, "PlayAll End Script". Set Kouyou's "Jump when finished" option to "PlayAll End Script".
This script resets the PlayAll flag to 0 and returns to the Main Menu. It's important to set the variable back to 0 so that if the viewer plays an individual track, it won't loop through to the next track, etc. Here's what the relationships of all the objects looks like when you're done. Note that I've simplified the layout by not creating buttons to play each asset individually. I did this simply to keep the screenshot clear in regard to a "Play All" feature. If you provide individual links to each asset, you will see additional connections. The "Jump when finished" option for each track will always point to a script. Click on the image for a larger version. Note that it's very important to set the disc's Remote-Control options. The Menu option should be set to the ResetAll script (not the Main Menu itself), otherwise the viewer will have a tough time playing just a single track later. That's it. You can easily turn this into an infinite loop through a couple of simple additions. First, add another variable. I called mine Insanity. Next, create another script called "Insanity Script". The contents of this script should be: PlayAllFlag = 1 Insanity = 1 play track "Fuyu" Change the ResetAll script to add a reset of the Insanity flag, e.g.: PlayAll = 0 Insanity = 0 play menu "Main Menu"Create a new button on your menu and link its "Jump when activated" option to "Insanity Script". Now, make a slight change to the "PlayAll End Script". Here's what it should look like now: if Insanity == 1 then play track "Fuyu" PlayAllFlag = 0 Insanity = 0 play menu "Main Menu"Now when Kouyou finishes playing, the "PlayAll End Script" first checks whether Insanity is 1. If it is, it loops back to Fuyu which starts the whole sequence over. If Insanity isn't set to 1, the script sets both Insanity and PlayAll to 0 and then jumps to the Main Menu.
Note that it's very important to set the disc's Remote-Control options. The Menu option should be set to the ResetAll script, otherwise the viewer will have a tough time getting out of the Insanity loop. Of course, if you're like me this may have been intentional. Why else would I have called the variable Insanity? <G>
| |
| dnedrowATusaDOTnet | |
| 2002-Sep-06 19:26 |
| Previous: |
|
| Next: |
|
| ||||||||