foo-webview-sdk
    Preparing search index...

    Interface PlaybackStateChangedPayload

    Payload of the playback:stateChanged event. The playback state changed: playing when a track starts and on resume, paused on pause or when playback starts paused, stopped when playback stops with reason user or eof (see playback:stopped). playback.next stops the playing track with reason starting_another and sends no stopped state, but foobar2000 reports playlist.playTrack on another row as a user stop, so a stopped state arrives before the new track's events. When a track starts, the event sent right after playback:trackChanged carries that track's canSeek; an earlier one sent with playback:starting, before the track is opened, can report false.

    interface PlaybackStateChangedPayload {
        canSeek: boolean;
        duration: number;
        hostTime: number;
        position: number;
        state: "stopped" | "paused" | "playing";
    }
    Index
    canSeek: boolean

    Whether the playing track can be seeked, read when the event is sent, as canSeek in the playback.getState answer; always false for stopped.

    duration: number

    Length of the playing track in seconds, read when the event is sent.

    hostTime: number

    Host system time when position was read, Unix epoch milliseconds with a fractional part, the same clock as Date.now().

    position: number

    Playback position in seconds, read when the event is sent, with the same latency compensation and transient behavior as playback.getPosition.

    state: "stopped" | "paused" | "playing"

    The new state.