Media playback quality
The HTMLVideoElement method getVideoPlaybackQuality() creates and returns a VideoPlaybackQuality object containing metrics including how many frames have been lost.
The data returned can be used to evaluate the quality of the video stream.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 23 | 12 | 42 | 8 | 25 | 12.2 | |
| The HTMLVideoElement method getVideoPlaybackQuality() creates and returns a VideoPlaybackQuality object containing metrics including how many frames have been lost. | 80 | 12 | 42 | 8 | 80 | 12.2 |
| The read-only creationTime property on the VideoPlaybackQuality interface reports the number of milliseconds since the browsing context was created this quality sample was recorded. | 23 | 12 | 42 | 8 | 25 | 12.2 |
| The read-only droppedVideoFrames property of the VideoPlaybackQuality interface returns the number of video frames which have been dropped rather than being displayed since the last time the media was loaded into the HTMLVideoElement. | 23 | 12 | 42 | 8 | 25 | 12.2 |
| The VideoPlaybackQuality interface's totalVideoFrames read-only property returns the total number of video frames that have been displayed or dropped since the media was loaded. | 23 | 12 | 42 | 8 | 25 | 12.2 |
Syntax
const videoElem = document.getElementById("my_vid");
const counterElem = document.getElementById("counter");
const quality = videoElem.getVideoPlaybackQuality();
counterElem.innerText = quality.totalVideoFrames; Use cases
-
Using Media playback quality
The HTMLVideoElement method
Cautions
- May not be supported in older browsers.
Implementation notes
- Some APIs require a secure context (HTTPS) or user activation. Check the requirements before use.