foo-webview-sdk
    Preparing search index...

    Variable playerConst

    player: {
        getCurrentTrack: () => Promise<PlaybackGetCurrentTrackResponse>;
        getCurrentTrackIndex: (
            includeTrackInfo?: boolean,
        ) => Promise<PlaybackGetCurrentTrackIndexResponse>;
        getOrder: () => Promise<PlaybackGetPlaybackOrderResponse>;
        getPlayingPlaylist: () => Promise<PlaybackGetPlayingPlaylistResponse>;
        getPosition: () => Promise<PlaybackGetPositionResponse>;
        getState: () => Promise<PlaybackGetStateResponse>;
        getStopAfterCurrent: () => Promise<PlaybackGetStopAfterCurrentResponse>;
        getVolume: () => Promise<PlaybackGetVolumeResponse>;
        mute: (muted?: boolean) => Promise<PlaybackMuteResponse>;
        next: () => Promise<PlaybackNextResponse>;
        pause: () => Promise<PlaybackPauseResponse>;
        play: () => Promise<PlaybackPlayResponse>;
        playPath: (path: string) => Promise<PlaybackPlayPathResponse>;
        playPaths: {
            (
                paths: string[],
                startIndex?: number,
            ): Promise<PlaybackPlayPathsResponse>;
            (
                paths: string[],
                opts: { replace?: boolean; startIndex?: number },
            ): Promise<PlaybackPlayPathsResponse>;
        };
        playPause: () => Promise<PlaybackPlayPauseResponse>;
        prev: () => Promise<PlaybackPreviousResponse>;
        random: () => Promise<PlaybackRandomResponse>;
        seek: (seconds: number) => Promise<PlaybackSetPositionResponse>;
        setOrder: (
            order: number | PlaybackOrder,
        ) => Promise<PlaybackSetPlaybackOrderResponse>;
        setStopAfterCurrent: (
            enabled: boolean,
        ) => Promise<PlaybackSetStopAfterCurrentResponse>;
        setVolume: (volume: number) => Promise<PlaybackSetVolumeResponse>;
        stop: () => Promise<PlaybackStopResponse>;
        toggle: () => Promise<PlaybackPlayOrPauseResponse>;
        toggleMute: () => Promise<PlaybackToggleMuteResponse>;
        toggleStopAfterCurrent: () => Promise<
            PlaybackToggleStopAfterCurrentResponse,
        >;
        volumeDown: () => Promise<PlaybackVolumeDownResponse>;
        volumeUp: () => Promise<PlaybackVolumeUpResponse>;
    } = ...

    player — playback control namespace.

    Type Declaration

    • getCurrentTrack: () => Promise<PlaybackGetCurrentTrackResponse>

      Resolves with found and, when a track is loaded, the shared track row. The host never answers null.

    • getCurrentTrackIndex: (includeTrackInfo?: boolean) => Promise<PlaybackGetCurrentTrackIndexResponse>

      Locate the playing track in its playlist.

    • getOrder: () => Promise<PlaybackGetPlaybackOrderResponse>

      Report the active playback order as its index and its name.

    • getPlayingPlaylist: () => Promise<PlaybackGetPlayingPlaylistResponse>

      Report the playlist playback was last started from.

    • getPosition: () => Promise<PlaybackGetPositionResponse>

      Report the playback position together with the length and identity of the track. All values are zero or empty when nothing is playing.

    • getState: () => Promise<PlaybackGetStateResponse>

      Report the transport state and what the current track allows.

    • getStopAfterCurrent: () => Promise<PlaybackGetStopAfterCurrentResponse>

      Report whether playback stops after the current track.

    • getVolume: () => Promise<PlaybackGetVolumeResponse>

      Report the output volume on both scales the host uses, and whether it is muted.

    • mute: (muted?: boolean) => Promise<PlaybackMuteResponse>

      Mute by default; pass false to unmute.

    • next: () => Promise<PlaybackNextResponse>

      Skip to the next track under the current playback order.

    • pause: () => Promise<PlaybackPauseResponse>

      Pause playback. Does nothing when stopped.

    • play: () => Promise<PlaybackPlayResponse>

      Start playback, or resume when paused.

    • playPath: (path: string) => Promise<PlaybackPlayPathResponse>

      Append one file to the active playlist and play it; creates a playlist when none exists. A |subsong:N suffix selects a subsong of the file.

    • playPaths: {
          (
              paths: string[],
              startIndex?: number,
          ): Promise<PlaybackPlayPathsResponse>;
          (
              paths: string[],
              opts: { replace?: boolean; startIndex?: number },
          ): Promise<PlaybackPlayPathsResponse>;
      }

      Begin playback of the supplied paths.

      Accepts either a single numeric startIndex matching the original (paths, startIndex) signature or an options object { startIndex?, replace? } that additionally controls whether the active playlist is cleared before insertion.

      Absolute file paths. Each entry may carry a |subsong:N suffix for CUE tracks.

      Numeric startIndex (0-based offset into the active playlist), or an options object: - startIndex selects the entry to start playback from (0-based); - replace: true clears the active playlist before inserting; false (default) appends.

    • playPause: () => Promise<PlaybackPlayPauseResponse>

      Toggle between playing and paused; starts playback when stopped.

    • prev: () => Promise<PlaybackPreviousResponse>

      Skip to the previous track under the current playback order.

    • random: () => Promise<PlaybackRandomResponse>

      Start a random track of the active playlist.

    • seek: (seconds: number) => Promise<PlaybackSetPositionResponse>

      Seek within the current track. The host clamps the position to the track and reports both the requested and the applied value.

    • setOrder: (order: number | PlaybackOrder) => Promise<PlaybackSetPlaybackOrderResponse>

      Set the active playback order by index or by name; the host reports what took effect.

    • setStopAfterCurrent: (enabled: boolean) => Promise<PlaybackSetStopAfterCurrentResponse>

      Arm or disarm stopping after the current track.

    • setVolume: (volume: number) => Promise<PlaybackSetVolumeResponse>

      Set the output volume as a percentage; values outside 0 to 100 are clamped. 0 mutes.

    • stop: () => Promise<PlaybackStopResponse>

      Stop playback.

    • toggle: () => Promise<PlaybackPlayOrPauseResponse>

      Toggle between playing and paused; starts playback when stopped.

    • toggleMute: () => Promise<PlaybackToggleMuteResponse>

      Flip the mute state and report the new one.

    • toggleStopAfterCurrent: () => Promise<PlaybackToggleStopAfterCurrentResponse>

      Flip the stop-after-current flag and report the new value.

    • volumeDown: () => Promise<PlaybackVolumeDownResponse>

      Lower the volume by one step (1 dB).

    • volumeUp: () => Promise<PlaybackVolumeUpResponse>

      Raise the volume by one step (1 dB).