seekToUnixTimeMs

fun Player.seekToUnixTimeMs(unixTimeMs: Long, window: Timeline.Window = Window())

Seeks the player to the specified unix time in milliseconds within the current media item's window.

This function calculates the seek position relative to the window's start time and uses it to seek the player. If the provided unix time or the window's start time is unset (C.TIME_UNSET), or if the current timeline is empty, the function does nothing.

Parameters

unixTimeMs

The target unix time to seek to, in milliseconds.

window

A Window object to store the current window information. If not provided, a new Window object will be created.