20 lines
209 KiB
JavaScript
20 lines
209 KiB
JavaScript
|
/**
|
||
|
* @license
|
||
|
* Video.js 7.15.6 <http://videojs.com/>
|
||
|
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
||
|
* Available under Apache License Version 2.0
|
||
|
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
||
|
*
|
||
|
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
||
|
* Available under Apache License Version 2.0
|
||
|
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
||
|
*/
|
||
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojs=t()}(this,function(){"use strict";for(var e,l="7.15.6",n={},s=function(e,t){return n[e]=n[e]||[],t&&(n[e]=n[e].concat(t)),n[e]},i=function(e,t){t=s(e).indexOf(t);return!(t<=-1)&&(n[e]=n[e].slice(),n[e].splice(t,1),!0)},c={prefixed:!0},t=[["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"]],r=t[0],o=0;o<t.length;o++)if(t[o][1]in document){e=t[o];break}if(e){for(var a=0;a<e.length;a++)c[r[a]]=e[a];c.prefixed=e[0]!==r[0]}var u=[],h=function(s,o){return function(e,t,n){var i,r=o.levels[t],t=new RegExp("^("+r+")$");"log"!==e&&n.unshift(e.toUpperCase()+":"),n.unshift(s+":"),u&&(u.push([].concat(n)),i=u.length-1e3,u.splice(0,0<i?i:0)),!window.console||(i=!(i=window.console[e])&&"debug"===e?window.console.info||window.console.log:i)&&r&&t.test(e)&&i[Array.isArray(n)?"apply":"call"](window.console,n)}};var d=function t(n){function i(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];s("log",r,t)}var r="info",s=h(n,i);return i.createLogger=function(e){return t(n+": "+e)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');r=e}return r},(i.history=function(){return u?[].concat(u):[]}).filter=function(t){return(u||[]).filter(function(e){return new RegExp(".*"+t+".*").test(e[0])})},i.history.clear=function(){u&&(u.length=0)},i.history.disable=function(){null!==u&&(u.length=0,u=null)},i.history.enable=function(){null===u&&(u=[])},i.error=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s("error",r,t)},i.warn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s("warn",r,t)},i.debug=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s("debug",r,t)},i}("VIDEOJS"),p=d.createLogger,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e,t){return e(t={exports:{}},t.exports),t.exports}var g=v(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,i=arguments[t];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},t.apply(this,arguments)}e.exports=t}),_=Object.prototype.toString,y=function(e){return T(e)?Object.keys(e):[]};function m(t,n){y(t).forEach(function(e){return n(t[e],e)})}function b(n){for(var e=arguments.length,t=new Array(1<e?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Object.assign?g.apply(void 0,[n].concat(t)):(t.forEach(function(e){e&&m(e,function(e,t){n[t]=e})}),n)}function T(e){return!!e&&"object"==typeof e}function k(e){return T(e)&&"[object Object]"===_.call(e)&&e.constructor===Object}function C(e,t){if(!e||!t)return"";if("function"!=typeof window.getComputedStyle)return"";var n;try{n=window.getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}var w=window.navigator&&window.navigator.userAgent||"",E=/AppleWebKit\/([\d.]+)/i.exec(w),S=E?parseFloat(E.pop()):null,x=/iPod/i.test(w),P=(qt=w.match(/OS (\d+)_/i))&&qt[1]?qt[1]:null,j=/Android/i.test(w),A=function(){var e=w.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t
|
||
|
/**
|
||
|
* @license
|
||
|
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
||
|
* Copyright (c) 2014 David Björklund
|
||
|
* Available under the MIT license
|
||
|
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
||
|
*/
|
||
|
var Qt=function(e){var i={};return e&&e.trim().split("\n").forEach(function(e){var t=e.indexOf(":"),n=e.slice(0,t).trim().toLowerCase(),t=e.slice(t+1).trim();"undefined"==typeof i[n]?i[n]=t:Array.isArray(i[n])?i[n].push(t):i[n]=[i[n],t]}),i},Jt=tn,Zt=tn;function en(e,t,n){var i=e;return Gt(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=g({},t,{uri:e}),i.callback=n,i}function tn(e,t,n){return nn(t=en(e,t,n))}function nn(i){if("undefined"==typeof i.callback)throw new Error("callback argument missing");var r=!1,s=function(e,t,n){r||(r=!0,i.callback(e,t,n))};function o(){var e=void 0,e=c.response||c.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c);if(v)try{e=JSON.parse(e)}catch(e){}return e}function t(e){return clearTimeout(l),(e=!(e instanceof Error)?new Error(""+(e||"Unknown XMLHttpRequest Error")):e).statusCode=0,s(e,g)}function e(){if(!a){clearTimeout(l);var e=i.useXDR&&void 0===c.status?200:1223===c.status?204:c.status,t=g,n=null;return 0!==e?(t={body:o(),statusCode:e,method:h,headers:{},url:u,rawRequest:c},c.getAllResponseHeaders&&(t.headers=Qt(c.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),s(n,t,t.body)}}var n,a,l,c=i.xhr||null,u=(c=c||new(i.cors||i.useXDR?tn.XDomainRequest:tn.XMLHttpRequest)).url=i.uri||i.url,h=c.method=i.method||"GET",d=i.body||i.data,p=c.headers=i.headers||{},f=!!i.sync,v=!1,g={body:void 0,headers:{},statusCode:0,method:h,url:u,rawRequest:c};if("json"in i&&!1!==i.json&&(v=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==h&&"HEAD"!==h&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),d=JSON.stringify(!0===i.json?d:i.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(e,0)},c.onload=e,c.onerror=t,c.onprogress=function(){},c.onabort=function(){a=!0},c.ontimeout=t,c.open(h,u,!f,i.username,i.password),f||(c.withCredentials=!!i.withCredentials),!f&&0<i.timeout&&(l=setTimeout(function(){var e;a||(a=!0,c.abort("timeout"),(e=new Error("XMLHttpRequest timeout")).code="ETIMEDOUT",t(e))},i.timeout)),c.setRequestHeader)for(n in p)p.hasOwnProperty(n)&&c.setRequestHeader(n,p[n]);else if(i.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return;return 1}(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(c.responseType=i.responseType),"beforeSend"in i&&"function"==typeof i.beforeSend&&i.beforeSend(c),c.send(d||null),c}tn.XMLHttpRequest=$t.XMLHttpRequest||function(){},tn.XDomainRequest="withCredentials"in new tn.XMLHttpRequest?tn.XMLHttpRequest:$t.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(i){tn["delete"===i?"del":i]=function(e,t,n){return(t=en(e,t,n)).method=i.toUpperCase(),nn(t)}}),Jt.default=Zt;function rn(e,t){var n=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder()),i=[];n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){i.push(e)},n.onflush=function(){t.trigger({type:"loadeddata",target:t})},n.parse(e),0<i.length&&(window.console&&window.console.groupCollapsed&&window.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(e){return d.error(e)}),window.console&&window.console.groupEnd&&window.console.groupEnd()),n.flush()}function sn(e,i){var t={uri:e};(e=Ft(e))&&(t.cors=e),(e="use-credentials"===i.tech_.crossOrigin())&&(t.withCredentials=e),Jt(t,We(this,function(e,t,n){return e?d.error(e,t):(i.loaded_=!0,void("function"!=typeof window.WebVTT?i.tech_&&i.tech_.any(["vttjsloaded","vttjserror"],function(e){return"vttjserror"!==e.type?rn(n,i):void d.error("vttjs failed to load, stopping trying to process "+i.src)}):rn(n,i)))}))}var on=function(l){function e(e){var t;if(!(e=void 0===e?{}:e).tech)throw new Error("A tech was not provided.");var e=ct(e,{kind:zt[e.kind]||"subtitles",language:e.language||e.srclang||""}),n=Ut[e.mode]||"disabled",i=e.default;"m
|