Time Marker feature of the UMP?

MINI LESSONS ›› Media Players ››

MINI LESSON

TIME MARKERS

Ever wondered how to hide/show certain objects at very specific times as a media file plays within the Universal Media Player (UMP)? To do this, you would use the Time Markers feature of the UMP.


To help explain how to do this, consider the following scenario.



Configuring the Time Marker tab of the UMP

Using the Time Markers tab configure the first 3 time markers.


  1. Ensure the Enable Time Markers checkbox is checked
  2. Ensure Specific Times is selected
  3. Click the Add Time Marker button, and add the marker for 4000 ms.
  4. Click the Add Time Marker button, and add the marker for 17500 ms.
  5. Click the Add Time Marker button, and add the marker for 25000 ms.
  6. Add comments, if desired, in the comment column to help you remember the purpose of each marker.

 


Programming the On Media Timing event

When each of these specific Time Marker times are reached during the playback of the media file, ToolBook will send a message to that UMP and that message essentially says:


  A Media Timing Event just occurred with a Time Marker Position of 4000 ms


In order to respond to this message, so that you can add your Hide/Show logic, you need to use the Actions Editor to respond to the Media Timing Event event message.


  1. Open the Actions Editor for the UMP object
  2. By default the On Media Complete event will be shown to you.
  3. Click on On Media Complete and choose On Media Timing Event from the list offered.
  4. You'll notice there is one Parameter called mediaPosition listed to the right of the Event name. This value represents the Time Marker position which has just been reached.
  5. Add Programming to hide/show objects based on the value of the mediaPosition parameter.


 


Common Mistake

It is a very common mistake to write [If mediaPosition of self = xxxx] instead of [If mediaPosition = xxxx].


By asking for [mediaPosition of self] you are not reading the value of the parameter mediaPosition, you are actually asking the UMP:


  What is the current position of the media file at this very moment


What's the difference? It takes several milliseconds for ToolBook to send the Media Timing Event message and for your Actions Editor code to process. This means that although the media file may have been 4000 ms into the media file when the Media Timing Event message was sent, by the time your code processes the message it is likely that the current position of the media file will be several milliseconds later...such as 4010.


 


Programming the On Media Complete event

You'll recall that in the Scenario we wanted to hide all the field objects right after the file finished playing...at 30000 ms.


The easiest way to do this is to simply use the On Media Complete event, which is sent to the UMP when the media has finished playing. You'll notice there are no Parameters in this Event.


   


Created with the Personal Edition of HelpNDoc: Free HTML Help documentation generator