Table of Contents

Class RemotePlayback

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

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.

[Value("RemotePlayback")]
public class RemotePlayback : EventTarget
Inheritance
RemotePlayback
Inherited Members

Remarks

Constructors

RemotePlayback()

public RemotePlayback()

Properties

Onconnect

[Value("onconnect")]
public EventHandlerNonNull Onconnect { get; set; }

Property Value

EventHandlerNonNull

Onconnecting

[Value("onconnecting")]
public EventHandlerNonNull Onconnecting { get; set; }

Property Value

EventHandlerNonNull

Ondisconnect

[Value("ondisconnect")]
public EventHandlerNonNull Ondisconnect { get; set; }

Property Value

EventHandlerNonNull

State

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

[Value("state")]
public RemotePlaybackState State { get; }

Property Value

RemotePlaybackState

One of:

Remarks

Methods

CancelWatchAvailability(long)

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

[Value("cancelWatchAvailability")]
public Task<GlobalObject.Undefined> CancelWatchAvailability(long id = 0)

Parameters

id long

Returns

Task<GlobalObject.Undefined>

A Promise that resolves with undefined.

Remarks

Prompt()

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.

[Value("prompt")]
public Task<GlobalObject.Undefined> Prompt()

Returns

Task<GlobalObject.Undefined>

A Promise that resolves with undefined after the user accepts or rejects the prompt.

Remarks

If the user gives permission, the State will be set to connecting and the user agent will connect to the device to initiate playback.

If the user chooses to instead disconnect from the device, the State will be set to disconnected and user agent will disconnect from this device.

See also on MDN

WatchAvailability(RemotePlaybackAvailabilityCallback)

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

[Value("watchAvailability")]
public Task<long> WatchAvailability(RemotePlaybackAvailabilityCallback callback)

Parameters

callback RemotePlaybackAvailabilityCallback

Returns

Task<long>

A Promise that resolves with an integer. This is the callbackId for the identified remote playback device.

Remarks