Add listeners for TimelineUpdatedEvent

To receive notifications about timeline updates, register the appropriate event listeners.

Each time the timeline updates, the MediaPlayer dispatches AdobePSDK.TimelineEvent with type AdobePSDK.PSDKEventType.TIMELINE_UPDATED.

  1. Implement the appropriate listeners.

    function onTimelineUpdatedEvent(event) { 
        var timelineMarkers = event.timeline.timelineMarkers; 
        //add code to remove old timeline markers from scrub-bar. 
        var range = player.playbackRange; 
        //iterate through the list of timelineMarkers 
        for(var i = 0; i < timelineMarkers.length; i++) 
        { 
            var markerLocalTime = timelineMarkers[i].localRange.begin; 
            var markerVirtualTime = timelineMarkers[i].virtualRange.begin; 
            var duration = timelineMarkers[i].duration; 
         // add code to draw a particular marker on scrub-bar 
        }      
    }
    
  2. Register the event listeners.

    player.addEventListener(AdobePSDK.PSDKEventType.TIMELINE_UPDATED,  
        onTimelineUpdatedEvent);
    

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now