@nextcloud/dialogs
    Preparing search index...

    Interface RemotePlayback

    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

    • EventTarget
      • RemotePlayback
    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

      • event: Event

      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>

    • The watchAvailability() method of the RemotePlayback interface watches the list of available remote playback devices and returns a Promise that resolves with the callbackId of a remote playback device.

      MDN Reference

      Returns Promise<number>