Skip to main content

start_position_ticks_from_seconds

Function start_position_ticks_from_seconds 

Source
fn start_position_ticks_from_seconds(position_seconds: f64) -> Option<i64>
Expand description

Convert a live playback position (seconds) into the StartPositionTicks to hand to a remote session, or None if we’re effectively at the start.

Pure helper so the resume-position math is unit-testable without a remote session or HTTP. The source of position_seconds matters too: callers must pass the live backend position (PlayerController::position()), not the snapshot embedded in PlayerState, which is stale mid-track on Android.