A polyfill/ponyfill for HTMLVideoElement.prototype.getVideoPlaybackQuality()
.
HTMLVideoElement.prototype.getVideoPlaybackQuality()
return a VideoPlaybackQuality object.
For more details, see Media Playback Quality
Install with npm:
npm install videoplaybackquality
require("videoplaybackquality/polyfill");
// usage
var video = document.getElementById("js-video");
console.log(video.getVideoPlaybackQuality());
const getVideoPlaybackQuality = require("videoplaybackquality").getVideoPlaybackQuality;
// usage
var video = document.getElementById("js-video");
getVideoPlaybackQuality(video);
/*
{
'droppedVideoFrames': 0,
'totalVideoFrames': 0,
'corruptedVideoFrames': 0,
'creationTime': 0,
'totalFrameDelay': 0
}
*
See example/
VideoPlaybackQuality
is connected each Video
source.
In other words, It will be reset when replace exist video source with new source.
WebKit can not get complete VideoPlaybackQuality.
This polyfill return following data:
{
'droppedVideoFrames': webKitVideo.webkitDroppedFrameCount,
'totalVideoFrames': webKitVideo.webkitDecodedFrameCount,
// Not provided by this polyfill:
'corruptedVideoFrames': 0,
'creationTime': NaN,
'totalFrameDelay': 0
}
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
MIT © azu