Show Menu
TOPICS×

Implement custom time updates

In some analytics implementations, the client application might want to provide a different playhead position than the position that is reported by the TVSDK's localTime value. For example, during a linear stream playback, each program's playhead can be provided relative to its start time.
Override this method only if you want to provide a playhead position that is different from the default position.
To override the default playhead position:
vaTrackingMetadata.currentTimeUpdateBlock = ^CMTime () { 
    NSInteger random = arc4random() % 500;  
    return CMTimeMakeWithSeconds(random, 1); 
};

In this code sample, 500 is only a sample value. You need to use a different value for your custom playhead position.