RemotePlayback: cancelWatchAvailability() Methode
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Die cancelWatchAvailability() Methode des RemotePlayback-Interfaces storniert die Anfrage, um auf ein oder alle verfügbaren Geräte zu achten.
Syntax
cancelWatchAvailability()
cancelWatchAvailability(id)
Parameter
idOptional-
Die
callbackIdeines bestimmten Remote-Playback-Geräts.Wenn eine
callbackIdeines spezifischen Geräts übergeben wird, dann wird dieses Gerät aus der Liste der überwachten Geräte entfernt. Andernfalls wird die gesamte Liste gelöscht.
Rückgabewert
Ein Promise, das mit undefined aufgelöst wird.
Ausnahmen
InvalidStateErrorDOMException-
Wird ausgelöst, wenn
disableRemotePlaybackfür das Medienelement auftruegesetzt ist. NotFoundErrorDOMException-
Wird ausgelöst, wenn eine
idübergeben wird, die keiner verfügbarencallbackIdentspricht.
Beispiele
Sobald ein Remote-Playback-Gerät identifiziert und verbunden wurde, kann die Überwachung der verfügbaren Geräte mit cancelWatchAvailability() gestoppt werden.
function switchToRemoteUI() {
// Indicate that the state is 'connecting' or 'connected' to the user.
// For example, hide the video element as only controls are needed.
videoElem.style.display = "none";
// Stop monitoring the availability of remote playback devices.
videoElem.remote.cancelWatchAvailability();
}
Spezifikationen
| Specification |
|---|
| Remote Playback API> # dom-remoteplayback-cancelwatchavailability> |
Browser-Kompatibilität
Loading…