npm.videojs.09e8aaf965648c5b5e99.0.1.0.js 17 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["npm.videojs"],{"045f":function(t,e,r){"use strict";var n=r("d7d28"),o=r("a559"),i=r("8362");function u(t,e,r){var n=t;return i(e)?(r=e,"string"==typeof t&&(n={uri:t})):n=o({},e,{uri:t}),n.callback=r,n}function a(t,e,r){return c(e=u(t,e,r))}function c(t){if(void 0===t.callback)throw new Error("callback argument missing");var e=!1,r=function(r,n,o){e||(e=!0,t.callback(r,n,o))};function n(){var t=void 0;if(t=s.response?s.response:s.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;var e=t.responseXML&&"parsererror"===t.responseXML.documentElement.nodeName;if(""===t.responseType&&!e)return t.responseXML}catch(t){}return null}(s),h)try{t=JSON.parse(t)}catch(t){}return t}function o(t){return clearTimeout(f),t instanceof Error||(t=new Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,r(t,g)}function i(){if(!c){var e;clearTimeout(f),e=t.useXDR&&void 0===s.status?200:1223===s.status?204:s.status;var o=g,i=null;return 0!==e?(o={body:n(),statusCode:e,method:d,headers:{},url:l,rawRequest:s},s.getAllResponseHeaders&&(o.headers=function(t){var e={};return t?(t.trim().split("\n").forEach((function(t){var r=t.indexOf(":"),n=t.slice(0,r).trim().toLowerCase(),o=t.slice(r+1).trim();void 0===e[n]?e[n]=o:Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]})),e):e}(s.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),r(i,o,o.body)}}var u,c,s=t.xhr||null;s||(s=t.cors||t.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var f,l=s.url=t.uri||t.url,d=s.method=t.method||"GET",p=t.body||t.data,v=s.headers=t.headers||{},b=!!t.sync,h=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:l,rawRequest:s};if("json"in t&&!1!==t.json&&(h=!0,v.accept||v.Accept||(v.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),p=JSON.stringify(!0===t.json?p:t.json))),s.onreadystatechange=function(){4===s.readyState&&setTimeout(i,0)},s.onload=i,s.onerror=o,s.onprogress=function(){},s.onabort=function(){c=!0},s.ontimeout=o,s.open(d,l,!b,t.username,t.password),b||(s.withCredentials=!!t.withCredentials),!b&&t.timeout>0&&(f=setTimeout((function(){if(!c){c=!0,s.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",o(t)}}),t.timeout)),s.setRequestHeader)for(u in v)v.hasOwnProperty(u)&&s.setRequestHeader(u,v[u]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(s.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(s),s.send(p||null),s}t.exports=a,t.exports.default=a,a.XMLHttpRequest=n.XMLHttpRequest||function(){},a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:n.XDomainRequest,function(t,e){for(var r=0;r<t.length;r++)e(t[r])}(["get","put","post","patch","head","delete"],(function(t){a["delete"===t?"del":t]=function(e,r,n){return(r=u(e,r,n)).method=t.toUpperCase(),c(r)}}))},"17a3":function(t,e,r){"use strict";r.d(e,"j",(function(){return c})),r.d(e,"i",(function(){return s})),r.d(e,"d",(function(){return f})),r.d(e,"g",(function(){return l})),r.d(e,"f",(function(){return d})),r.d(e,"e",(function(){return p})),r.d(e,"c",(function(){return v})),r.d(e,"h",(function(){return b})),r.d(e,"a",(function(){return h})),r.d(e,"b",(function(){return g}));var n=r("d36e"),o=r.n(n),i={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},u=["video","audio","text"],a=["Video","Audio","Text"],c=function(t){return t?t.replace(/avc1\.(\d+)\.(\d+)/i,(function(t,e,r){return"avc1."+("00"+Number(e).toString(16)).slice(-2)+"00"+("00"+Number(r).toString(16)).slice(-2)})):t},s=function(t){void 0===t&&(t="");var e=t.split(","),r=[];return e.forEach((function(t){var e;t=t.trim(),u.forEach((function(n){var o=i[n].exec(t.toLowerCase());if(o&&!(o.length<=1)){e=n;var u=t.substring(0,o[1].length),a=t.replace(u,"");r.push({type:u,details:a,mediaType:n})}})),e||r.push({type:t,details:"",mediaType:"unknown"})})),r},f=function(t,e){if(!t.mediaGroups.AUDIO||!e)return null;var r=t.mediaGroups.AUDIO[e];if(!r)return null;for(var n in r){var o=r[n];if(o.default&&o.playlists)return s(o.playlists[0].attributes.CODECS)}return null},l=function(t){return void 0===t&&(t=""),i.video.test(t.trim().toLowerCase())},d=function(t){return void 0===t&&(t=""),i.audio.test(t.trim().toLowerCase())},p=function(t){if(t&&"string"==typeof t){var e=t.toLowerCase().split(",").map((function(t){return c(t.trim())})),r="video";1===e.length&&d(e[0])?r="audio":1===e.length&&function(t){return void 0===t&&(t=""),i.text.test(t.trim().toLowerCase())}(e[0])&&(r="application");var n="mp4";return e.every((function(t){return i.mp4.test(t)}))?n="mp4":e.every((function(t){return i.webm.test(t)}))?n="webm":e.every((function(t){return i.ogg.test(t)}))&&(n="ogg"),r+"/"+n+';codecs="'+t+'"'}},v=function(t){return void 0===t&&(t=""),o.a.MediaSource&&o.a.MediaSource.isTypeSupported&&o.a.MediaSource.isTypeSupported(p(t))||!1},b=function(t){return void 0===t&&(t=""),t.toLowerCase().split(",").every((function(t){t=t.trim();for(var e=0;e<a.length;e++){if(i["muxer"+a[e]].test(t))return!0}return!1}))},h="mp4a.40.2",g="avc1.4d400d"},"321f":function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r("de66"),o=Object(n.j)([73,68,51]),i=function t(e,r){return void 0===r&&(r=0),(e=Object(n.j)(e)).length-r<10||!Object(n.a)(e,o,{offset:r})?r:(r+=function(t,e){void 0===e&&(e=0);var r=(t=Object(n.j)(t))[e+5],o=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&r)>>4?o+20:o+10}(e,r),t(e,r))}},"63ec":function(t,e,r){"use strict";var n=r("d136"),o=r.n(n),i=r("d36e"),u=r.n(i);e.a=function(t,e){return/^[a-z]+:/i.test(e)?e:(/\/\//i.test(t)||(t=o.a.buildAbsoluteURL(u.a.location&&u.a.location.href||"",t)),o.a.buildAbsoluteURL(t,e))}},"8b53":function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,o=/^application\/dash\+xml/i,i=function(t){return n.test(t)?"hls":o.test(t)?"dash":"application/vnd.videojs.vhs+json"===t?"vhs-json":null}},b209:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var r=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(r,1),r>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var r=e.length,n=0;n<r;++n)e[n].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),i=e.length,u=0;u<i;++u)e[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",(function(e){t.push(e)}))},t}()},d36e:function(t,e,r){(function(e){var r;r="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=r}).call(this,r("c8ba"))},d7d28:function(t,e,r){(function(e){var r;r="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},t.exports=r}).call(this,r("c8ba"))},de66:function(t,e,r){"use strict";r.d(e,"f",(function(){return u})),r.d(e,"j",(function(){return a})),r.d(e,"i",(function(){return c})),r.d(e,"h",(function(){return s})),r.d(e,"b",(function(){return d})),r.d(e,"e",(function(){return p})),r.d(e,"c",(function(){return v})),r.d(e,"g",(function(){return b})),r.d(e,"d",(function(){return h})),r.d(e,"a",(function(){return g}));var n=r("d36e"),o=r.n(n),i=function(t){return Math.ceil(function(t){return t.toString(2).length}(t)/8)},u=function(t,e,r){return void 0===r&&(r=" "),(function(t,e){for(var r="";e--;)r+=t;return r}(r,e)+t.toString()).slice(-e)},a=function(t){return t instanceof Uint8Array?t:(Array.isArray(t)||function(t){return ArrayBuffer.isView(t)}(t)||t instanceof ArrayBuffer||(t="number"!=typeof t||"number"==typeof t&&t!=t?0:[t]),new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0))},c=function(t){t=a(t);for(var e="",r=0;r<t.length;r++)e+=u(t[r].toString(16),2,"0");return e},s=function(t){t=a(t);for(var e="",r=0;r<t.length;r++)e+=u(t[r].toString(2),8,"0");return e},f=o.a.BigInt||Number,l=[f("0x1"),f("0x100"),f("0x10000"),f("0x1000000"),f("0x100000000"),f("0x10000000000"),f("0x1000000000000"),f("0x100000000000000"),f("0x10000000000000000")],d=(function(){var t=new Uint16Array([65484]),e=new Uint8Array(t.buffer,t.byteOffset,t.byteLength);255===e[0]||e[0]}(),function(t,e){var r=void 0===e?{}:e,n=r.signed,o=void 0!==n&&n,i=r.le,u=void 0!==i&&i;t=a(t);var c=u?"reduce":"reduceRight",s=(t[c]?t[c]:Array.prototype[c]).call(t,(function(e,r,n){var o=u?n:Math.abs(n+1-t.length);return e+f(r)*l[o]}),f(0));if(o){var d=l[t.length]/f(2)-f(1);(s=f(s))>d&&(s-=d,s-=d,s-=f(2))}return Number(s)}),p=function(t,e){var r=(void 0===e?{}:e).le,n=void 0!==r&&r;("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&t!=t)&&(t=0),t=f(t);for(var o=i(t),u=new Uint8Array(new ArrayBuffer(o)),a=0;a<o;a++){var c=n?a:Math.abs(a+1-u.length);u[c]=Number(t/l[a]&f(255)),t<0&&(u[c]=Math.abs(~u[c]),u[c]-=0===a?1:2)}return u},v=function(t){if(!t)return"";t=Array.prototype.slice.call(t);var e=String.fromCharCode.apply(null,a(t));try{return decodeURIComponent(escape(e))}catch(t){}return e},b=function(t,e){if("string"!=typeof t&&t&&"function"==typeof t.toString&&(t=t.toString()),"string"!=typeof t)return new Uint8Array;e||(t=unescape(encodeURIComponent(t)));for(var r=new Uint8Array(t.length),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r},h=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if((e=e.filter((function(t){return t&&(t.byteLength||t.length)&&"string"!=typeof t}))).length<=1)return a(e[0]);var n=e.reduce((function(t,e,r){return t+(e.byteLength||e.length)}),0),o=new Uint8Array(n),i=0;return e.forEach((function(t){t=a(t),o.set(t,i),i+=t.byteLength})),o},g=function(t,e,r){var n=void 0===r?{}:r,o=n.offset,i=void 0===o?0:o,u=n.mask,c=void 0===u?[]:u;t=a(t);var s=(e=a(e)).every?e.every:Array.prototype.every;return e.length&&t.length-i>=e.length&&s.call(e,(function(e,r){return e===(c[r]?c[r]&t[i+r]:t[i+r])}))}},f8a8:function(t,e,r){"use strict";r.d(e,"a",(function(){return T})),r.d(e,"b",(function(){return x}));var n,o=r("de66"),i=(new Uint8Array([79,112,117,115,72,101,97,100]),function(t){return"string"==typeof t?Object(o.g)(t):t}),u=function(t){return Array.isArray(t)?t.map((function(t){return i(t)})):[i(t)]},a=function(t){t=Object(o.j)(t);for(var e=[],r=0;t.length>r;){var i=t[r],u=0,a=0,c=t[++a];for(a++;128&c;)u=(127&c)<<7,c=t[a],a++;u+=127&c;for(var s=0;s<n.length;s++){var f=n[s],l=f.id,d=f.parser;if(i===l){e.push(d(t.subarray(a,a+u)));break}}r+=u+a}return e};n=[{id:3,parser:function(t){var e={tag:3,id:t[0]<<8|t[1],flags:t[2],size:3,dependsOnEsId:0,ocrEsId:0,descriptors:[],url:""};if(128&e.flags&&(e.dependsOnEsId=t[e.size]<<8|t[e.size+1],e.size+=2),64&e.flags){var r=t[e.size];e.url=Object(o.c)(t.subarray(e.size+1,e.size+1+r)),e.size+=r}return 32&e.flags&&(e.ocrEsId=t[e.size]<<8|t[e.size+1],e.size+=2),e.descriptors=a(t.subarray(e.size))||[],e}},{id:4,parser:function(t){return{tag:4,oti:t[0],streamType:t[1],bufferSize:t[2]<<16|t[3]<<8|t[4],maxBitrate:t[5]<<24|t[6]<<16|t[7]<<8|t[8],avgBitrate:t[9]<<24|t[10]<<16|t[11]<<8|t[12],descriptors:a(t.subarray(13))}}},{id:5,parser:function(t){return{tag:5,bytes:t}}},{id:6,parser:function(t){return{tag:6,bytes:t}}}];var c={EBML:Object(o.j)([26,69,223,163]),DocType:Object(o.j)([66,130]),Segment:Object(o.j)([24,83,128,103]),SegmentInfo:Object(o.j)([21,73,169,102]),Tracks:Object(o.j)([22,84,174,107]),Track:Object(o.j)([174]),TrackNumber:Object(o.j)([215]),DefaultDuration:Object(o.j)([35,227,131]),TrackEntry:Object(o.j)([174]),TrackType:Object(o.j)([131]),FlagDefault:Object(o.j)([136]),CodecID:Object(o.j)([134]),CodecPrivate:Object(o.j)([99,162]),VideoTrack:Object(o.j)([224]),AudioTrack:Object(o.j)([225]),Cluster:Object(o.j)([31,67,182,117]),Timestamp:Object(o.j)([231]),TimestampScale:Object(o.j)([42,215,177]),BlockGroup:Object(o.j)([160]),BlockDuration:Object(o.j)([155]),Block:Object(o.j)([161]),SimpleBlock:Object(o.j)([163])},s=[128,64,32,16,8,4,2,1],f=function(t,e,r,n){void 0===r&&(r=!0),void 0===n&&(n=!1);var i=function(t){for(var e=1,r=0;r<s.length&&!(t&s[r]);r++)e++;return e}(t[e]),u=t.subarray(e,e+i);return r&&((u=Array.prototype.slice.call(t,e,e+i))[0]^=s[i-1]),{length:i,value:Object(o.b)(u,{signed:n}),bytes:u}},l=function t(e){return"string"==typeof e?e.match(/.{1,2}/g).map((function(e){return t(e)})):"number"==typeof e?Object(o.e)(e):e},d=function t(e,r,n){if(n>=r.length)return r.length;var i=f(r,n,!1);if(Object(o.a)(e.bytes,i.bytes))return n;var u=f(r,n+i.length);return t(e,r,n+u.length+u.value+i.length)},p=function t(e,r){r=function(t){return Array.isArray(t)?t.map((function(t){return l(t)})):[l(t)]}(r),e=Object(o.j)(e);var n=[];if(!r.length)return n;for(var i=0;i<e.length;){var u=f(e,i,!1),a=f(e,i+u.length),c=i+u.length+a.length;127===a.value&&(a.value=d(u,e,c),a.value!==e.length&&(a.value-=c));var s=c+a.value>e.length?e.length:c+a.value,p=e.subarray(c,s);Object(o.a)(r[0],u.bytes)&&(1===r.length?n.push(p):n=n.concat(t(p,r.slice(1)))),i+=u.length+a.length+p.length}return n},v=r("321f"),b=Object(o.j)([0,0,0,1]),h=Object(o.j)([0,0,1]),g=Object(o.j)([0,0,3]),j=function(t){for(var e=[],r=1;r<t.length-2;)Object(o.a)(t.subarray(r,r+3),g)&&(e.push(r+2),r++),r++;if(0===e.length)return t;var n=t.length-e.length,i=new Uint8Array(n),u=0;for(r=0;r<n;u++,r++)u===e[0]&&(u++,e.shift()),i[r]=t[u];return i},y=function(t,e,r,n){void 0===n&&(n=1/0),t=Object(o.j)(t),r=[].concat(r);for(var i,u=0,a=0;u<t.length&&(a<n||i);){var c=void 0;if(Object(o.a)(t.subarray(u),b)?c=4:Object(o.a)(t.subarray(u),h)&&(c=3),c){if(a++,i)return j(t.subarray(i,u));var s=void 0;"h264"===e?s=31&t[u+c]:"h265"===e&&(s=t[u+c]>>1&63),-1!==r.indexOf(s)&&(i=u+c),u+=c+("h264"===e?1:2)}else u++}return t.subarray(0,0)},m={webm:Object(o.j)([119,101,98,109]),matroska:Object(o.j)([109,97,116,114,111,115,107,97]),flac:Object(o.j)([102,76,97,67]),ogg:Object(o.j)([79,103,103,83]),ac3:Object(o.j)([11,119]),riff:Object(o.j)([82,73,70,70]),avi:Object(o.j)([65,86,73]),wav:Object(o.j)([87,65,86,69]),"3gp":Object(o.j)([102,116,121,112,51,103]),mp4:Object(o.j)([102,116,121,112]),fmp4:Object(o.j)([115,116,121,112]),mov:Object(o.j)([102,116,121,112,113,116])},O={aac:function(t){var e=Object(v.a)(t);return Object(o.a)(t,[255,16],{offset:e,mask:[255,22]})},mp3:function(t){var e=Object(v.a)(t);return Object(o.a)(t,[255,2],{offset:e,mask:[255,6]})},webm:function(t){var e=p(t,[c.EBML,c.DocType])[0];return Object(o.a)(e,m.webm)},mkv:function(t){var e=p(t,[c.EBML,c.DocType])[0];return Object(o.a)(e,m.matroska)},mp4:function(t){return!O["3gp"](t)&&!O.mov(t)&&(Object(o.a)(t,m.mp4,{offset:4})||Object(o.a)(t,m.fmp4,{offset:4}))},mov:function(t){return Object(o.a)(t,m.mov,{offset:4})},"3gp":function(t){return Object(o.a)(t,m["3gp"],{offset:4})},ac3:function(t){var e=Object(v.a)(t);return Object(o.a)(t,m.ac3,{offset:e})},ts:function(t){if(t.length<189&&t.length>=1)return 71===t[0];for(var e=0;e+188<t.length&&e<188;){if(71===t[e]&&71===t[e+188])return!0;e+=1}return!1},flac:function(t){var e=Object(v.a)(t);return Object(o.a)(t,m.flac,{offset:e})},ogg:function(t){return Object(o.a)(t,m.ogg)},avi:function(t){return Object(o.a)(t,m.riff)&&Object(o.a)(t,m.avi,{offset:8})},wav:function(t){return Object(o.a)(t,m.riff)&&Object(o.a)(t,m.wav,{offset:8})},h264:function(t){return function(t,e,r){return y(t,"h264",e,r)}(t,7,3).length},h265:function(t){return function(t,e,r){return y(t,"h265",e,r)}(t,[32,33],3).length}},w=Object.keys(O).filter((function(t){return"ts"!==t&&"h264"!==t&&"h265"!==t})).concat(["ts","h264","h265"]);w.forEach((function(t){var e=O[t];O[t]=function(t){return e(Object(o.j)(t))}}));var A=O,T=function(t){t=Object(o.j)(t);for(var e=0;e<w.length;e++){var r=w[e];if(A[r](t))return r}return""},x=function(t){return function t(e,r,n){void 0===n&&(n=!1),r=u(r),e=Object(o.j)(e);var i=[];if(!r.length)return i;for(var a=0;a<e.length;){var c=(e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3])>>>0,s=e.subarray(a+4,a+8);if(0===c)break;var f=a+c;if(f>e.length){if(n)break;f=e.length}var l=e.subarray(a+8,f);Object(o.a)(s,r[0])&&(1===r.length?i.push(l):i.push.apply(i,t(l,r.slice(1),n))),a=f}return i}(t,["moof"]).length>0}},ffdf:function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return u}));var n=r("d36e"),o=r.n(n),i=function(e){return o.a.atob?o.a.atob(e):t.from(e,"base64").toString("binary")};function u(t){for(var e=i(t),r=new Uint8Array(e.length),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}}).call(this,r("b639").Buffer)}}]);