@epiclabs/epic-video-player
Version:
Video player wrapper to support different video sources with an unified interface
49 lines (48 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.timeRangesToITimeRanges = exports.getPlayed = exports.getSeekable = exports.getBuffered = exports.getDuration = exports.getDroppedFrames = void 0;
function getDroppedFrames(htmlVideo) {
if (!htmlVideo) {
return;
}
return htmlVideo.getVideoPlaybackQuality().droppedVideoFrames;
}
exports.getDroppedFrames = getDroppedFrames;
function getDuration(htmlVideo) {
if (!htmlVideo) {
return;
}
return htmlVideo.duration;
}
exports.getDuration = getDuration;
function getBuffered(htmlVideo) {
if (!htmlVideo) {
return;
}
return htmlVideo.buffered;
}
exports.getBuffered = getBuffered;
function getSeekable(htmlVideo) {
if (!htmlVideo) {
return;
}
return htmlVideo.seekable;
}
exports.getSeekable = getSeekable;
function getPlayed(htmlVideo) {
if (!htmlVideo) {
return;
}
return htmlVideo.played;
}
exports.getPlayed = getPlayed;
function timeRangesToITimeRanges(tr) {
var res = [];
if (tr && tr.length > 0) {
for (var i = 0; i < tr.length; i++) {
res.push({ start: tr.start(i), end: tr.end(i) });
}
}
return res;
}
exports.timeRangesToITimeRanges = timeRangesToITimeRanges;