New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swarmcloud-hls

Package Overview
Dependencies
Maintainers
0
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swarmcloud-hls - npm Package Compare versions

Comparing version 2.12.1 to 2.12.3

2

dist/clappr-p2p-plugin.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwarmCloudClapprPlugin=e():t.SwarmCloudClapprPlugin=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,n){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,o){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var p=function(){function t(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,o,n){return o&&t(e.prototype,o),n&&t(e,n),e}}(),s=function t(e,o,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,o);if(void 0===r){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,o,n)}if("value"in r)return r.value;var p=r.get;if(void 0!==p)return p.call(n)};window.P2pEngineHls||console.error("Please put p2p-engine script before this script"),window.Clappr||console.error("Please put clappr script before this script");var l=function(t){function e(t){n(this,e);var o=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return o._engine=null,o}return i(e,t),p(e,[{key:"_setup",value:function(){s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"_setup",this).call(this),window.P2pEngineHls.isSupported()&&(this.options.playback.hlsjsConfig||(this.options.playback.hlsjsConfig={}),this.options.playback.hlsjsConfig.p2pConfig||(this.options.playback.hlsjsConfig.p2pConfig={}),this.options.playback.hlsjsConfig.p2pConfig.hlsjsInstance=this._hls,this._engine=new window.P2pEngineHls(this.options.playback.hlsjsConfig.p2pConfig))}},{key:"stop",value:function(){this._engine&&this._engine.destroy(),s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"stop",this).call(this)}},{key:"destroy",value:function(){this._engine&&this._engine.destroy(),s(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"destroy",this).call(this)}},{key:"name",get:function(){return"cdnbye_playback"}}]),e}(window.Clappr.HLS);l.canPlay=window.Clappr.HLS.canPlay,t.exports=window.CDNByeClapprPlugin=l}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwarmCloudClapprPlugin=t():e.SwarmCloudClapprPlugin=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,o){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var p=function(){function e(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,o,n){return o&&e(t.prototype,o),n&&e(t,n),t}}(),s=function e(t,o,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,o);if(void 0===r){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,o,n)}if("value"in r)return r.value;var p=r.get;if(void 0!==p)return p.call(n)};window.P2pEngineHls||console.error("Please put p2p-engine script before this script"),window.Clappr||console.error("Please put clappr script before this script"),console.error("clappr-p2p-plugin is deprecated and will be removed soon, please update: https://github.com/swarm-cloud/hls-p2p-engine/blob/main/demo/clappr.html");var l=function(e){function t(e){n(this,t);var o=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o._engine=null,o}return i(t,e),p(t,[{key:"_setup",value:function(){s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_setup",this).call(this),window.P2pEngineHls.isSupported()&&(this.options.playback.hlsjsConfig||(this.options.playback.hlsjsConfig={}),this.options.playback.hlsjsConfig.p2pConfig||(this.options.playback.hlsjsConfig.p2pConfig={}),this.options.playback.hlsjsConfig.p2pConfig.hlsjsInstance=this._hls,this._engine=new window.P2pEngineHls(this.options.playback.hlsjsConfig.p2pConfig))}},{key:"stop",value:function(){this._engine&&this._engine.destroy(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"stop",this).call(this)}},{key:"destroy",value:function(){this._engine&&this._engine.destroy(),s(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"name",get:function(){return"cdnbye_playback"}}]),t}(window.Clappr.HLS);l.canPlay=window.Clappr.HLS.canPlay,e.exports=window.CDNByeClapprPlugin=l}])});

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.HlsProxy=t():e.HlsProxy=t()}(this,(()=>(()=>{var e={558:function(e){!function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return o.path=s.normalizePath(o.path),s.buildURLFromParts(o)}var i=s.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return r.alwaysNormalize?(i.path=s.normalizePath(i.path),s.buildURLFromParts(i)):t;var a=s.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var u=n.exec(a.path);a.netLoc=u[1],a.path=u[2]}a.netLoc&&!a.path&&(a.path="/");var f={scheme:a.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(f.netLoc=a.netLoc,"/"!==i.path[0]))if(i.path){var l=a.path,c=l.substring(0,l.lastIndexOf("/")+1)+i.path;f.path=s.normalizePath(c)}else f.path=a.path,i.params||(f.params=a.params,i.query||(f.query=a.query));return null===f.path&&(f.path=r.alwaysNormalize?s.normalizePath(i.path):i.path),s.buildURLFromParts(f)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(o,"");e.length!==(e=e.replace(i,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=s}()},424:(e,t)=>{"use strict";var r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return a(e)}return i(e,t,r)}function i(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|l(e,t),i=n(r),s=i.write(e,t);s!==r&&(i=i.slice(0,s));return i}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(y(e,ArrayBuffer)||e&&y(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return n.__proto__=o.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return o.from(i,t,r);var s=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=n(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||_(e.length)?n(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function a(e){return s(e),n(e<0?0:0|f(e))}function u(e){for(var t=e.length<0?0:0|f(e.length),r=n(t),o=0;o<t;o+=1)r[o]=255&e[o];return r}function f(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function l(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return g(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;default:if(i)return n?-1:g(e).length;t=(""+t).toLowerCase(),i=!0}}function c(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(_(n))return s;e[r+s]=n}return s}function h(e,t,r,n){return E(g(t,e.length-r),e,r,n)}function p(e,t,r,n){return E(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function d(e,t,r,n){return E(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function g(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function _(e){return e!=e}"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.from=function(e,t,r){return i(e,t,r)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)}(e,t,r)},o.allocUnsafe=function(e){return a(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(y(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=l,o.prototype._isBuffer=!0,o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return c(this,e,t,r);case"utf8":case"utf-8":return h(this,e,t,r);case"ascii":case"latin1":case"binary":return p(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";r.d(n,{default:()=>b});class e{static insertTimeOffsetTag(e,t){let r=e.split("\n");r=r.filter((e=>!e.startsWith("#EXT-X-START")));for(let e=0;e<r.length;e++)if(r[e].startsWith("#EXT-X-VERSION")){r[e]=`${r[e]}\n#EXT-X-START:TIME-OFFSET=${t}`;break}return r.join("\n")}}const t={DC_SIGNAL:"SIGNAL",DC_SIGNAL_BATCH:"SIGNAL_BATCH",DC_OPEN:"OPEN",DC_REQUEST:"REQUEST",DC_PIECE_NOT_FOUND:"PIECE_NOT_FOUND",DC_PIECE_ABORT:"PIECE_ABORT",DC_PIECE_CANCEL:"PIECE_CANCEL",DC_CLOSE:"CLOSE",DC_DISCONNECT:"DISCONNECT",DC_RESPONSE:"RESPONSE",DC_ERROR:"ERROR",DC_PIECE:"PIECE",DC_PIECE_DATA:"PIECE_DATA",DC_TIMEOUT:"TIMEOUT",DC_PIECE_ACK:"PIECE_ACK",DC_METADATA:"METADATA",DC_PLAT_ANDROID:"ANDROID",DC_PLAT_IOS:"IOS",DC_PLAT_WEB:"WEB",DC_CHOKE:"CHOKE",DC_UNCHOKE:"UNCHOKE",DC_HAVE:"HAVE",DC_HAVE_REVERSE:"HAVE_REVERSE",DC_LOST:"LOST",DC_GET_PEERS:"GET_PEERS",DC_PEERS:"PEERS",DC_STATS:"STATS",DC_PEER_SIGNAL:"PEER_SIGNAL",DC_PLAYLIST:"PLAYLIST",BM_LOST:"lost",BM_ADDED_SEG_:"BM_ADDED_SEG_",BM_ADDED_SN_:"BM_ADDED_SN_",BM_SEG_ADDED:"BM_SEG_ADDED",BM_FATAL_ERROR:"BM_FATAL_ERROR",FRAG_CHANGED:"FRAG_CHANGED",FRAG_LOADED:"FRAG_LOADED",FRAG_LOADING:"FRAG_LOADING",RESTART_P2P:"RESTART_P2P",EXCEPTION:"exception",SYN_OUTPUT:"SYN_OUTPUT",SYN_ERROR:"SYN_ERROR",SYN_PROGRESS:"SYN_PROGRESS",MEDIA_REBUFFER:"MEDIA_REBUFFER",SCH_WAIT_PEER:"SCH_WAIT_PEER",SW_PLAYLIST:"SW_PLAYLIST",SW_GET_PLAYLIST:"SW_GET_PLAYLIST",SW_GET_MEDIA:"SW_GET_MEDIA",LEVEL_LOADED:"LEVEL_LOADED",MANIFEST_PARSED:"MANIFEST_PARSED"};var o=r(558);const i="__PROXY_IDENTIFIER__";function s(e,t="."){const r=o.parseURL(e);return r.path.substring(r.path.lastIndexOf(t)+1)}r(424);const a="video/mp4",u={ts:"video/MP2T",m4s:a,mp4:a,fmp4:a};let f=["m3u8"];const l=200,c=200;let h=["ts","mp4","m4s","fmp4"];const p="#EXT-X-ENDLIST\n";let d=.01,E=".",g=7e3,y=!1,_=!1;const m=new Map,w=new class{constructor(){this.sendMessageToClient=this.sendMessageToClient.bind(this)}async sendMessageToClient(e,t,r,n=[]){return e?new Promise(((o,i)=>{const s=new MessageChannel;let a;const u=(e,t)=>setTimeout((()=>{s.port1.close(),s.port2.close(),i(`MessageChannel ${t} timed out after ${e} ms`)}),e);s.port1.onmessage=function(e){const n=e.data;n?n.pong?(clearTimeout(a),a=u(r,`${t.action}-data`)):o({data:n.data}):i("no data in event")},s.port1.onmessageerror=function(e){i(e)},e.postMessage(t,[s.port2].concat(n)),a=u(50,`${t.action}-pong`)})):Promise.reject("client is null")}};let A=!1,T=null,R=null,S=!1;class b{constructor(e={}){T=e.httpHeadersForPlaylist||null,R=e.httpHeadersForMediaFile||null,!0===e.insertTimeOffsetTag?(S=!0,e.playlistTimeOffset&&(d=e.playlistTimeOffset)):S=!1,e.allowedMediaFiles&&e.allowedMediaFiles.length>0&&(h=[...e.allowedMediaFiles]),e.allowedPlaylistSuffix&&e.allowedPlaylistSuffix.length>0&&(f=[...e.allowedPlaylistSuffix]),e.mediaFileSeparator&&(E=e.mediaFileSeparator)}}function v(r){const{request:n,clientId:o}=r,{headers:a,url:b}=n;if("GET"!==n.method)return;if(b.includes(self.registration.scope+`${i}/keepalive/`))return new Response;let v=s(b);if(f.includes(v))return y&&console.info(`sw onFetch playlist ${b}`),async function(r,n){m.size>50&&m.clear();const{url:o,headers:i}=r,s=await clients.get(n);if(_&&s)try{const r=await w.sendMessageToClient(s,{action:t.SW_GET_PLAYLIST,data:{url:o}},c),{data:n}=r;if(n&&n.text){let{text:t}=n;return S&&!t.endsWith(p)&&(t=e.insertTimeOffsetTag(t,d)),new Response(t,{status:200,statusText:"OK",headers:{"Content-Type":"application/vnd.apple.mpegurl"}})}}catch(e){console.error(e)}let a;T&&(a=new Headers,y&&console.info(`set additional header for ${o}`),T(o,a,i));return fetch(new Request(o,{mode:"cors",headers:a})).then((async r=>{if(r.ok&&s)try{const i=await r.clone().text();let a;r.redirected&&(y&&console.info(`resp redirected to url ${r.url} `),a=r.url);const u=await w.sendMessageToClient(s,{action:t.SW_PLAYLIST,data:{url:o,redirectedUrl:a,ver:"2.12.1",text:i}},l),{data:f}=u;if(!f)return r;if(y||(y=f.debug),!f.active)return y&&console.warn("window client is not active"),m.delete(n),r;if(m.set(n,s),_=!!f.sharePlaylist,S&&!i.endsWith(p)){const t=e.insertTimeOffsetTag(i,d);return new Response(t,{status:200,statusText:"OK",headers:r.headers})}}catch(e){y&&console.warn(e),m.delete(n)}return r}))}(n,o);if("."!==E&&(v=s(b,E)),h.includes(v)){let e;R&&(e=new Headers,y&&console.info(`set additional header for ${b}`),R(b,e,a));let r=a.get("Range")||void 0;if(r&&(e||(e=new Headers),e.set("Range",r)),m.has(o)){let n,s;y&&console.info(`sw onFetch media ${b} range ${r}`);try{const{start:e,end:t}=function(e){if(!e)return{};const t=e.trim().toLowerCase();if(!t.startsWith("bytes="))throw new Error("unit-must-be-bytes",{normalizedRangeHeader:t});if(t.includes(","))throw new Error("single-range-only",{normalizedRangeHeader:t});const r=/(\d*)-(\d*)/.exec(t);if(!r||!r[1]&&!r[2])throw new Error("invalid-range-values",{normalizedRangeHeader:t});return{start:""===r[1]?0:Number(r[1]),end:""===r[2]?void 0:Number(r[2])}}(r);n=e,s=t}catch(e){return void console.error(e)}if(s-n<=1)return;const a=function(e,t){const r=new URL(e);return r.searchParams.get(t)?(r.searchParams.delete(t),r.href):""}(b,i);return a?fetch(new Request(a,{mode:"cors",headers:e})):function(e,r,n,o,i,s,a){y&&A&&console.warn("hls proxy is loading");let f=!1;i||s?(i||s)&&(f=!0):(o=void 0,0===i&&void 0===s&&(y&&console.warn(`request ${e} with range 0-`),f=!0));return A=!0,w.sendMessageToClient(n,{action:t.SW_GET_MEDIA,data:{url:e,range:o}},g).then((async t=>{if(A=!1,t&&t.data&&t.data.buffer){const{data:e}=t,{buffer:r}=e;if(f&&r.byteLength!==s-i+1)return void console.error("buffer size is not equal to range length "+(s-i+1));const n=function(e){const t=u[e];return t||""}(a),o={status:f?206:200,statusText:f?"Partial Content":"OK",headers:{"Accept-Ranges":"bytes","Content-Length":r.byteLength,"Content-Type":n||void 0,"Access-Control-Allow-Origin":"*"}};return f&&(o.headers["Content-Range"]=`bytes ${i}-${s}/${r.byteLength}`),new Response(r,o)}return fetch(new Request(e,{mode:"cors",headers:r}))})).catch((t=>(console.error(t),A=!1,y&&(console.warn(t),console.warn(`while requesting ${e}`)),fetch(new Request(e,{mode:"cors",headers:r})))))}(b,e,m.get(o),r,n,s,v)}return y&&console.warn("windowClient not exist when get media"),fetch(new Request(b,{mode:"cors",headers:e}))}}self.addEventListener("install",(()=>{self.skipWaiting()})),self.addEventListener("activate",(e=>e.waitUntil(self.clients.claim()))),self.addEventListener("fetch",(e=>{const t=v(e);t&&e.respondWith(t)})),self.addEventListener("message",(async function({data:e}){})),b.fileResponse=v,b.version="2.12.1"})(),n=n.default})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.HlsProxy=t():e.HlsProxy=t()}(this,(()=>(()=>{var e={558:function(e){!function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,n=/^(?=([^\/?#]*))\1([^]*)$/,o=/(?:\/|^)\.(?=\/)/g,i=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return o.path=s.normalizePath(o.path),s.buildURLFromParts(o)}var i=s.parseURL(t);if(!i)throw new Error("Error trying to parse relative URL.");if(i.scheme)return r.alwaysNormalize?(i.path=s.normalizePath(i.path),s.buildURLFromParts(i)):t;var a=s.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&"/"!==a.path[0]){var u=n.exec(a.path);a.netLoc=u[1],a.path=u[2]}a.netLoc&&!a.path&&(a.path="/");var f={scheme:a.scheme,netLoc:i.netLoc,path:null,params:i.params,query:i.query,fragment:i.fragment};if(!i.netLoc&&(f.netLoc=a.netLoc,"/"!==i.path[0]))if(i.path){var l=a.path,c=l.substring(0,l.lastIndexOf("/")+1)+i.path;f.path=s.normalizePath(c)}else f.path=a.path,i.params||(f.params=a.params,i.query||(f.query=a.query));return null===f.path&&(f.path=r.alwaysNormalize?s.normalizePath(i.path):i.path),s.buildURLFromParts(f)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(o,"");e.length!==(e=e.replace(i,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};e.exports=s}()},424:(e,t)=>{"use strict";var r=2147483647;function n(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return a(e)}return i(e,t,r)}function i(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|l(e,t),i=n(r),s=i.write(e,t);s!==r&&(i=i.slice(0,s));return i}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(y(e,ArrayBuffer)||e&&y(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return n.__proto__=o.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return o.from(i,t,r);var s=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=n(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||_(e.length)?n(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function a(e){return s(e),n(e<0?0:0|f(e))}function u(e){for(var t=e.length<0?0:0|f(e.length),r=n(t),o=0;o<t;o+=1)r[o]=255&e[o];return r}function f(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function l(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return g(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;default:if(i)return n?-1:g(e).length;t=(""+t).toLowerCase(),i=!0}}function c(e,t,r,n){r=Number(r)||0;const o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(_(n))return s;e[r+s]=n}return s}function h(e,t,r,n){return E(g(t,e.length-r),e,r,n)}function p(e,t,r,n){return E(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function d(e,t,r,n){return E(function(e,t){let r,n,o;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function E(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function g(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function _(e){return e!=e}"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.from=function(e,t,r){return i(e,t,r)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?n(e):void 0!==t?"string"==typeof r?n(e).fill(t,r):n(e).fill(t):n(e)}(e,t,r)},o.allocUnsafe=function(e){return a(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(y(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=l,o.prototype._isBuffer=!0,o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return c(this,e,t,r);case"utf8":case"utf-8":return h(this,e,t,r);case"ascii":case"latin1":case"binary":return p(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";r.d(n,{default:()=>b});class e{static insertTimeOffsetTag(e,t){let r=e.split("\n");r=r.filter((e=>!e.startsWith("#EXT-X-START")));for(let e=0;e<r.length;e++)if(r[e].startsWith("#EXT-X-VERSION")){r[e]=`${r[e]}\n#EXT-X-START:TIME-OFFSET=${t}`;break}return r.join("\n")}}const t={DC_SIGNAL:"SIGNAL",DC_SIGNAL_BATCH:"SIGNAL_BATCH",DC_OPEN:"OPEN",DC_REQUEST:"REQUEST",DC_PIECE_NOT_FOUND:"PIECE_NOT_FOUND",DC_PIECE_ABORT:"PIECE_ABORT",DC_PIECE_CANCEL:"PIECE_CANCEL",DC_CLOSE:"CLOSE",DC_DISCONNECT:"DISCONNECT",DC_RESPONSE:"RESPONSE",DC_ERROR:"ERROR",DC_PIECE:"PIECE",DC_PIECE_DATA:"PIECE_DATA",DC_TIMEOUT:"TIMEOUT",DC_PIECE_ACK:"PIECE_ACK",DC_METADATA:"METADATA",DC_PLAT_ANDROID:"ANDROID",DC_PLAT_IOS:"IOS",DC_PLAT_WEB:"WEB",DC_CHOKE:"CHOKE",DC_UNCHOKE:"UNCHOKE",DC_HAVE:"HAVE",DC_HAVE_REVERSE:"HAVE_REVERSE",DC_LOST:"LOST",DC_GET_PEERS:"GET_PEERS",DC_PEERS:"PEERS",DC_STATS:"STATS",DC_PEER_SIGNAL:"PEER_SIGNAL",DC_PLAYLIST:"PLAYLIST",BM_LOST:"lost",BM_ADDED_SEG_:"BM_ADDED_SEG_",BM_ADDED_SN_:"BM_ADDED_SN_",BM_SEG_ADDED:"BM_SEG_ADDED",BM_FATAL_ERROR:"BM_FATAL_ERROR",FRAG_CHANGED:"FRAG_CHANGED",FRAG_LOADED:"FRAG_LOADED",FRAG_LOADING:"FRAG_LOADING",RESTART_P2P:"RESTART_P2P",EXCEPTION:"exception",SYN_OUTPUT:"SYN_OUTPUT",SYN_ERROR:"SYN_ERROR",SYN_PROGRESS:"SYN_PROGRESS",MEDIA_REBUFFER:"MEDIA_REBUFFER",SCH_WAIT_PEER:"SCH_WAIT_PEER",SW_PLAYLIST:"SW_PLAYLIST",SW_GET_PLAYLIST:"SW_GET_PLAYLIST",SW_GET_MEDIA:"SW_GET_MEDIA",LEVEL_LOADED:"LEVEL_LOADED",MANIFEST_PARSED:"MANIFEST_PARSED"};var o=r(558);const i="__PROXY_IDENTIFIER__";function s(e,t="."){const r=o.parseURL(e);return r.path.substring(r.path.lastIndexOf(t)+1)}r(424);const a="video/mp4",u={ts:"video/MP2T",m4s:a,mp4:a,fmp4:a};let f=["m3u8"];const l=200,c=300;let h=["ts","mp4","m4s","fmp4"];const p="#EXT-X-ENDLIST\n";let d=.01,E=".",g=7e3,y=!1,_=!1;const m=new Map,w=new class{constructor(){this.sendMessageToClient=this.sendMessageToClient.bind(this)}async sendMessageToClient(e,t,r,n=[]){return e?new Promise(((o,i)=>{const s=new MessageChannel;let a;const u=(e,t)=>setTimeout((()=>{s.port1.close(),s.port2.close(),i(`MessageChannel ${t} timed out after ${e} ms`)}),e);s.port1.onmessage=function(e){const n=e.data;n?n.pong?(clearTimeout(a),a=u(r,`${t.action}-data`)):o({data:n.data}):i("no data in event")},s.port1.onmessageerror=function(e){i(e)},e.postMessage(t,[s.port2].concat(n)),a=u(50,`${t.action}-pong`)})):Promise.reject("client is null")}};let A=!1,T=null,R=null,S=!1;class b{constructor(e={}){T=e.httpHeadersForPlaylist||null,R=e.httpHeadersForMediaFile||null,!0===e.insertTimeOffsetTag?(S=!0,e.playlistTimeOffset&&(d=e.playlistTimeOffset)):S=!1,e.allowedMediaFiles&&e.allowedMediaFiles.length>0&&(h=[...e.allowedMediaFiles]),e.allowedPlaylistSuffix&&e.allowedPlaylistSuffix.length>0&&(f=[...e.allowedPlaylistSuffix]),e.mediaFileSeparator&&(E=e.mediaFileSeparator)}}function v(r){const{request:n,clientId:o}=r,{headers:a,url:b}=n;if("GET"!==n.method)return;if(b.includes(self.registration.scope+`${i}/keepalive/`))return new Response;let v=s(b);if(f.includes(v))return y&&console.info(`sw onFetch playlist ${b}`),async function(r,n){m.size>50&&m.clear();const{url:o,headers:i}=r,s=await clients.get(n);if(_&&s)try{const r=await w.sendMessageToClient(s,{action:t.SW_GET_PLAYLIST,data:{url:o}},c),{data:n}=r;if(n&&n.text){let{text:t}=n;return S&&!t.endsWith(p)&&(t=e.insertTimeOffsetTag(t,d)),new Response(t,{status:200,statusText:"OK",headers:{"Content-Type":"application/vnd.apple.mpegurl"}})}}catch(e){console.error(e)}let a;T&&(a=new Headers,y&&console.info(`set additional header for ${o}`),T(o,a,i));return fetch(new Request(o,{mode:"cors",headers:a})).then((async r=>{if(r.ok&&s)try{const i=await r.clone().text();let a;r.redirected&&(y&&console.info(`resp redirected to url ${r.url} `),a=r.url);const u=await w.sendMessageToClient(s,{action:t.SW_PLAYLIST,data:{url:o,redirectedUrl:a,ver:"2.12.3",text:i}},l),{data:f}=u;if(!f)return r;if(y||(y=f.debug),!f.active)return y&&console.warn("window client is not active"),m.delete(n),r;if(m.set(n,s),_=!!f.sharePlaylist,S&&!i.endsWith(p)){const t=e.insertTimeOffsetTag(i,d);return new Response(t,{status:200,statusText:"OK",headers:r.headers})}}catch(e){y&&console.warn(e),m.delete(n)}return r}))}(n,o);if("."!==E&&(v=s(b,E)),h.includes(v)){let e;R&&(e=new Headers,y&&console.info(`set additional header for ${b}`),R(b,e,a));let r=a.get("Range")||void 0;if(r&&(e||(e=new Headers),e.set("Range",r)),m.has(o)){let n,s;y&&console.info(`sw onFetch media ${b} range ${r}`);try{const{start:e,end:t}=function(e){if(!e)return{};const t=e.trim().toLowerCase();if(!t.startsWith("bytes="))throw new Error("unit-must-be-bytes",{normalizedRangeHeader:t});if(t.includes(","))throw new Error("single-range-only",{normalizedRangeHeader:t});const r=/(\d*)-(\d*)/.exec(t);if(!r||!r[1]&&!r[2])throw new Error("invalid-range-values",{normalizedRangeHeader:t});return{start:""===r[1]?0:Number(r[1]),end:""===r[2]?void 0:Number(r[2])}}(r);n=e,s=t}catch(e){return void console.error(e)}if(s-n<=1)return;const a=function(e,t){const r=new URL(e);return r.searchParams.get(t)?(r.searchParams.delete(t),r.href):""}(b,i);return a?fetch(new Request(a,{mode:"cors",headers:e})):function(e,r,n,o,i,s,a){y&&A&&console.warn("hls proxy is loading");let f=!1;i||s?(i||s)&&(f=!0):(o=void 0,0===i&&void 0===s&&(y&&console.warn(`request ${e} with range 0-`),f=!0));return A=!0,w.sendMessageToClient(n,{action:t.SW_GET_MEDIA,data:{url:e,range:o}},g).then((async t=>{if(A=!1,t&&t.data&&t.data.buffer){const{data:e}=t,{buffer:r}=e;if(f&&r.byteLength!==s-i+1)return void console.error("buffer size is not equal to range length "+(s-i+1));const n=function(e){const t=u[e];return t||""}(a),o={status:f?206:200,statusText:f?"Partial Content":"OK",headers:{"Accept-Ranges":"bytes","Content-Length":r.byteLength,"Content-Type":n||void 0,"Access-Control-Allow-Origin":"*"}};return f&&(o.headers["Content-Range"]=`bytes ${i}-${s}/${r.byteLength}`),new Response(r,o)}return fetch(new Request(e,{mode:"cors",headers:r}))})).catch((t=>(console.error(t),A=!1,y&&(console.warn(t),console.warn(`while requesting ${e}`)),fetch(new Request(e,{mode:"cors",headers:r})))))}(b,e,m.get(o),r,n,s,v)}return y&&console.warn("windowClient not exist when get media"),fetch(new Request(b,{mode:"cors",headers:e}))}}self.addEventListener("install",(()=>{self.skipWaiting()})),self.addEventListener("activate",(e=>e.waitUntil(self.clients.claim()))),self.addEventListener("fetch",(e=>{const t=v(e);t&&e.respondWith(t)})),self.addEventListener("message",(async function({data:e}){})),b.fileResponse=v,b.version="2.12.3"})(),n=n.default})()));
{
"name": "swarmcloud-hls",
"version": "2.12.1",
"version": "2.12.3",
"description": "Let your viewers become your unlimitedly scalable CDN.",

@@ -15,3 +15,3 @@ "main": "./dist/p2p-engine.min.js",

"scripts": {
"git-push": "git add demo && git add package.json && git add README.md && git add Readme_zh.md && git commit -m 'update clappr demo' && git push -u origin main",
"git-push": "git add demo && git add package.json && git add README.md && git add Readme_zh.md && git commit -m 'release v2.12.3' && git push -u origin main",
"git-pull": "git pull origin master"

@@ -18,0 +18,0 @@ },

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc