mediacms/static/lib/video-js/7.20.2/video.es.js

2 lines
501 KiB
JavaScript
Raw Normal View History

/*! For license information please see video.es.js.LICENSE.txt */
import window$1 from"global/window";import document from"global/document";import _extends from"@babel/runtime/helpers/extends";import keycode from"keycode";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inheritsLoose from"@babel/runtime/helpers/inheritsLoose";import safeParseTuple from"safe-json-parse/tuple";import XHR from"@videojs/xhr";import vtt from"videojs-vtt.js";import _construct from"@babel/runtime/helpers/construct";import _inherits from"@babel/runtime/helpers/inherits";import _resolveUrl from"@videojs/vhs-utils/es/resolve-url.js";import{Parser}from"m3u8-parser";import{browserSupportsCodec,DEFAULT_VIDEO_CODEC,DEFAULT_AUDIO_CODEC,muxerSupportsCodec,parseCodecs,translateLegacyCodec,codecsFromDefault,getMimeForCodec,isAudioCodec}from"@videojs/vhs-utils/es/codecs.js";import{simpleTypeFromSourceType}from"@videojs/vhs-utils/es/media-types.js";import{isArrayBufferView,concatTypedArrays,stringToBytes,toUint8}from"@videojs/vhs-utils/es/byte-helpers";import{generateSidxKey,parseUTCTiming,parse,addSidxSegmentsToPlaylist}from"mpd-parser";import parseSidx from"mux.js/lib/tools/parse-sidx";import{getId3Offset}from"@videojs/vhs-utils/es/id3-helpers";import{detectContainerForBytes,isLikelyFmp4MediaSegment}from"@videojs/vhs-utils/es/containers";import{ONE_SECOND_IN_TS}from"mux.js/lib/utils/clock";for(var browserApi,version$5="7.20.2",hooks_={},hooks=function(e,t){return hooks_[e]=hooks_[e]||[],t&&(hooks_[e]=hooks_[e].concat(t)),hooks_[e]},hook=function(e,t){hooks(e,t)},removeHook=function(e,t){var i=hooks(e).indexOf(t);return!(i<=-1||(hooks_[e]=hooks_[e].slice(),hooks_[e].splice(i,1),0))},hookOnce=function(e,t){hooks(e,[].concat(t).map((function(t){return function i(){return removeHook(e,i),t.apply(void 0,arguments)}})))},FullscreenApi={prefixed:!0},apiMap=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],specApi=apiMap[0],i=0;i<apiMap.length;i++)if(apiMap[i][1]in document){browserApi=apiMap[i];break}if(browserApi){for(var _i=0;_i<browserApi.length;_i++)FullscreenApi[specApi[_i]]=browserApi[_i];FullscreenApi.prefixed=browserApi[0]!==specApi[0]}var history=[],LogByTypeFactory=function(e,t){return function(i,n,r){var s=t.levels[n],a=new RegExp("^("+s+")$");if("log"!==i&&r.unshift(i.toUpperCase()+":"),r.unshift(e+":"),history){history.push([].concat(r));var o=history.length-1e3;history.splice(0,o>0?o:0)}if(window$1.console){var l=window$1.console[i];l||"debug"!==i||(l=window$1.console.info||window$1.console.log),l&&s&&a.test(i)&&l[Array.isArray(r)?"apply":"call"](window$1.console,r)}}};function createLogger$1(e){var t,i="info",n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t("log",i,n)};return t=LogByTypeFactory(e,n),n.createLogger=function(t){return createLogger$1(e+": "+t)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:i},n.level=function(e){if("string"==typeof e){if(!n.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');i=e}return i},(n.history=function(){return history?[].concat(history):[]}).filter=function(e){return(history||[]).filter((function(t){return new RegExp(".*"+e+".*").test(t[0])}))},n.history.clear=function(){history&&(history.length=0)},n.history.disable=function(){null!==history&&(history.length=0,history=null)},n.history.enable=function(){null===history&&(history=[])},n.error=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t("error",i,