mirror of
https://github.com/leoherzog/TorrentParts.git
synced 2026-10-29 03:04:13 -07:00
Update Dependencies
This commit is contained in:
2 files changed
+74
-8
No files matched your search
+73
-7
@@ -13654,9 +13654,8 @@ module.exports={
|
|||||||
"application/cals-1840": {
|
"application/cals-1840": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
"application/cap+xml": {
|
"application/captive+json": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"charset": "UTF-8",
|
|
||||||
"compressible": true
|
"compressible": true
|
||||||
},
|
},
|
||||||
"application/cbor": {
|
"application/cbor": {
|
||||||
@@ -13885,6 +13884,11 @@ module.exports={
|
|||||||
"application/efi": {
|
"application/efi": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
"application/emergencycalldata.cap+xml": {
|
||||||
|
"source": "iana",
|
||||||
|
"charset": "UTF-8",
|
||||||
|
"compressible": true
|
||||||
|
},
|
||||||
"application/emergencycalldata.comment+xml": {
|
"application/emergencycalldata.comment+xml": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true
|
"compressible": true
|
||||||
@@ -14504,6 +14508,10 @@ module.exports={
|
|||||||
"source": "apache",
|
"source": "apache",
|
||||||
"extensions": ["onetoc","onetoc2","onetmp","onepkg"]
|
"extensions": ["onetoc","onetoc2","onetmp","onepkg"]
|
||||||
},
|
},
|
||||||
|
"application/opc-nodeset+xml": {
|
||||||
|
"source": "iana",
|
||||||
|
"compressible": true
|
||||||
|
},
|
||||||
"application/oscore": {
|
"application/oscore": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -14794,6 +14802,10 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true
|
"compressible": true
|
||||||
},
|
},
|
||||||
|
"application/sarif+json": {
|
||||||
|
"source": "iana",
|
||||||
|
"compressible": true
|
||||||
|
},
|
||||||
"application/sbe": {
|
"application/sbe": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -15093,6 +15105,10 @@ module.exports={
|
|||||||
"application/tzif-leap": {
|
"application/tzif-leap": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
"application/ubjson": {
|
||||||
|
"compressible": false,
|
||||||
|
"extensions": ["ubj"]
|
||||||
|
},
|
||||||
"application/ulpfec": {
|
"application/ulpfec": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -15107,7 +15123,8 @@ module.exports={
|
|||||||
},
|
},
|
||||||
"application/urc-targetdesc+xml": {
|
"application/urc-targetdesc+xml": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true
|
"compressible": true,
|
||||||
|
"extensions": ["td"]
|
||||||
},
|
},
|
||||||
"application/urc-uisocketdesc+xml": {
|
"application/urc-uisocketdesc+xml": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
@@ -15486,7 +15503,7 @@ module.exports={
|
|||||||
},
|
},
|
||||||
"application/vnd.apple.keynote": {
|
"application/vnd.apple.keynote": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"extensions": ["keynote"]
|
"extensions": ["key"]
|
||||||
},
|
},
|
||||||
"application/vnd.apple.mpegurl": {
|
"application/vnd.apple.mpegurl": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
@@ -15803,6 +15820,12 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": false
|
"compressible": false
|
||||||
},
|
},
|
||||||
|
"application/vnd.d3m-dataset": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
|
"application/vnd.d3m-problem": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"application/vnd.dart": {
|
"application/vnd.dart": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true,
|
"compressible": true,
|
||||||
@@ -15821,7 +15844,8 @@ module.exports={
|
|||||||
"compressible": true
|
"compressible": true
|
||||||
},
|
},
|
||||||
"application/vnd.dbf": {
|
"application/vnd.dbf": {
|
||||||
"source": "iana"
|
"source": "iana",
|
||||||
|
"extensions": ["dbf"]
|
||||||
},
|
},
|
||||||
"application/vnd.debian.binary-package": {
|
"application/vnd.debian.binary-package": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
@@ -17551,6 +17575,9 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true
|
"compressible": true
|
||||||
},
|
},
|
||||||
|
"application/vnd.oma.lwm2m+cbor": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"application/vnd.oma.lwm2m+json": {
|
"application/vnd.oma.lwm2m+json": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true
|
"compressible": true
|
||||||
@@ -18161,7 +18188,8 @@ module.exports={
|
|||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
"application/vnd.rar": {
|
"application/vnd.rar": {
|
||||||
"source": "iana"
|
"source": "iana",
|
||||||
|
"extensions": ["rar"]
|
||||||
},
|
},
|
||||||
"application/vnd.realvnc.bed": {
|
"application/vnd.realvnc.bed": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
@@ -18460,6 +18488,10 @@ module.exports={
|
|||||||
"application/vnd.swiftview-ics": {
|
"application/vnd.swiftview-ics": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
"application/vnd.sycle+xml": {
|
||||||
|
"source": "iana",
|
||||||
|
"compressible": true
|
||||||
|
},
|
||||||
"application/vnd.symbian.install": {
|
"application/vnd.symbian.install": {
|
||||||
"source": "apache",
|
"source": "apache",
|
||||||
"extensions": ["sis","sisx"]
|
"extensions": ["sis","sisx"]
|
||||||
@@ -19543,7 +19575,7 @@ module.exports={
|
|||||||
"application/xslt+xml": {
|
"application/xslt+xml": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true,
|
"compressible": true,
|
||||||
"extensions": ["xslt"]
|
"extensions": ["xsl","xslt"]
|
||||||
},
|
},
|
||||||
"application/xspf+xml": {
|
"application/xspf+xml": {
|
||||||
"source": "apache",
|
"source": "apache",
|
||||||
@@ -19926,6 +19958,9 @@ module.exports={
|
|||||||
"audio/smv0": {
|
"audio/smv0": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
"audio/sofa": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"audio/sp-midi": {
|
"audio/sp-midi": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -19950,6 +19985,9 @@ module.exports={
|
|||||||
"audio/tone": {
|
"audio/tone": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
"audio/tsvcis": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"audio/uemclip": {
|
"audio/uemclip": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -20249,6 +20287,10 @@ module.exports={
|
|||||||
"image/avcs": {
|
"image/avcs": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
"image/avif": {
|
||||||
|
"compressible": false,
|
||||||
|
"extensions": ["avif"]
|
||||||
|
},
|
||||||
"image/bmp": {
|
"image/bmp": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true,
|
"compressible": true,
|
||||||
@@ -20371,6 +20413,10 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"extensions": ["ktx"]
|
"extensions": ["ktx"]
|
||||||
},
|
},
|
||||||
|
"image/ktx2": {
|
||||||
|
"source": "iana",
|
||||||
|
"extensions": ["ktx2"]
|
||||||
|
},
|
||||||
"image/naplps": {
|
"image/naplps": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -20495,6 +20541,10 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"extensions": ["npx"]
|
"extensions": ["npx"]
|
||||||
},
|
},
|
||||||
|
"image/vnd.pco.b16": {
|
||||||
|
"source": "iana",
|
||||||
|
"extensions": ["b16"]
|
||||||
|
},
|
||||||
"image/vnd.radiance": {
|
"image/vnd.radiance": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -20696,6 +20746,9 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"extensions": ["3mf"]
|
"extensions": ["3mf"]
|
||||||
},
|
},
|
||||||
|
"model/e57": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"model/gltf+json": {
|
"model/gltf+json": {
|
||||||
"source": "iana",
|
"source": "iana",
|
||||||
"compressible": true,
|
"compressible": true,
|
||||||
@@ -20927,6 +20980,9 @@ module.exports={
|
|||||||
"text/fwdred": {
|
"text/fwdred": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
"text/gff3": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"text/grammar-ref-list": {
|
"text/grammar-ref-list": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -21033,12 +21089,19 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"extensions": ["sgml","sgm"]
|
"extensions": ["sgml","sgm"]
|
||||||
},
|
},
|
||||||
|
"text/shaclc": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"text/shex": {
|
"text/shex": {
|
||||||
"extensions": ["shex"]
|
"extensions": ["shex"]
|
||||||
},
|
},
|
||||||
"text/slim": {
|
"text/slim": {
|
||||||
"extensions": ["slim","slm"]
|
"extensions": ["slim","slm"]
|
||||||
},
|
},
|
||||||
|
"text/spdx": {
|
||||||
|
"source": "iana",
|
||||||
|
"extensions": ["spdx"]
|
||||||
|
},
|
||||||
"text/strings": {
|
"text/strings": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
@@ -21133,6 +21196,9 @@ module.exports={
|
|||||||
"source": "iana",
|
"source": "iana",
|
||||||
"extensions": ["gv"]
|
"extensions": ["gv"]
|
||||||
},
|
},
|
||||||
|
"text/vnd.hans": {
|
||||||
|
"source": "iana"
|
||||||
|
},
|
||||||
"text/vnd.hgl": {
|
"text/vnd.hgl": {
|
||||||
"source": "iana"
|
"source": "iana"
|
||||||
},
|
},
|
||||||
|
|||||||
Vendored
+1
-1
@@ -33,7 +33,7 @@ const i=e("queue-microtask");t.exports=class{constructor(e){if(this.store=e,this
|
|||||||
/*! magnet-uri. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
|
/*! magnet-uri. MIT License. WebTorrent LLC <https://webtorrent.io/opensource> */
|
||||||
t.exports=o,t.exports.decode=o,t.exports.encode=function(e){(e=Object.assign({},e)).infoHashBuffer&&(e.xt=`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&(e.xt=`urn:btih:${e.infoHash}`);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let t="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((n,i)=>{const o=Array.isArray(e[n])?e[n]:[e[n]];o.forEach(((e,r)=>{(i>0||r>0)&&("kt"!==n&&"so"!==n||0===r)&&(t+="&"),"dn"===n&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==n&&"as"!==n&&"ws"!==n||(e=encodeURIComponent(e)),"xs"!==n||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===n&&(e=encodeURIComponent(e)),"so"!==n&&(t+="kt"===n&&r>0?`+${e}`:`${n}=${e}`)})),"so"===n&&(t+=`${n}=${r.compose(o)}`)})),t};const i=e("thirty-two"),r=e("bep53-range");function o(e){const t={},o=e.split("magnet:?")[1];let s;if((o&&o.length>=0?o.split("&"):[]).forEach((e=>{const n=e.split("=");if(2!==n.length)return;const i=n[0];let o=n[1];"dn"===i&&(o=decodeURIComponent(o).replace(/\+/g," ")),"tr"!==i&&"xs"!==i&&"as"!==i&&"ws"!==i||(o=decodeURIComponent(o)),"kt"===i&&(o=decodeURIComponent(o).split("+")),"ix"===i&&(o=Number(o)),"so"===i&&(o=r.parse(decodeURIComponent(o).split(","))),t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(o)):t[i]=o})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(s=e.match(/^urn:btih:(.{40})/))t.infoHash=s[1].toLowerCase();else if(s=e.match(/^urn:btih:(.{32})/)){const e=i.decode(s[1]);t.infoHash=n.from(e,"binary").toString("hex")}}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(s=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=s[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=n.from(t.infoHash,"hex")),t.publicKey&&(t.publicKeyBuffer=n.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}}).call(this)}).call(this,e("buffer").Buffer)},{"bep53-range":8,buffer:57,"thirty-two":287}],125:[function(e,t,n){
|
t.exports=o,t.exports.decode=o,t.exports.encode=function(e){(e=Object.assign({},e)).infoHashBuffer&&(e.xt=`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&(e.xt=`urn:btih:${e.infoHash}`);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let t="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((n,i)=>{const o=Array.isArray(e[n])?e[n]:[e[n]];o.forEach(((e,r)=>{(i>0||r>0)&&("kt"!==n&&"so"!==n||0===r)&&(t+="&"),"dn"===n&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==n&&"as"!==n&&"ws"!==n||(e=encodeURIComponent(e)),"xs"!==n||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===n&&(e=encodeURIComponent(e)),"so"!==n&&(t+="kt"===n&&r>0?`+${e}`:`${n}=${e}`)})),"so"===n&&(t+=`${n}=${r.compose(o)}`)})),t};const i=e("thirty-two"),r=e("bep53-range");function o(e){const t={},o=e.split("magnet:?")[1];let s;if((o&&o.length>=0?o.split("&"):[]).forEach((e=>{const n=e.split("=");if(2!==n.length)return;const i=n[0];let o=n[1];"dn"===i&&(o=decodeURIComponent(o).replace(/\+/g," ")),"tr"!==i&&"xs"!==i&&"as"!==i&&"ws"!==i||(o=decodeURIComponent(o)),"kt"===i&&(o=decodeURIComponent(o).split("+")),"ix"===i&&(o=Number(o)),"so"===i&&(o=r.parse(decodeURIComponent(o).split(","))),t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(o)):t[i]=o})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(s=e.match(/^urn:btih:(.{40})/))t.infoHash=s[1].toLowerCase();else if(s=e.match(/^urn:btih:(.{32})/)){const e=i.decode(s[1]);t.infoHash=n.from(e,"binary").toString("hex")}}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(s=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=s[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=n.from(t.infoHash,"hex")),t.publicKey&&(t.publicKeyBuffer=n.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}}).call(this)}).call(this,e("buffer").Buffer)},{"bep53-range":8,buffer:57,"thirty-two":287}],125:[function(e,t,n){
|
||||||
/*! mediasource. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
/*! mediasource. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||||
t.exports=a;var i=e("inherits"),r=e("readable-stream"),o=e("to-arraybuffer"),s="undefined"!=typeof window&&window.MediaSource;function a(e,t){var n=this;if(!(n instanceof a))return new a(e,t);if(!s)throw new Error("web browser lacks MediaSource support");t||(t={}),n._debug=t.debug,n._bufferDuration=t.bufferDuration||60,n._elem=e,n._mediaSource=new s,n._streams=[],n.detailedError=null,n._errorHandler=function(){n._elem.removeEventListener("error",n._errorHandler),n._streams.slice().forEach((function(e){e.destroy(n._elem.error)}))},n._elem.addEventListener("error",n._errorHandler),n._elem.src=window.URL.createObjectURL(n._mediaSource)}function c(e,t){var n=this;if(r.Writable.call(n),n._wrapper=e,n._elem=e._elem,n._mediaSource=e._mediaSource,n._allStreams=e._streams,n._allStreams.push(n),n._bufferDuration=e._bufferDuration,n._sourceBuffer=null,n._debugBuffers=[],n._openHandler=function(){n._onSourceOpen()},n._flowHandler=function(){n._flow()},n._errorHandler=function(e){n.destroyed||n.emit("error",e)},"string"==typeof t)n._type=t,"open"===n._mediaSource.readyState?n._createSourceBuffer():n._mediaSource.addEventListener("sourceopen",n._openHandler);else if(null===t._sourceBuffer)t.destroy(),n._type=t._type,n._mediaSource.addEventListener("sourceopen",n._openHandler);else{if(!t._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");t.destroy(),n._type=t._type,n._sourceBuffer=t._sourceBuffer,n._debugBuffers=t._debugBuffers,n._sourceBuffer.addEventListener("updateend",n._flowHandler),n._sourceBuffer.addEventListener("error",n._errorHandler)}n._elem.addEventListener("timeupdate",n._flowHandler),n.on("error",(function(e){n._wrapper.error(e)})),n.on("finish",(function(){if(!n.destroyed&&(n._finished=!0,n._allStreams.every((function(e){return e._finished})))){n._wrapper._dumpDebugData();try{n._mediaSource.endOfStream()}catch(e){}}}))}a.prototype.createWriteStream=function(e){return new c(this,e)},a.prototype.error=function(e){var t=this;t.detailedError||(t.detailedError=e),t._dumpDebugData();try{t._mediaSource.endOfStream("decode")}catch(e){}try{window.URL.revokeObjectURL(t._elem.src)}catch(e){}},a.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var n,i,r;n=e._debugBuffers,i="mediasource-stream-"+t,(r=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(n)),r.download=i,r.click()})))},i(c,r.Writable),c.prototype._onSourceOpen=function(){var e=this;e.destroyed||(e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._createSourceBuffer())},c.prototype.destroy=function(e){var t=this;t.destroyed||(t.destroyed=!0,t._allStreams.splice(t._allStreams.indexOf(t),1),t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._elem.removeEventListener("timeupdate",t._flowHandler),t._sourceBuffer&&(t._sourceBuffer.removeEventListener("updateend",t._flowHandler),t._sourceBuffer.removeEventListener("error",t._errorHandler),"open"===t._mediaSource.readyState&&t._sourceBuffer.abort()),e&&t.emit("error",e),t.emit("close"))},c.prototype._createSourceBuffer=function(){var e=this;if(!e.destroyed)if(s.isTypeSupported(e._type)){if(e._sourceBuffer=e._mediaSource.addSourceBuffer(e._type),e._sourceBuffer.addEventListener("updateend",e._flowHandler),e._sourceBuffer.addEventListener("error",e._errorHandler),e._cb){var t=e._cb;e._cb=null,t()}}else e.destroy(new Error("The provided type is not supported"))},c.prototype._write=function(e,t,n){var i=this;if(!i.destroyed)if(i._sourceBuffer){if(i._sourceBuffer.updating)return n(new Error("Cannot append buffer while source buffer updating"));var r=o(e);i._wrapper._debug&&i._debugBuffers.push(r);try{i._sourceBuffer.appendBuffer(r)}catch(e){return void i.destroy(e)}i._cb=n}else i._cb=function(r){if(r)return n(r);i._write(e,t,n)}},c.prototype._flow=function(){var e=this;if(!e.destroyed&&e._sourceBuffer&&!e._sourceBuffer.updating&&!("open"===e._mediaSource.readyState&&e._getBufferDuration()>e._bufferDuration)&&e._cb){var t=e._cb;e._cb=null,t()}};c.prototype._getBufferDuration=function(){for(var e=this._sourceBuffer.buffered,t=this._elem.currentTime,n=-1,i=0;i<e.length;i++){var r=e.start(i),o=e.end(i)+0;if(r>t)break;(n>=0||t<=o)&&(n=o)}var s=n-t;return s<0&&(s=0),s}},{inherits:119,"readable-stream":140,"to-arraybuffer":290}],126:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{dup:16}],127:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_readable":129,"./_stream_writable":131,_process:187,dup:17,inherits:119}],128:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"./_stream_transform":130,dup:18,inherits:119}],129:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../errors":126,"./_stream_duplex":127,"./internal/streams/async_iterator":132,"./internal/streams/buffer_list":133,"./internal/streams/destroy":134,"./internal/streams/from":136,"./internal/streams/state":138Line truncated
|
t.exports=a;var i=e("inherits"),r=e("readable-stream"),o=e("to-arraybuffer"),s="undefined"!=typeof window&&window.MediaSource;function a(e,t){var n=this;if(!(n instanceof a))return new a(e,t);if(!s)throw new Error("web browser lacks MediaSource support");t||(t={}),n._debug=t.debug,n._bufferDuration=t.bufferDuration||60,n._elem=e,n._mediaSource=new s,n._streams=[],n.detailedError=null,n._errorHandler=function(){n._elem.removeEventListener("error",n._errorHandler),n._streams.slice().forEach((function(e){e.destroy(n._elem.error)}))},n._elem.addEventListener("error",n._errorHandler),n._elem.src=window.URL.createObjectURL(n._mediaSource)}function c(e,t){var n=this;if(r.Writable.call(n),n._wrapper=e,n._elem=e._elem,n._mediaSource=e._mediaSource,n._allStreams=e._streams,n._allStreams.push(n),n._bufferDuration=e._bufferDuration,n._sourceBuffer=null,n._debugBuffers=[],n._openHandler=function(){n._onSourceOpen()},n._flowHandler=function(){n._flow()},n._errorHandler=function(e){n.destroyed||n.emit("error",e)},"string"==typeof t)n._type=t,"open"===n._mediaSource.readyState?n._createSourceBuffer():n._mediaSource.addEventListener("sourceopen",n._openHandler);else if(null===t._sourceBuffer)t.destroy(),n._type=t._type,n._mediaSource.addEventListener("sourceopen",n._openHandler);else{if(!t._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");t.destroy(),n._type=t._type,n._sourceBuffer=t._sourceBuffer,n._debugBuffers=t._debugBuffers,n._sourceBuffer.addEventListener("updateend",n._flowHandler),n._sourceBuffer.addEventListener("error",n._errorHandler)}n._elem.addEventListener("timeupdate",n._flowHandler),n.on("error",(function(e){n._wrapper.error(e)})),n.on("finish",(function(){if(!n.destroyed&&(n._finished=!0,n._allStreams.every((function(e){return e._finished})))){n._wrapper._dumpDebugData();try{n._mediaSource.endOfStream()}catch(e){}}}))}a.prototype.createWriteStream=function(e){return new c(this,e)},a.prototype.error=function(e){var t=this;t.detailedError||(t.detailedError=e),t._dumpDebugData();try{t._mediaSource.endOfStream("decode")}catch(e){}try{window.URL.revokeObjectURL(t._elem.src)}catch(e){}},a.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var n,i,r;n=e._debugBuffers,i="mediasource-stream-"+t,(r=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(n)),r.download=i,r.click()})))},i(c,r.Writable),c.prototype._onSourceOpen=function(){var e=this;e.destroyed||(e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._createSourceBuffer())},c.prototype.destroy=function(e){var t=this;t.destroyed||(t.destroyed=!0,t._allStreams.splice(t._allStreams.indexOf(t),1),t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._elem.removeEventListener("timeupdate",t._flowHandler),t._sourceBuffer&&(t._sourceBuffer.removeEventListener("updateend",t._flowHandler),t._sourceBuffer.removeEventListener("error",t._errorHandler),"open"===t._mediaSource.readyState&&t._sourceBuffer.abort()),e&&t.emit("error",e),t.emit("close"))},c.prototype._createSourceBuffer=function(){var e=this;if(!e.destroyed)if(s.isTypeSupported(e._type)){if(e._sourceBuffer=e._mediaSource.addSourceBuffer(e._type),e._sourceBuffer.addEventListener("updateend",e._flowHandler),e._sourceBuffer.addEventListener("error",e._errorHandler),e._cb){var t=e._cb;e._cb=null,t()}}else e.destroy(new Error("The provided type is not supported"))},c.prototype._write=function(e,t,n){var i=this;if(!i.destroyed)if(i._sourceBuffer){if(i._sourceBuffer.updating)return n(new Error("Cannot append buffer while source buffer updating"));var r=o(e);i._wrapper._debug&&i._debugBuffers.push(r);try{i._sourceBuffer.appendBuffer(r)}catch(e){return void i.destroy(e)}i._cb=n}else i._cb=function(r){if(r)return n(r);i._write(e,t,n)}},c.prototype._flow=function(){var e=this;if(!e.destroyed&&e._sourceBuffer&&!e._sourceBuffer.updating&&!("open"===e._mediaSource.readyState&&e._getBufferDuration()>e._bufferDuration)&&e._cb){var t=e._cb;e._cb=null,t()}};c.prototype._getBufferDuration=function(){for(var e=this._sourceBuffer.buffered,t=this._elem.currentTime,n=-1,i=0;i<e.length;i++){var r=e.start(i),o=e.end(i)+0;if(r>t)break;(n>=0||t<=o)&&(n=o)}var s=n-t;return s<0&&(s=0),s}},{inherits:119,"readable-stream":140,"to-arraybuffer":290}],126:[function(e,t,n){arguments[4][16][0].apply(n,arguments)},{dup:16}],127:[function(e,t,n){arguments[4][17][0].apply(n,arguments)},{"./_stream_readable":129,"./_stream_writable":131,_process:187,dup:17,inherits:119}],128:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{"./_stream_transform":130,dup:18,inherits:119}],129:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{"../errors":126,"./_stream_duplex":127,"./internal/streams/async_iterator":132,"./internal/streams/buffer_list":133,"./internal/streams/destroy":134,"./internal/streams/from":136,"./internal/streams/state":138Line truncated
|
||||||
/*!
|
/*!
|
||||||
* mime-db
|
* mime-db
|
||||||
* Copyright(c) 2014 Jonathan Ong
|
* Copyright(c) 2014 Jonathan Ong
|
||||||
|
|||||||
Reference in new issue
Block a user