addPlayheadBoundaryObserver
Registers a callback that fires when the playhead reaches one of the given boundary positions.
Positions are normalized: values < 0 are discarded, duplicates are removed, and remaining positions are sorted ascending.
During normal playback the callback fires when the underlying player's timeline message system reaches the scheduled fire time (positionMs - lookaheadMs). During seek the callback fires only if the seek destination matches a registered position at second-level precision, i.e. destinationMs / 1000 == positionMs / 1000.
Return
An opaque token representing this registration, or null if no valid positions were registered. Pass to removeBoundaryObserver to unregister.
Parameters
Stream-time positions in milliseconds.
Must be >= 0. An offset subtracted from each position before scheduling. For example, lookaheadMs = 100 with positionsMs = [5000] fires at 4900ms. Default is 0.
Called with each reached position (in milliseconds) as it is reached.