WorkerNavigator: mediaCapabilities-Eigenschaft

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

We'd love to hear more about your role and the company you work for
Please help us by answering a few questions.

Hinweis: Diese Funktion ist nur in Web Workers verfügbar.

Die schreibgeschützte mediaCapabilities-Eigenschaft des WorkerNavigator-Interfaces verweist auf ein MediaCapabilities-Objekt, das Informationen über die Decodierungs- und Codierungsfähigkeiten für ein gegebenes Format und die Ausgabefähigkeiten (wie sie durch die Media Capabilities API definiert sind) offenlegen kann.

Wert

Ein MediaCapabilities-Objekt.

Beispiele

js
navigator.mediaCapabilities
  .decodingInfo({
    type: "file",
    audio: {
      contentType: "audio/mp3",
      channels: 2,
      bitrate: 132700,
      samplerate: 5200,
    },
  })
  .then((result) => {
    console.log(
      `This configuration is ${result.supported ? "" : "not "}supported,`,
    );
    console.log(`${result.smooth ? "" : "not "}smooth, and`);
    console.log(`${result.powerEfficient ? "" : "not "}power efficient.`);
  });

Spezifikationen

Specification
Media Capabilities
# dom-workernavigator-mediacapabilities

Browser-Kompatibilität

Siehe auch