This specification extends {{HTMLVideoElement}} to add new features that can be used to detect the user perceived playback quality.

This document is extracted from the [[media-source]] specification in order to work on the playback quality problematic in a larger scope.

Concepts

Each HTMLVideoElement MUST maintain a total video frame count variable keeping track of the total number of frames that have been displayed and dropped. It MUST follow these rules:

Each HTMLVideoElement MUST maintain a dropped video frame count variable keeping track of the total number of frames that have been dropped. It MUST follow these rules:

The following corrupted video frame count concept and associated interfaces are deprecated. They may or may not be present in current implementations.

Each HTMLVideoElement MUST maintain a corrupted video frame count variable keeping track of the total number of corrupted frames detected. It MUST follow these rules:

It is up to the implementation to determine whether to display or drop a corrupted frame. However, regardless of the choice made, the total video frame count and dropped video frame count MUST be updated appropriately.

Extension to the {{HTMLVideoElement}} interface

        partial interface HTMLVideoElement {
          VideoPlaybackQuality getVideoPlaybackQuality();
        };
      

When getVideoPlaybackQuality() method is called, the user agent MUST run the following steps:

  1. Let playbackQuality be a new instance of VideoPlaybackQuality.
  2. Set playbackQuality.creationTime to the current high resolution time.
  3. Set playbackQuality.totalVideoFrames to the current value of the total video frame count.
  4. Set playbackQuality.droppedVideoFrames to the current value of the dropped video frame count.
  5. [DEPRECATED] Set playbackQuality.corruptedVideoFrames to the current value of the corrupted video frame count.
  6. Return playbackQuality.

`VideoPlaybackQuality` interface

        [Exposed=Window]
        interface VideoPlaybackQuality {
          readonly attribute DOMHighResTimeStamp creationTime;
          readonly attribute unsigned long droppedVideoFrames;
          readonly attribute unsigned long totalVideoFrames;

          // Deprecated!
          readonly attribute unsigned long corruptedVideoFrames;
        };
      

The creationTime attribute MUST return the current high resolution time for when object was created.

The droppedVideoFrames attribute MUST return the total number of frames dropped predecode or dropped because the frame missed its display deadline.

The totalVideoFrames attribute MUST return the total number of frames that would have been displayed if no frames are dropped.

[DEPRECATED] The corruptedVideoFrames attribute MUST return the total number of corrupted frames that have been detected.