aliyun-aliplayer 2.30.3 → 2.30.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- /*! aliyun-aliplayer - v2.30.3 - 2025-04-24 10.23.38 */
2
- !function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Aliplayer=t()}(function(){return function n(o,i,a){function s(e,t){if(!i[e]){if(!o[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(c)return c(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}r=i[e]={exports:{}},o[e][0].call(r.exports,function(t){return s(o[e][1][t]||t)},r,r.exports,n,o,i,a)}return i[e].exports}for(var c="function"==typeof require&&require,t=0;t<a.length;t++)s(a[t]);return s}({1:[function(B,r,n){!function(W,I){!function(){var t,e;t=this,e=function(){function c(t){return"function"==typeof t}var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,e=void 0,o=void 0,a=function(t,e){l[n]=t,l[n+1]=e,2===(n+=2)&&(o?o(h):q())};var t="undefined"!=typeof window?window:void 0,i=t||{},i=i.MutationObserver||i.WebKitMutationObserver,s="undefined"==typeof self&&void 0!==W&&"[object process]"==={}.toString.call(W),u="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var t=setTimeout;return function(){return t(h,1)}}var l=new Array(1e3);function h(){for(var t=0;t<n;t+=2)(0,l[t])(l[t+1]),l[t]=void 0,l[t+1]=void 0;n=0}function p(){try{var t=Function("return this")().require("vertx");return void 0!==(e=t.runOnLoop||t.runOnContext)?function(){e(h)}:f()}catch(t){return f()}}var d,v,y,q=void 0;function m(t,e){var r,n=this,o=new this.constructor(b),i=(void 0===o[w]&&M(o),n._state);return i?(r=arguments[i-1],a(function(){return S(i,o,r,n._result)})):k(n,o,t,e),o}function g(t){var e;return t&&"object"==typeof t&&t.constructor===this?t:(O(e=new this(b),t),e)}var q=s?function(){return W.nextTick(h)}:i?(v=0,s=new i(h),y=document.createTextNode(""),s.observe(y,{characterData:!0}),function(){y.data=v=++v%2}):u?((d=new MessageChannel).port1.onmessage=h,function(){return d.port2.postMessage(0)}):(void 0===t&&"function"==typeof B?p:f)(),w=Math.random().toString(36).substring(2);function b(){}var _=void 0,x=1,E=2;function G(t,n,o){a(function(e){var r=!1,t=((t,e,r,n)=>{try{t.call(e,r,n)}catch(t){return t}})(o,n,function(t){r||(r=!0,(n!==t?O:j)(e,t))},function(t){r||(r=!0,T(e,t))},e._label);!r&&t&&(r=!0,T(e,t))},t)}function L(t,e,r){var n,o;e.constructor===t.constructor&&r===m&&e.constructor.resolve===g?(n=t,(o=e)._state===x?j(n,o._result):o._state===E?T(n,o._result):k(o,void 0,function(t){return O(n,t)},function(t){return T(n,t)})):void 0!==r&&c(r)?G(t,e,r):j(t,e)}function O(e,t){if(e===t)T(e,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof t,null===t||"object"!=r&&"function"!=r)j(e,t);else{r=void 0;try{r=t.then}catch(t){return void T(e,t)}L(e,t,r)}var r}function U(t){t._onerror&&t._onerror(t._result),A(t)}function j(t,e){t._state===_&&(t._result=e,t._state=x,0!==t._subscribers.length)&&a(A,t)}function T(t,e){t._state===_&&(t._state=E,t._result=e,a(U,t))}function k(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+x]=r,o[i+E]=n,0===i&&t._state&&a(A,t)}function A(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,o=void 0,i=t._result,a=0;a<e.length;a+=3)n=e[a],o=e[a+r],n?S(r,n,o,i):o(i);t._subscribers.length=0}}function S(t,e,r,n){var o=c(r),i=void 0,a=void 0,s=!0;if(o){try{i=r(n)}catch(t){s=!1,a=t}if(e===i)return void T(e,new TypeError("A promises callback cannot return that same promise."))}else i=n;e._state===_&&(o&&s?O(e,i):!1===s?T(e,a):t===x?j(e,i):t===E&&T(e,i))}var P=0;function M(t){t[w]=P++,t._state=void 0,t._result=void 0,t._subscribers=[]}N.prototype._enumerate=function(t){for(var e=0;this._state===_&&e<t.length;e++)this._eachEntry(t[e],e)},N.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===g){var o,i=void 0,a=void 0,s=!1;try{i=e.then}catch(t){s=!0,a=t}i===m&&e._state!==_?this._settledAt(e._state,t,e._result):"function"!=typeof i?(this._remaining--,this._result[t]=e):r===F?(o=new r(b),s?T(o,a):L(o,e,i),this._willSettleAt(o,t)):this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},N.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===_&&(this._remaining--,t===E?T(n,r):this._result[e]=r),0===this._remaining&&j(n,this._result)},N.prototype._willSettleAt=function(t,e){var r=this;k(t,void 0,function(t){return r._settledAt(x,e,t)},function(t){return r._settledAt(E,e,t)})};var Y=N;function N(t,e){this._instanceConstructor=t,this.promise=new t(b),this.promise[w]||M(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0!==this.length&&(this.length=this.length||0,this._enumerate(e),0!==this._remaining)||j(this.promise,this._result)):T(this.promise,new Error("Array Methods must be provided an Array"))}C.prototype.catch=function(t){return this.then(null,t)},C.prototype.finally=function(e){var r=this.constructor;return c(e)?this.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){throw t})}):this.then(e,e)};var F=C;function C(t){if(this[w]=P++,this._result=this._state=void 0,this._subscribers=[],b!==t){if("function"!=typeof t)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof C))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");var e=this;try{t(function(t){O(e,t)},function(t){T(e,t)})}catch(t){T(e,t)}}}return F.prototype.then=m,F.all=function(t){return new Y(this,t).promise},F.race=function(o){var i=this;return r(o)?new i(function(t,e){for(var r=o.length,n=0;n<r;n++)i.resolve(o[n]).then(t,e)}):new i(function(t,e){return e(new TypeError("You must pass an array to race."))})},F.resolve=g,F.reject=function(t){var e=new this(b);return T(e,t),e},F._setScheduler=function(t){o=t},F._setAsap=function(t){a=t},F._asap=a,F.polyfill=function(){var t=void 0;if(void 0!==I)t=I;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=F},F.Promise=F},"object"==typeof n&&void 0!==r?r.exports=e():t.ES6Promise=e()}.call(this)}.call(this,B("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2}],2:[function(t,e,r){var n,o,e=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return(n=setTimeout)(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}var c,u=[],f=!1,l=-1;function h(){f&&c&&(f=!1,c.length?u=c.concat(u):l=-1,u.length)&&p()}function p(){if(!f){for(var t=s(h),e=(f=!0,u.length);e;){for(c=u,u=[];++l<e;)c&&c[l].run();l=-1,e=u.length}c=null,f=!1,!function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return(o=clearTimeout)(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function v(){}e.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new d(t,e)),1!==u.length||f||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=v,e.addListener=v,e.once=v,e.off=v,e.removeListener=v,e.removeAllListeners=v,e.emit=v,e.prependListener=v,e.prependOnceListener=v,e.listeners=function(t){return[]},e.binding=function(t){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(t){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},{}],3:[function(t,e,r){function k(){k=function(){return a};var c,a={},t=Object.prototype,u=t.hasOwnProperty,f=Object.defineProperty||function(t,e,r){t[e]=r.value},e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function i(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(c){i=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o,i,a,s,e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new j(n||[]);return f(e,"_invoke",{value:(o=t,i=r,a=n,s=h,function(t,e){if(s===d)throw Error("Generator is already running");if(s===v){if("throw"===t)throw e;return{value:c,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.iterator[n];if(o===c)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=c,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;n=l(o,e.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,y;o=n.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=c),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}(r,a);if(r){if(r===y)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===h)throw s=v,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=d;r=l(o,i,a);if("normal"===r.type){if(s=a.done?v:p,r.arg===y)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(s=v,a.method="throw",a.arg=r.arg)}})}),e}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=s;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",y={};function m(){}function g(){}function w(){}var e={},b=(i(e,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(T([]))),_=(b&&b!==t&&u.call(b,n)&&(e=b),w.prototype=m.prototype=Object.create(e));function x(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function E(a,s){var e;f(this,"_invoke",{value:function(r,n){function t(){return new s(function(t,e){!function e(t,r,n,o){var i,t=l(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==typeof r&&u.call(r,"__await")?s.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):s.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()}})}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function T(e){if(e||""===e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(u.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=c,t.done=!0,t}).next=t}throw new TypeError(typeof e+" is not iterable")}return f(_,"constructor",{value:g.prototype=w,configurable:!0}),f(w,"constructor",{value:g,configurable:!0}),g.displayName=i(w,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,i(t,o,"GeneratorFunction")),t.prototype=Object.create(_),t},a.awrap=function(t){return{__await:t}},x(E.prototype),i(E.prototype,r,function(){return this}),a.AsyncIterator=E,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new E(s(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},x(_),i(_,o,"Generator"),i(_,n,function(){return this}),i(_,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=T,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&u.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function t(t,e){return i.type="throw",i.arg=r,n.next=t,e&&(n.method="next",n.arg=c),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=u.call(o,"catchLoc"),s=u.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,O(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=c),y}},a}function c(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function u(s){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=s.apply(t,a);function o(t){c(n,e,r,o,i,"next",t)}function i(t){c(n,e,r,o,i,"throw",t)}o(void 0)})}}var f="undefined"==typeof Promise?t("es6-promise").Promise:Promise,l="__aliplayerMessage__",a="setup",s="setupAck",h="dispose",p="encSegment",d="decSegment",v="abortSegment",n=0,y=1,m="fragment",g="playlist",o="other",i="unknown",w=null,b={},_={},x=n;function E(){w=null,Object.keys(b).forEach(function(t){b[t].controller.abort(),b[t].reject("Fetch aborted.")}),b={},_={},x=n}function L(t,e,r){var n="";try{n=/[0-9]+\.ts/.exec(e.url)[0]}catch(t){}console.log(("send"===r?"[SW -> Main]":"[Main -> SW]")+"["+t+"]",n,e)}self.addEventListener("install",function(t){self.skipWaiting()}),self.addEventListener("activate",(()=>{var e=u(k().mark(function t(e){return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.waitUntil(clients.claim());case 1:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})()),self.addEventListener("fetch",function(t){if("navigate"===t.request.mode)E();else if(x!==n){var e,a=t.request.url,s=-1===(e=a).indexOf("_s=enc")?o:-1<e.indexOf(".ts")?m:-1<e.indexOf(".m3u8")?g:i;if(s!==o){if(s===i)return console.warn("Unknown request type",a);try{/[0-9]+\.ts/.exec(a)[0]}catch(t){}t.respondWith(u(k().mark(function t(){return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new f((()=>{var r=u(k().mark(function t(r,e){var o,i;return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.next=2;var n=a;return new f((()=>{var e=u(k().mark(function t(e){var r;return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0<Object.keys(b).length&&!b[n])return w||console.error("no player client!"),t.next=5,clients.get(w);t.next=7;break;case 5:r=t.sent,Object.keys(b).forEach((()=>{var e=u(k().mark(function t(e){return k().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:b[e].controller.abort(),b[e].reject(),r.postMessage({scope:l,name:v,payload:{url:e}}),L(v,{url:e},"send");case 4:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})());case 7:e();case 8:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})());case 2:o=new AbortController,s===m&&(b[a]={resolve:r,reject:e,controller:o}),performance.now(),fetch(a.replace("_s=enc",""),{signal:o.signal}).then(function(t){if(i=new Headers(t.headers),b[a])b[a].headers=i;else if(-1<a.indexOf(".ts"))return void console.warn("fragment request is missed",a);if(200===t.status)return s===g?t.text():t.arrayBuffer();r(t)}).then(function(e){var t;e&&(s===g?(_[a]=e,t=((t,e)=>{var n;if(e=e.replace(/#EXT-X-KEY:.*\n?/g,""),t=t.match(/^(.*)\/[^\/]*$/))return n=t[1],e=e.replace(/(#EXTINF:[^\n]+\n)([^\n]+)/g,function(t,e,r){return""+e+n+"/"+r+(-1<r.indexOf("?")?"&":"?")+"_s=enc"});console.warn("no match base url found.")})(a,e),i.set("Content-Length",new Blob([t]).size),r(new Response(t,{status:200,headers:i}))):(w||console.error("no player client!"),clients.get(w).then(function(t){t.postMessage({scope:l,name:p,payload:{buffer:e,url:a,playlistUrl:(t=>{var e,r=(t=>{var e;try{e=/\/([^/?]+)(\?|$)/.exec(t)[1]}catch(t){}return e})(t);return r||console.warn("no fragUrlBase"),Object.keys(_).some(function(t){return-1<_[t].indexOf(r)&&(e=t,!0)}),e})(a)}},[e]),L(p,{url:a},"send")})))}).catch(function(t){console.log("fetch error from remote",t),e(t),delete b[a]});case 6:case"end":return t.stop()}},t)}));return function(t,e){return r.apply(this,arguments)}})()));case 1:case"end":return t.stop()}},t)}))())}}}),self.addEventListener("message",function(t){var e=t.data;if((i=e)&&i.scope===l){var r,n,o,i=e.name;switch(L(i,e.payload),i){case a:w=t.source.id,x=y,clients.get(w).then(function(t){t.postMessage({scope:l,name:s,payload:{version:"2.30.3"}})});break;case h:E();break;case d:e.payload&&(r=e.payload,n=b[r.url])&&(delete b[r.url],(o=n.headers).set("Content-Length",r.buffer.byteLength),n.resolve(new Response(r.buffer,{status:200,headers:o})),L(d,r,"send"))}}})},{"es6-promise":1}]},{},[3])(3)});
1
+ /*! aliyun-aliplayer - v2.30.4 - 2025-05-27 20.35.20 */
2
+ !function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Aliplayer=t()}(function(){return function n(o,i,s){function u(e,t){if(!i[e]){if(!o[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(a)return a(e,!0);throw(t=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",t}r=i[e]={exports:{}},o[e][0].call(r.exports,function(t){return u(o[e][1][t]||t)},r,r.exports,n,o,i,s)}return i[e].exports}for(var a="function"==typeof require&&require,t=0;t<s.length;t++)u(s[t]);return u}({1:[function(B,r,n){!function(Y,I){!function(){var t,e;t=this,e=function(){function a(t){return"function"==typeof t}var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,e=void 0,o=void 0,s=function(t,e){l[n]=t,l[n+1]=e,2===(n+=2)&&(o?o(h):q())};var t="undefined"!=typeof window?window:void 0,i=t||{},i=i.MutationObserver||i.WebKitMutationObserver,u="undefined"==typeof self&&void 0!==Y&&"[object process]"==={}.toString.call(Y),c="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var t=setTimeout;return function(){return t(h,1)}}var l=new Array(1e3);function h(){for(var t=0;t<n;t+=2)(0,l[t])(l[t+1]),l[t]=void 0,l[t+1]=void 0;n=0}function p(){try{var t=Function("return this")().require("vertx");return void 0!==(e=t.runOnLoop||t.runOnContext)?function(){e(h)}:f()}catch(t){return f()}}var d,v,y,q=void 0;function g(t,e){var r,n=this,o=new this.constructor(_),i=(void 0===o[m]&&M(o),n._state);return i?(r=arguments[i-1],s(function(){return P(i,o,r,n._result)})):A(n,o,t,e),o}function w(t){var e;return t&&"object"==typeof t&&t.constructor===this?t:(T(e=new this(_),t),e)}var q=u?function(){return Y.nextTick(h)}:i?(v=0,u=new i(h),y=document.createTextNode(""),u.observe(y,{characterData:!0}),function(){y.data=v=++v%2}):c?((d=new MessageChannel).port1.onmessage=h,function(){return d.port2.postMessage(0)}):(void 0===t&&"function"==typeof B?p:f)(),m=Math.random().toString(36).substring(2);function _(){}var b=void 0,x=1,E=2;function G(t,n,o){s(function(e){var r=!1,t=((t,e,r,n)=>{try{t.call(e,r,n)}catch(t){return t}})(o,n,function(t){r||(r=!0,(n!==t?T:j)(e,t))},function(t){r||(r=!0,k(e,t))},e._label);!r&&t&&(r=!0,k(e,t))},t)}function O(t,e,r){var n,o;e.constructor===t.constructor&&r===g&&e.constructor.resolve===w?(n=t,(o=e)._state===x?j(n,o._result):o._state===E?k(n,o._result):A(o,void 0,function(t){return T(n,t)},function(t){return k(n,t)})):void 0!==r&&a(r)?G(t,e,r):j(t,e)}function T(e,t){if(e===t)k(e,new TypeError("You cannot resolve a promise with itself"));else if(r=typeof t,null===t||"object"!=r&&"function"!=r)j(e,t);else{r=void 0;try{r=t.then}catch(t){return void k(e,t)}O(e,t,r)}var r}function U(t){t._onerror&&t._onerror(t._result),S(t)}function j(t,e){t._state===b&&(t._result=e,t._state=x,0!==t._subscribers.length)&&s(S,t)}function k(t,e){t._state===b&&(t._state=E,t._result=e,s(U,t))}function A(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+x]=r,o[i+E]=n,0===i&&t._state&&s(S,t)}function S(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n,o=void 0,i=t._result,s=0;s<e.length;s+=3)n=e[s],o=e[s+r],n?P(r,n,o,i):o(i);t._subscribers.length=0}}function P(t,e,r,n){var o=a(r),i=void 0,s=void 0,u=!0;if(o){try{i=r(n)}catch(t){u=!1,s=t}if(e===i)return void k(e,new TypeError("A promises callback cannot return that same promise."))}else i=n;e._state===b&&(o&&u?T(e,i):!1===u?k(e,s):t===x?j(e,i):t===E&&k(e,i))}var L=0;function M(t){t[m]=L++,t._state=void 0,t._result=void 0,t._subscribers=[]}F.prototype._enumerate=function(t){for(var e=0;this._state===b&&e<t.length;e++)this._eachEntry(t[e],e)},F.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===w){var o,i=void 0,s=void 0,u=!1;try{i=e.then}catch(t){u=!0,s=t}i===g&&e._state!==b?this._settledAt(e._state,t,e._result):"function"!=typeof i?(this._remaining--,this._result[t]=e):r===C?(o=new r(_),u?k(o,s):O(o,e,i),this._willSettleAt(o,t)):this._willSettleAt(new r(function(t){return t(e)}),t)}else this._willSettleAt(n(e),t)},F.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===b&&(this._remaining--,t===E?k(n,r):this._result[e]=r),0===this._remaining&&j(n,this._result)},F.prototype._willSettleAt=function(t,e){var r=this;A(t,void 0,function(t){return r._settledAt(x,e,t)},function(t){return r._settledAt(E,e,t)})};var W=F;function F(t,e){this._instanceConstructor=t,this.promise=new t(_),this.promise[m]||M(this.promise),r(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0!==this.length&&(this.length=this.length||0,this._enumerate(e),0!==this._remaining)||j(this.promise,this._result)):k(this.promise,new Error("Array Methods must be provided an Array"))}N.prototype.catch=function(t){return this.then(null,t)},N.prototype.finally=function(e){var r=this.constructor;return a(e)?this.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){throw t})}):this.then(e,e)};var C=N;function N(t){if(this[m]=L++,this._result=this._state=void 0,this._subscribers=[],_!==t){if("function"!=typeof t)throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof N))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");var e=this;try{t(function(t){T(e,t)},function(t){k(e,t)})}catch(t){k(e,t)}}}return C.prototype.then=g,C.all=function(t){return new W(this,t).promise},C.race=function(o){var i=this;return r(o)?new i(function(t,e){for(var r=o.length,n=0;n<r;n++)i.resolve(o[n]).then(t,e)}):new i(function(t,e){return e(new TypeError("You must pass an array to race."))})},C.resolve=w,C.reject=function(t){var e=new this(_);return k(e,t),e},C._setScheduler=function(t){o=t},C._setAsap=function(t){s=t},C._asap=s,C.polyfill=function(){var t=void 0;if(void 0!==I)t=I;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=C},C.Promise=C},"object"==typeof n&&void 0!==r?r.exports=e():t.ES6Promise=e()}.call(this)}.call(this,B("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2}],2:[function(t,e,r){var n,o,e=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return(n=setTimeout)(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}var a,c=[],f=!1,l=-1;function h(){f&&a&&(f=!1,a.length?c=a.concat(c):l=-1,c.length)&&p()}function p(){if(!f){for(var t=u(h),e=(f=!0,c.length);e;){for(a=c,c=[];++l<e;)a&&a[l].run();l=-1,e=c.length}a=null,f=!1,!function(e){if(o===clearTimeout)return clearTimeout(e);if((o===s||!o)&&clearTimeout)return(o=clearTimeout)(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function v(){}e.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new d(t,e)),1!==c.length||f||u(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=v,e.addListener=v,e.once=v,e.off=v,e.removeListener=v,e.removeAllListeners=v,e.emit=v,e.prependListener=v,e.prependOnceListener=v,e.listeners=function(t){return[]},e.binding=function(t){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(t){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},{}],3:[function(t,e,r){function E(){E=function(){return s};var c,s={},t=Object.prototype,a=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(c){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,s,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,s=new b(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:c,done:!0}}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===c)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=c,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;n=l(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,h;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=c),r.delegate=null,h):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}(r,s);if(r){if(r===h)continue;return r}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(1===u)throw u=4,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);u=3;r=l(o,i,s);if("normal"===r.type){if(u=s.done?4:2,r.arg===h)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(u=4,s.method="throw",s.arg=r.arg)}}),!0),e}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}s.wrap=u;var h={};function p(){}function i(){}function d(){}var e={},v=(f(e,n,function(){return this}),Object.getPrototypeOf),v=v&&v(v(x([]))),y=(v&&v!==t&&a.call(v,n)&&(e=v),d.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function w(s,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=l(s[t],s,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==typeof r&&a.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function m(t){this.tryEntries.push(t)}function _(t){var e=t[4]||{};e.type="normal",e.arg=c,t[4]=e}function b(t){this.tryEntries=[[-1]],t.forEach(m,this),this.reset(!0)}function x(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(a.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=c,t.done=!0,t}).next=t}throw new TypeError(typeof e+" is not iterable")}return f(y,"constructor",i.prototype=d),f(d,"constructor",i),f(d,o,i.displayName="GeneratorFunction"),s.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,o,"GeneratorFunction")),t.prototype=Object.create(y),t},s.awrap=function(t){return{__await:t}},g(w.prototype),f(w.prototype,r,function(){return this}),s.AsyncIterator=w,s.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new w(u(t,e,r,n),o);return s.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(y),f(y,o,"Generator"),f(y,n,function(){return this}),f(y,"toString",function(){return"[object Generator]"}),s.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},s.values=x,b.prototype={constructor:b,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],s=this.prev,u=o[1],a=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!a)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<u)return this.method="next",this.arg=c,t(u),!0;if(s<a)return t(a),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),_(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,_(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:x(t),r:e,n:r},"next"===this.method&&(this.arg=c),h}},s}function a(t,e,r,n,o,i,s){try{var u=t[i](s),a=u.value}catch(t){return r(t)}u.done?e(a):Promise.resolve(a).then(n,o)}function c(u){return function(){var t=this,s=arguments;return new Promise(function(e,r){var n=u.apply(t,s);function o(t){a(n,e,r,o,i,"next",t)}function i(t){a(n,e,r,o,i,"throw",t)}o(void 0)})}}var f="undefined"==typeof Promise?t("es6-promise").Promise:Promise,l="__aliplayerMessage__",s="setup",u="setupAck",h="dispose",p="encSegment",d="decSegment",v="abortSegment",n=0,y=1,g="fragment",w="playlist",o="other",i="unknown",m=null,_={},b={},x=n;function O(){m=null,Object.keys(_).forEach(function(t){_[t].controller.abort(),_[t].reject("Fetch aborted.")}),_={},b={},x=n}function T(t,e,r){var n="";try{n=/[0-9]+\.ts/.exec(e.url)[0]}catch(t){}console.log(("send"===r?"[SW -> Main]":"[Main -> SW]")+"["+t+"]",n,e)}self.addEventListener("install",function(t){self.skipWaiting()}),self.addEventListener("activate",(()=>{var e=c(E().mark(function t(e){return E().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e.waitUntil(clients.claim());case 1:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})()),self.addEventListener("fetch",function(t){if("navigate"===t.request.mode)O();else if(x!==n){var e,s=t.request.url,u=-1===(e=s).indexOf("_s=enc")?o:-1<e.indexOf(".ts")?g:-1<e.indexOf(".m3u8")?w:i;if(u!==o){if(u===i)return console.warn("Unknown request type",s);try{/[0-9]+\.ts/.exec(s)[0]}catch(t){}t.respondWith(c(E().mark(function t(){return E().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new f((()=>{var r=c(E().mark(function t(r,e){var o,i;return E().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.next=2;var n=s;return new f((()=>{var e=c(E().mark(function t(e){var r;return E().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0<Object.keys(_).length&&!_[n])return m||console.error("no player client!"),t.next=5,clients.get(m);t.next=7;break;case 5:r=t.sent,Object.keys(_).forEach((()=>{var e=c(E().mark(function t(e){return E().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:_[e].controller.abort(),_[e].reject(),r.postMessage({scope:l,name:v,payload:{url:e}}),T(v,{url:e},"send");case 4:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})());case 7:e();case 8:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})());case 2:o=new AbortController,u===g&&(_[s]={resolve:r,reject:e,controller:o}),performance.now(),fetch(s.replace("_s=enc",""),{signal:o.signal}).then(function(t){if(i=new Headers(t.headers),_[s])_[s].headers=i;else if(-1<s.indexOf(".ts"))return void console.warn("fragment request is missed",s);if(200===t.status)return u===w?t.text():t.arrayBuffer();r(t)}).then(function(e){var t;e&&(u===w?(b[s]=e,t=((t,e)=>{var n;if(e=e.replace(/#EXT-X-KEY:.*\n?/g,""),t=t.match(/^(.*)\/[^\/]*$/))return n=t[1],e=e.replace(/(#EXTINF:[^\n]+\n)([^\n]+)/g,function(t,e,r){return""+e+n+"/"+r+(-1<r.indexOf("?")?"&":"?")+"_s=enc"});console.warn("no match base url found.")})(s,e),i.set("Content-Length",new Blob([t]).size),r(new Response(t,{status:200,headers:i}))):(m||console.error("no player client!"),clients.get(m).then(function(t){t.postMessage({scope:l,name:p,payload:{buffer:e,url:s,playlistUrl:(t=>{var e,r=(t=>{var e;try{e=/\/([^/?]+)(\?|$)/.exec(t)[1]}catch(t){}return e})(t);return r||console.warn("no fragUrlBase"),Object.keys(b).some(function(t){return-1<b[t].indexOf(r)&&(e=t,!0)}),e})(s)}},[e]),T(p,{url:s},"send")})))}).catch(function(t){console.log("fetch error from remote",t),e(t),delete _[s]});case 6:case"end":return t.stop()}},t)}));return function(t,e){return r.apply(this,arguments)}})()));case 1:case"end":return t.stop()}},t)}))())}}}),self.addEventListener("message",function(t){var e=t.data;if((i=e)&&i.scope===l){var r,n,o,i=e.name;switch(T(i,e.payload),i){case s:m=t.source.id,x=y,clients.get(m).then(function(t){t.postMessage({scope:l,name:u,payload:{version:"2.30.4"}})});break;case h:O();break;case d:e.payload&&(r=e.payload,n=_[r.url])&&(delete _[r.url],(o=n.headers).set("Content-Length",r.buffer.byteLength),n.resolve(new Response(r.buffer,{status:200,headers:o})),T(d,r,"send"))}}})},{"es6-promise":1}]},{},[3])(3)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aliyun-aliplayer",
3
- "version": "2.30.3",
3
+ "version": "2.30.4",
4
4
  "description": "阿里云 Web 播放器",
5
5
  "main": "./build/aliplayer-min",
6
6
  "style": "./build/skins/default/aliplayer-min.css",