You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
197 KiB
JavaScript

4 years ago
/**
* @license
* Video.js 7.8.3 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(h,d){"use strict";h=h&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h,d=d&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d;var p="7.8.3",c=[],e=function(a,l){return function(e,t,n){var i=l.levels[t],r=new RegExp("^("+i+")$");if("log"!==e&&n.unshift(e.toUpperCase()+":"),n.unshift(a+":"),c){c.push([].concat(n));var s=c.length-1e3;c.splice(0,0<s?s:0)}if(h.console){var o=h.console[e];o||"debug"!==e||(o=h.console.info||h.console.log),o&&i&&r.test(e)&&o[Array.isArray(n)?"apply":"call"](h.console,n)}}};var f=function t(n){function i(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r("log",s,t)}var r,s="info";return r=e(n,i),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:s},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');s=e}return s},(i.history=function(){return c?[].concat(c):[]}).filter=function(t){return(c||[]).filter(function(e){return new RegExp(".*"+t+".*").test(e[0])})},i.history.clear=function(){c&&(c.length=0)},i.history.disable=function(){null!==c&&(c.length=0,c=null)},i.history.enable=function(){null===c&&(c=[])},i.error=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r("error",s,t)},i.warn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r("warn",s,t)},i.debug=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r("debug",s,t)},i}("VIDEOJS"),v=f.createLogger;function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r=t(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},t.apply(this,arguments)}e.exports=t}),n=Object.prototype.toString,s=function(e){return a(e)?Object.keys(e):[]};function o(t,n){s(t).forEach(function(e){return n(t[e],e)})}function g(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?r.apply(void 0,[n].concat(t)):(t.forEach(function(e){e&&o(e,function(e,t){n[t]=e})}),n)}function a(e){return!!e&&"object"==typeof e}function l(e){return a(e)&&"[object Object]"===n.call(e)&&e.constructor===Object}function i(e,t){if(!e||!t)return"";if("function"!=typeof h.getComputedStyle)return"";var n=h.getComputedStyle(e);return n?n.getPropertyValue(t)||n[t]:""}function u(e){return"string"==typeof e&&Boolean(e.trim())}function y(e){if(0<=e.indexOf(" "))throw new Error("class has illegal whitespace characters")}function _(){return d===h.document}function m(e){return a(e)&&1===e.nodeType}function b(){try{return h.parent!==h.self}catch(e){return!0}}function T(i){return function(e,t){if(!u(e))return d[i](null);u(t)&&(t=d.querySelector(t));var n=m(t)?t:d;return n[i]&&n[i](e)}}function k(e,n,t,i){void 0===e&&(e="div"),void 0===n&&(n={}),void 0===t&&(t={});var r=d.createElement(e);return Object.getOwnPropertyNames(n).forEach(function(e){var t=n[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(f.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+t+"."),r.setAttribute(e,t)):"textContent"===e?C(r,t):r[e]!==t&&(r[e]=t)}),Object.getOwnPropertyNames(t).forEach(function(e){r.setAttribute(e,t[e])}),i&&K(r,i),r}function C(e,t){return"undefined"==typeof e.textContent?e.innerText=t:e.textContent=t,e}function E(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function S(e,t){return y(t),e.classList?e.classList.contains(
/**
* @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>
*/,Yt=Object.prototype.toString;var Qt=function(e){var r={};return e&&e.trim().split("\n").forEach(function(e){var t=e.indexOf(":"),n=e.slice(0,t).trim().toLowerCase(),i=e.slice(t+1).trim();"undefined"==typeof r[n]?r[n]=i:Array.isArray(r[n])?r[n].push(i):r[n]=[r[n],i]}),r},Jt=tn,Zt=tn;function en(e,t,n){var i=e;return Gt(t)?(n=t,"string"==typeof e&&(i={uri:e})):i=r({},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 t(e){return clearTimeout(a),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,s(e,v)}function e(){if(!o){var e;clearTimeout(a),e=i.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var t=v,n=null;return 0!==e?(t={body:function(){var e=void 0;if(e=l.response?l.response:l.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}(l),f)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:e,method:u,headers:{},url:c,rawRequest:l},l.getAllResponseHeaders&&(t.headers=Qt(l.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),s(n,t,t.body)}}var n,o,a,l=i.xhr||null,c=(l=l||(i.cors||i.useXDR?new tn.XDomainRequest:new tn.XMLHttpRequest)).url=i.uri||i.url,u=l.method=i.method||"GET",h=i.body||i.data,d=l.headers=i.headers||{},p=!!i.sync,f=!1,v={body:void 0,headers:{},statusCode:0,method:u,url:c,rawRequest:l};if("json"in i&&!1!==i.json&&(f=!0,d.accept||d.Accept||(d.Accept="application/json"),"GET"!==u&&"HEAD"!==u&&(d["content-type"]||d["Content-Type"]||(d["Content-Type"]="application/json"),h=JSON.stringify(!0===i.json?h:i.json))),l.onreadystatechange=function(){4===l.readyState&&setTimeout(e,0)},l.onload=e,l.onerror=t,l.onprogress=function(){},l.onabort=function(){o=!0},l.ontimeout=t,l.open(u,c,!p,i.username,i.password),p||(l.withCredentials=!!i.withCredentials),!p&&0<i.timeout&&(a=setTimeout(function(){if(!o){o=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",t(e)}},i.timeout)),l.setRequestHeader)for(n in d)d.hasOwnProperty(n)&&l.setRequestHeader(n,d[n]);else if(i.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(l.responseType=i.responseType),"beforeSend"in i&&"function"==typeof i.beforeSend&&i.beforeSend(l),l.send(h||null),l}tn.XMLHttpRequest=h.XMLHttpRequest||function(){},tn.XDomainRequest="withCredentials"in new tn.XMLHttpRequest?tn.XMLHttpRequest:h.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 h.WebVTT.Parser(h,h.vttjs,h.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&&(h.console&&h.console.groupCollapsed&&h.console.groupCollapsed("Text Track parsing errors for "+t.src),i.forEach(function(e){return f.error(e)}),h.console&&h.console.groupEnd&&h.console.groupEnd()),n.flush()}function sn(e,i){var t={uri:e},n=Ft(e);n&&(t.cors=n),Jt(t,ge(this,function(e,t,n){if(e)return f.error(e,t);i.loaded_=!0,"function"!=typeof h.WebVTT?i.tech_&&i.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"!==e.type)return rn(n,i);f.error("vttjs failed to load, stopping trying to process "+i.src)}):rn(n,i)}))}var on=function(c){function e(e){var t;if(void 0===e&&(e={}),!e.tech)throw new Error("A tech was not provided.");var n=Ne(e,{kind:Ut[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=qt[n.mode]||"disabled",r=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(i="hidden"),(t=c.call(this,n)||this)