This feature is not Baseline because it does not work in some of the most widely-used browsers.
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.
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.
prompt()
None.
A Promise that resolves with undefined after the user accepts or rejects the prompt.
The promise will be rejected with one of the following exceptions:
InvalidStateError DOMException
Thrown if disableRemotePlayback is true for the media element.
OperationError DOMException
Thrown if there is already an unsettled promise from a previous call to prompt() for this media element, or browsing context.
InvalidAccessError DOMException
Thrown if the user has not interacted with this device recently.
NotSupportedError DOMException
Thrown if the user agent knows that remote playback of this particular media is not feasible.
NotFoundError DOMException
Thrown if remote playback is unavailable.
NotAllowedError DOMException
Thrown if the user denies permission to use the device.
Transient user activation is required. The user has to interact with the page or a UI element in order for this feature to work.
In the following example the user is prompted to select a remote playback device to play a video.
devicesBtn.onclick = () => {
// Request the user to select a remote playback device.
videoElem.remote
.prompt()
// Update the UI and monitor the connected state.
.then(updateRemotePlaybackState);
// Otherwise, the user cancelled the selection UI or no screens were found.
};
| Specification |
|---|
| Remote Playback API> # dom-remoteplayback-prompt> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
prompt |
121 | 121 | No | 107 | 13.1 | 56 | No | 43 | 13.4 | 6.0 | No | 13.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RemotePlayback/prompt