sesaparcours
    Preparing search index...

    The RemotePlayback interface of the Remote Playback API allows the page to detect availability of remote playback devices, then connect to and control playing on these devices.

    MDN Reference

    interface RemotePlayback {
        onconnect: null | ((this: RemotePlayback, ev: Event) => any);
        onconnecting: null | ((this: RemotePlayback, ev: Event) => any);
        ondisconnect: null | ((this: RemotePlayback, ev: Event) => any);
        state: RemotePlaybackState;
        addEventListener<K extends keyof RemotePlaybackEventMap>(
            type: K,
            listener: (this: RemotePlayback, ev: RemotePlaybackEventMap[K]) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        addEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void;
        cancelWatchAvailability(id?: number): Promise<void>;
        dispatchEvent(event: Event): boolean;
        prompt(): Promise<void>;
        removeEventListener<K extends keyof RemotePlaybackEventMap>(
            type: K,
            listener: (this: RemotePlayback, ev: RemotePlaybackEventMap[K]) => any,
            options?: boolean | EventListenerOptions,
        ): void;
        removeEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void;
        watchAvailability(
            callback: RemotePlaybackAvailabilityCallback,
        ): Promise<number>;
    }

    Hierarchy

    Index

    Properties

    onconnect: null | ((this: RemotePlayback, ev: Event) => any)
    onconnecting: null | ((this: RemotePlayback, ev: Event) => any)
    ondisconnect: null | ((this: RemotePlayback, ev: Event) => any)

    The state read-only property of the RemotePlayback interface returns the current state of the RemotePlayback connection.

    MDN Reference

    Methods

    • The cancelWatchAvailability() method of the RemotePlayback interface cancels the request to watch for one or all available devices.

      MDN Reference

      Parameters

      • Optionalid: number

      Returns Promise<void>

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      Returns boolean

    • The prompt() method of the RemotePlayback interface prompts the user to select an available remote playback device and give permission for the current media to be played using that device.

      MDN Reference

      Returns Promise<void>