Skip to main content

onPlayerTimeCodeUpdated()

Description

Passes the current player timecode to the SDK. Call this function regularly to keep the SDK synchronized with your video player's current playback position.

Usage

m.lib.callFunc("onPlayerTimeCodeUpdated", timecode)

Parameters

ParameterTypeDescription
timecodestringCurrent playback position in your player

Example

' Update SDK with player position
sub onVideoPlayerPositionChanged(event)
position = event.getData()
playerTimecode = m.playerTimecode + Int(position * 1000)
m.lib.callFunc("onPlayerTimecodeUpdated", playerTimecode)
m.lib.callFunc("onPlayerTimeCodeUpdated", currentPosition.toStr())
end sub

Best Practices

  • Update the timecode regularly (e.g., every second)
  • Pass the timecode as a string
  • Keep the SDK synchronized with actual playback position
  • Consider using a timer for regular updates