VideoPlaybackQuality
接口的
totalVideoFrames
read-only property returns the total number of video frames that have been displayed or dropped since the media was loaded.
value = videoPlaybackQuality.totalVideoFrames;
The total number of frames that the
<video>
element has displayed or dropped since the media was loaded into it. Essentially, this is the number of frames the element
would have presented
had no problems occurred.
This value is reset when the media is reloaded or replaced.
This example calls
getVideoPlaybackQuality()
to obtain a
VideoPlaybackQuality
object, then determines what percentage of frames have been lost by either corruption or being dropped. If that exceeds 10% (0.1), a function called
lostFramesThresholdExceeded()
is called to, perhaps, update a quality indicator to show an increase in frame loss.
var videoElem = document.getElementById("my_vid");
var quality = videoElem.getVideoPlaybackQuality();
if ((quality.corruptedVideoFrames + quality.droppedVideoFrames)/quality.totalVideoFrames > 0.1) {
lostFramesThresholdExceeded();
}
A similar algorithm might be used to attempt to switch to a lower-resolution video that requires less bandwidth, in order to avoid dropping frames.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Media Playback Quality
The definition of 'VideoPlaybackQuality.totalVideoFrames' in that specification. |
编者草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
totalVideoFrames
|
Chrome 23 | Edge 12 |
Firefox
42
|
IE 11 | Opera 15 | Safari 8 | WebView Android 4.4.3 | Chrome Android ? | Firefox Android 不支持 No | Opera Android 14 | Safari iOS 不支持 No | Samsung Internet Android ? |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
见实现注意事项。
用户必须明确启用此特征。
HTMLVideoElement.getVideoPlaybackQuality()
method for constructing and returning this interface.
VideoPlaybackQuality
corruptedVideoFrames
creationTime
droppedVideoFrames
totalFrameDelay
totalVideoFrames
BeforeUnloadEvent
DOMStringMap
ErrorEvent
GlobalEventHandlers
HTMLAnchorElement
HTMLAreaElement
HTMLAudioElement
HTMLBRElement
HTMLBaseElement
HTMLBaseFontElement
HTMLBodyElement
HTMLButtonElement
HTMLCanvasElement
HTMLContentElement
HTMLDListElement
HTMLDataElement
HTMLDataListElement
HTMLDialogElement
HTMLDivElement
HTMLDocument
HTMLElement
HTMLEmbedElement
HTMLFieldSetElement
HTMLFormControlsCollection
HTMLFormElement
HTMLFrameSetElement
HTMLHRElement
HTMLHeadElement
HTMLHeadingElement
HTMLHtmlElement
HTMLIFrameElement
HTMLImageElement
HTMLInputElement
HTMLIsIndexElement
HTMLKeygenElement
HTMLLIElement
HTMLLabelElement
HTMLLegendElement
HTMLLinkElement
HTMLMapElement
HTMLMediaElement
HTMLMetaElement
HTMLMeterElement
HTMLModElement
HTMLOListElement
HTMLObjectElement
HTMLOptGroupElement
HTMLOptionElement
HTMLOptionsCollection
HTMLOutputElement
HTMLParagraphElement
HTMLParamElement
HTMLPictureElement
HTMLPreElement
HTMLProgressElement
HTMLQuoteElement
HTMLScriptElement
HTMLSelectElement
HTMLShadowElement
HTMLSourceElement
HTMLSpanElement
HTMLStyleElement
HTMLTableCaptionElement
HTMLTableCellElement
HTMLTableColElement
HTMLTableDataCellElement
HTMLTableElement
HTMLTableHeaderCellElement
HTMLTableRowElement
HTMLTableSectionElement
HTMLTemplateElement
HTMLTextAreaElement
HTMLTimeElement
HTMLTitleElement
HTMLTrackElement
HTMLUListElement
HTMLUnknownElement
HTMLVideoElement
HashChangeEvent
历史
ImageData
定位
MessageChannel
MessageEvent
MessagePort
Navigator
NavigatorGeolocation
NavigatorID
NavigatorLanguage
NavigatorOnLine
NavigatorPlugins
PageTransitionEvent
Plugin
PluginArray
PopStateEvent
PortCollection
PromiseRejectionEvent
RadioNodeList
Transferable
ValidityState
Window
WindowBase64
WindowEventHandlers
WindowTimers