Documentation
    Preparing search index...

    Type Alias MediaSessionTarget

    Minimal subset of navigator.mediaSession the browser bridge depends on. Makes the bridge Node/test-safe: unit tests pass a MockMediaSession via mediaSessionTarget. The handler parameter uses details? (optional) so both the real DOM impl (which always passes an object) and test mocks that omit details both satisfy this type structurally.

    type MediaSessionTarget = {
        metadata: MediaMetadataLike | null;
        playbackState: "none" | "playing" | "paused";
        setActionHandler(
            action: string,
            handler:
                | ((details?: { action?: string; seekTime?: number }) => void)
                | null,
        ): void;
    }
    Index

    Properties

    metadata: MediaMetadataLike | null
    playbackState: "none" | "playing" | "paused"

    Methods

    • Parameters

      • action: string
      • handler: ((details?: { action?: string; seekTime?: number }) => void) | null

      Returns void