quickvo-player 0.0.4 → 0.0.6
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.
- package/dist/index.js +1395 -1240
- package/dist/index.umd.cjs +4 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,71 +1,84 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Z = Object.defineProperty;
|
|
2
|
+
var X = (h) => {
|
|
3
|
+
throw TypeError(h);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
const L = '(function(){"use strict";const U=new TextDecoder("utf-8"),H=(e,s)=>{const a=e.getUint8(s),t=a>>7&1,n=a>>5&3,r=a&31;return{forbidden_zero_bit:t,nal_ref_idc:n,nal_unit_type:r}},b=(e,s)=>e.getUint8(s),P=(e,s,a)=>{const t=new Uint8Array(e.buffer.slice(s,s+a));return U?.decode(t)||""},T=(e,s,a)=>{let t=s,n,r=0;switch(a){case 0:n=e.getFloat64(t,!1),r=8;break;case 1:n=!!e.getUint8(t),r=1;break;case 2:{n="";const o=e.getUint16(t,!1);t=t+2;const c=new Int8Array(e.buffer,t,o).filter(d=>d!==0);n=(U?.decode(c)||"").trim(),r=2+o}break;case 3:for(n={};t<e.byteLength;){const o=e.getUint16(t,!1);if(o===0)break;t=t+2;const c=P(e,t,o);t=t+o;const g=b(e,t);if(g===6)break;t=t+1;const d=T(e,t,g);t=t+d.length,n[c]=d.value,r=2+o+1+d.length}break;case 8:{n={};const o=e.getUint32(t,!1);t=t+4;for(let c=0;c<o;c++){const g=e.getUint16(t,!1);t=t+2;const d=P(e,t,g);t=t+g;const h=b(e,t);t=t+1;const l=T(e,t,h);t=t+l.length,n[d]=l.value,r=2+g+1+l.length}}break;case 10:{n=[];const o=e.getUint32(t,!1);t=t+4;for(let c=0;c<o;c++){const g=b(e,t);t=t+1;const d=T(e,t,g);t=t+d.length,n.push(d.value),r=1+d.length}}break}return{amfType:a,length:r,value:n}},m=(e,s)=>e.getUint8(s)<<16|e.getUint8(s+1)<<8|e.getUint8(s+2);var u={header:{getSignature:e=>{const s=new Int8Array(e.buffer.slice(0,3));return U?.decode(s)||""},getVersion:e=>e.getUint8(3),getFlags:e=>{const a=e.getUint8(0).toString(2).padStart(5,"0").split(""),[,,t,,n]=a;return{audio:n==="1",video:t==="1"}},getDataOffset:e=>e.getUint32(5)},getPreviousTagSize:(e,s)=>e.getUint32(s),isSurplusTag:(e,s)=>{let a=!0;const t=e.byteLength;if(s+4>t)a=!1;else if(s+4+11>t)a=!1;else{const n=m(e,s+4+1);s+4+11+n>t&&(a=!1)}return a},tag:{tagHeader:{getTagType:(e,s)=>{const a=e.getUint8(s);let t;switch(a){case 18:t="script";break;case 8:t="audio";break;case 9:t="video";break}return t},getDataSize:(e,s)=>m(e,s+1),getTimestamp:(e,s)=>m(e,s+4),getTimestampExtended:(e,s)=>e.getUint8(s+7),getStreamID:(e,s)=>m(e,s+8)},tagBody:{parseAudio:(e,s,a)=>{let t=s;const n=e.getUint8(t),r=n>>4&15,i=n>>2&3,o=n>>1&1,c=n&1;t=t+1;const g=e.getUint8(t);t=t+1;const d=a-2,h=new Uint8Array(e.buffer.slice(t,t+d));if(r===10&&g===0){const l=e.getUint8(t),p=e.getUint8(t+1),f=(l&248)>>3,y=(l&7)<<1|p>>7,S=(p&120)>>3,A=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],D=`mp4a.40.${f}`,z=A[y];return{soundFormat:r,soundRate:i,soundSize:o,soundType:c,accPacketType:g,data:h,audioObjectType:f,samplingFrequencyIndex:y,channelConfiguration:S,codec:D,sampleRate:z}}return{soundFormat:r,soundRate:i,soundSize:o,soundType:c,accPacketType:g,data:h}},parseVideo:(e,s,a)=>{let t=s;const n=e.getUint8(t),r=n>>4&15,i=n&15;t=t+1;const o=e.getUint8(t);t=t+1;const c=m(e,t);t=t+3;const g=a-5,d=new Uint8Array(e.buffer.slice(t,t+g));switch(i){case 7:if(o===0){const h=e.getUint8(t);if(t=t+1,h!==1)throw new Error("Invalid AVC version");const l=e.getUint8(t)&255;t=t+1;const p=e.getUint8(t)&255;t=t+1;const f=e.getUint8(t)&255;t=t+1;const A=`avc1.${Array.from([l,p,f],E=>E.toString(16).padStart(2,"0")).join("")}`,D=(e.getUint8(t)&3)-1;t=t+1;const z=e.getUint8(t)&31;t=t+1;const _=e.getUint16(t,!1);t=t+2;const O=new Uint8Array(e.buffer.slice(t,t+_));t=t+_;const I=e.getUint8(t)&31;t=t+1;const x=e.getUint16(t,!1);t=t+2;const M=new Uint8Array(e.buffer.slice(t,t+x));return t=t+x,{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d,version:h,codec:A,profile:l,compatibility:p,level:f,lengthSizeMinusOne:D,numOfSequenceParameterSets:z,sequenceParameterSetLength:_,sps:O,numOfPictureParameterSets:I,pictureParameterSetLength:x,pps:M}}else if(o===1){const h=[],l=t+a-5;for(;t+4<l;){const p=e.getUint32(t,!1);t=t+4;const f=H(e,t);t=t+1;const y=p-1,S=new Uint8Array(e.buffer.slice(t,t+y));t=t+y,h.push({size:p,header:f,payload:S})}return{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d,nalus:h}}break;default:throw new Error("Unsupported codecID")}return{frameType:r,codecID:i,avcPacketType:o,cts:c,data:d}},parseMetaData:(e,s)=>{let a=s;{if(e.getUint8(a)!==2)throw new Error("Invalid AMF type for onMetaData (expected 0x02)");a=a+1}const t=e.getUint16(a,!1);a=a+2;{const i=new Int8Array(e.buffer.slice(a,a+t));if((U?.decode(i)||"")!=="onMetaData")throw new Error("Expected \'onMetaData\' string");a=a+t}const n=b(e,a);return a=a+1,T(e,a,n).value}}}};class L{parseSpeed=8;pendingPayloads=[];payload=new Uint8Array(0);offset=0;is_parsing=!1;header;tag;on={};constructor(){}init=()=>{this.destroy()};push=s=>{this.pendingPayloads.push(s),this.is_parsing||this.parse()};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array(0),this.offset=0,this.is_parsing=!1,this.header=void 0,this.tag=void 0};parse=async()=>{for(this.is_parsing=!0;;){const s=this.pendingPayloads.shift();if(!s)break;const a=new Uint8Array(this.payload.byteLength+s.byteLength);a.set(this.payload,0),a.set(s,this.payload.byteLength),this.payload=a;const t=new DataView(this.payload.buffer);this.header||this.parseHeader(t),await this.parseTag(t)}this.is_parsing=!1};parseHeader=s=>(this.header={signature:u.header.getSignature(s),version:u.header.getVersion(s),flags:u.header.getFlags(s),dataOffset:u.header.getDataOffset(s)},this.offset=this.header?.dataOffset,this.on.header&&this.on.header(this.header),this.header);parseTag=async s=>{const a=(n,r)=>({tagType:u.tag.tagHeader.getTagType(n,r),dataSize:u.tag.tagHeader.getDataSize(n,r),timestamp:u.tag.tagHeader.getTimestamp(n,r),timestampExtended:u.tag.tagHeader.getTimestampExtended(n,r),streamID:u.tag.tagHeader.getStreamID(n,r)}),t=(n,r,i,o)=>{let c;switch(n){case"script":c=u.tag.tagBody.parseMetaData(r,i);break;case"audio":c=u.tag.tagBody.parseAudio(r,i,o);break;case"video":c=u.tag.tagBody.parseVideo(r,i,o);break}return c};for(;this.offset<s.byteLength;){if(u.isSurplusTag(s,this.offset)===!1){this.payload=this.payload.slice(this.offset),this.offset=0;break}const r=a(s,this.offset+4),{tagType:i,dataSize:o}=r;if(!i)break;const c=t(i,s,this.offset+4+11,o);this.tag={header:r,body:c},this.on.tag&&this.on.tag(this.tag),this.offset=this.offset+4+11+o,await new Promise(g=>setTimeout(()=>g(!0),this.parseSpeed))}}}const k=new L;k.on.header=e=>postMessage({action:"onHeader",data:e}),k.on.tag=e=>postMessage({action:"onTag",data:e}),onmessage=e=>{const{action:s,data:a}=e.data,t=k[s];t&&t(a)}})();\n', A = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", L], { type: "text/javascript;charset=utf-8" });
|
|
9
|
-
function
|
|
5
|
+
var tt = (h, o, a) => o in h ? Z(h, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[o] = a;
|
|
6
|
+
var m = (h, o, a) => tt(h, typeof o != "symbol" ? o + "" : o, a), Q = (h, o, a) => o.has(h) || X("Cannot " + a);
|
|
7
|
+
var U = (h, o, a) => (Q(h, o, "read from private field"), a ? a.call(h) : o.get(h)), J = (h, o, a) => o.has(h) ? X("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(h) : o.set(h, a), K = (h, o, a, u) => (Q(h, o, "write to private field"), u ? u.call(h, a) : o.set(h, a), a);
|
|
8
|
+
const D = '(function(){"use strict";class P{pendingPayloads=[];payload=new Uint8Array(0);chunks=[];push=t=>{this.pendingPayloads.push(t)};next=(t=0)=>{this.payload=this.payload.slice(t);const s=this.pendingPayloads.shift();if(!s)return!1;const e=new Uint8Array(this.payload.byteLength+s.byteLength);return e.set(this.payload,0),e.set(s,this.payload.byteLength),this.payload=e,new DataView(this.payload.buffer)};pushChunk=t=>{this.chunks.push(t),this.chunks.length>1e3&&this.chunks.shift()};destroy=()=>{this.pendingPayloads=[],this.payload=new Uint8Array(0),this.chunks=[]}}const I=(u,t)=>{const s=new Uint8Array(u),e=new Uint8Array(t),n=new Uint8Array(11+s.length+e.length);let a=0;return n[a++]=1,n[a++]=s[1],n[a++]=s[2],n[a++]=s[3],n[a++]=255,n[a++]=225,n[a++]=s.length>>8&255,n[a++]=s.length&255,n.set(s,a),a+=s.length,n[a++]=1,n[a++]=e.length>>8&255,n[a++]=e.length&255,n.set(e,a),n},T=u=>{let t=0;const s=new DataView(u.buffer),e=s.getUint8(t);if(t=t+1,e!==1)throw new Error("Invalid AVC version");const n=s.getUint8(t)&255;t=t+1;const a=s.getUint8(t)&255;t=t+1;const i=s.getUint8(t)&255;t=t+1;const h=`avc1.${Array.from([n,a,i],b=>b.toString(16).padStart(2,"0")).join("")}`,c=(s.getUint8(t)&3)-1;t=t+1;const g=s.getUint8(t)&31;t=t+1;const p=s.getUint16(t,!1);t=t+2;const l=new Uint8Array(s.buffer.slice(t,t+p));t=t+p;const d=s.getUint8(t)&31;t=t+1;const f=s.getUint16(t,!1);t=t+2;const y=new Uint8Array(s.buffer.slice(t,t+f));return t=t+f,{version:e,codec:h,profile:n,compatibility:a,level:i,lengthSizeMinusOne:c,numOfSequenceParameterSets:g,sequenceParameterSetLength:p,sps:l,numOfPictureParameterSets:d,pictureParameterSetLength:f,pps:y}},M=u=>{const t=new Uint8Array(4+u.length);return new DataView(t.buffer).setUint32(0,u.length,!1),t.set(u,4),t},C=u=>{let t=0;for(const n of u)t+=n.length;const s=new Uint8Array(t);let e=0;for(const n of u){const a=n;s.set(a,e),e+=a.length}return s},x=u=>{let t="unknown";switch(u){case 1:case 2:case 27:case 36:t="video";break;case 3:case 4:case 15:t="audio";break;case 6:t="subtitle";break;case 134:t="ad";break}return t};class D{pat;pmt;audioConfig;videoConfig;payloadMap=new Map;on={};constructor(){}parse=async t=>{let s=0;for(;!(s+188>t.byteLength);){if(t.getInt8(s)!=71){s++;continue}await this.parsePacket(t,s),s+=188}return s};parsePacket=async(t,s)=>{if(s+188>t.byteLength)throw new Error("Invalid TS packet");if(t.getUint8(s)!==71)throw new Error("Invalid TS packet");let e=s;const n=this.parseHeader(t,e);e+=4;const{transport_error_indicator:a,pid:i,payload_unit_start_indicator:o,adaptation_field_control:r}=n;if(a===1||i===void 0)return;let h=184;if(r===2||r===3){const c=t.getUint8(e);e+=1,this.parseAdaptationField(t,e),e+=c,h-=c}if(r===3&&(h-=1),r===1||r===3){const c=new Uint8Array(t.buffer.slice(e,e+h));if(i===0)return this.parsePAT(t,e);{const{programs:l=[]}=this.pat||{};if(l.find(f=>f.pmt_pid===i))return this.parsePMT(t,e)}const{streams:g=[]}=this.pmt||{},p=g.find(l=>l.elementary_pid===i);if(p){if(o===1){const l=this.payloadMap.get(i);if(l){switch(p.kind){case"audio":break;case"video":{const d=await this.parseVideo(l);this.on.chunk&&this.on.chunk(d),await new Promise(f=>setTimeout(()=>f(!0),8))}break}this.payloadMap.delete(i)}}{this.payloadMap.has(i)||this.payloadMap.set(i,new Uint8Array);const l=this.payloadMap.get(i),d=new Uint8Array(l.byteLength+c.byteLength);d.set(l,0),d.set(c,l.byteLength),this.payloadMap.set(i,d)}}}};parseHeader=(t,s)=>{let e=s;const n=t.getUint8(e),a=t.getUint8(e+1),i=t.getUint8(e+2),o=t.getUint8(e+3),r=(a&128)>>7;if(r===1)return{sync_byte:n,transport_error_indicator:r};const h=(a&64)>>6,c=(a&32)>>5,g=(a&31)<<8|i,p=(o&192)>>6,l=o>>4&3,d=o&15;return{sync_byte:n,transport_error_indicator:r,payload_unit_start_indicator:h,transport_priority:c,pid:g,transport_scrambling_control:p,adaptation_field_control:l,continuity_counter:d}};parsePAT=(t,s)=>{let e=s,n;{const o=t.getUint8(e);e+=1;const r=t.getUint8(e);if(e+=1,r!==0)throw new Error("Invalid PAT table_id");const h=t.getUint16(e)&4095;e+=2;const c=t.getUint16(e);e+=2;const g=(t.getUint8(e)&62)>>1,p=t.getUint8(e)&1;e+=1;const l=t.getUint8(e);e+=1;const d=t.getUint8(e);e+=1,n={pointer_field:o,table_id:r,section_length:h,transport_stream_id:c,version_number:g,current_next_indicator:p,section_number:l,last_section_number:d}}const a=[];{const o=n.section_length-5-4,r=e+o;for(;e<r;){const h=t.getUint16(e),c=t.getUint16(e+2)&8191;e+=4,h!==0&&c>=32&&c<=8190&&a.push({program_number:h,pmt_pid:c})}}const i=t.getUint32(e);this.pat={header:n,programs:a,crc32:i},this.on.debug&&this.on.debug({pat:this.pat})};parsePMT=(t,s)=>{let e=s,n;{const o=t.getUint8(e);e+=1;const r=t.getUint8(e);if(e+=1,r!==2)throw new Error("Invalid PMT table_id");const h=t.getUint16(e)&4095;e+=2;const c=t.getUint16(e);e+=2;const g=(t.getUint8(e)&62)>>1,p=t.getUint8(e)&1;e+=1;const l=t.getUint8(e);e+=1;const d=t.getUint8(e);e+=1;const f=t.getUint16(e)&8191;e+=2;const y=t.getUint16(e)&4095;e+=2,n={pointer_field:o,table_id:r,section_length:h,transport_stream_id:c,version_number:g,current_next_indicator:p,section_number:l,last_section_number:d,pcr_pid:f,program_info_length:y}}const a=[];{const o=n.section_length-9-4,r=e+o;for(;e<r;){const h=t.getUint8(e),c=x(h),g=t.getUint16(e+1)&8191,p=t.getUint16(e+3)&4095;if(e+=5,g<32||g>8190){console.warn(`Invalid elementary_pid: 0x${g.toString(16)}`);continue}a.push({kind:c,stream_type:h,elementary_pid:g,es_info_length:p})}}const i=t.getUint32(e);this.pmt={header:n,streams:a,crc32:i},this.on.debug&&this.on.debug({pmt:this.pmt})};parseAdaptationField=(t,s)=>{let e=s,n,a,i,o;const r=t.getUint8(e),h=!!(r&128),c=!!(r&64),g=!!(r&32),p=!!(r&16),l=!!(r&8),d=!!(r&4),f=!!(r&2),y=!!(r&1);e+=1;const b=(U,m)=>{let _=BigInt(0);_|=BigInt(U.getUint16(m))<<25n,_|=BigInt(U.getUint16(m+1))<<17n,_|=BigInt(U.getUint16(m+2))<<9n,_|=BigInt(U.getUint16(m+3))<<1n,_|=BigInt(U.getUint16(m+4)>>7);const B=(U.getUint16(m+4)&1)<<8|U.getUint16(m+5);return _=_*300n+BigInt(B),_};if(p&&(n=b(t,e),e+=6),l&&(a=b(t,e),e+=6),d&&(i=t.getInt8(e),e+=1),f){const U=t.getUint8(e);e+=1,o=new Uint8Array(t.buffer,e,U),e+=U}return{discontinuity_indicator:h,random_access_indicator:c,elementary_stream_priority_indicator:g,pcr_flag:p,opcr_flag:l,splicing_point_flag:d,transport_private_data_flag:f,adaptation_field_extension_flag:y,pcr:n,opcr:a,splice_countdown:i,transport_private_data:o}};parseVideo=async t=>{const s=new DataView(t.buffer);let e=0,n,a;{const i=s.getUint8(e)===0&&s.getUint8(e+1)===0&&s.getUint8(e+2)===1;if(e+=3,!i)throw new Error("invalid ts video payload.");const o=s.getUint8(e);e+=1;const r=s.getUint8(e)<<8|s.getUint8(e+1);e+=2;let h,c;const g=o!==188&&o!==190&&o!==191&&o!==240&&o!==241&&o!==255&&o!==242;if(g){e+=1;const p=s.getUint8(e);e+=1;const l=p>>6,d=s.getUint8(e);e+=1,(l&2)===2&&(h=this.parsePtsDts(s,e),e+=5),(l&1)===1?(c=this.parsePtsDts(s,e),e+=5):c=h,e+=d-(e-9)}n={stream_id:o,pes_packet_length:r,pts:h,dts:c,optional_header_exist:g}}a=t.slice(e);{const i=this.getNalus(a);if(!this.videoConfig){let l,d;if(l=i.find(y=>y.type===7)?.nalu.slice(4),d=i.find(y=>y.type===8)?.nalu.slice(4),l&&d){const f=I(l,d),{codec:y}=T(f);this.videoConfig={kind:"video",codec:y,description:f,sps:l,pps:d},this.on.config&&this.on.config(this.videoConfig)}}const o=[];let r="delta";for(const l of i){const{type:d,nalu:f}=l;switch(d){case 6:case 9:o.push(f);break;case 1:r="delta",o.push(f);break;case 5:r="key",o.push(f);break}}const h=C(o),{dts:c=0,pts:g=0}=n,p=g-c;return{kind:"video",type:r,dts:c,pts:g,cts:p,data:h,nalus:o}}};parsePtsDts(t,s){const e=t.getUint8(s),n=t.getUint8(s+1),a=t.getUint8(s+2),i=t.getUint8(s+3),o=t.getUint8(s+4),r=(BigInt(e)&0b00001110n)<<29n|(BigInt(n)&0b11111111n)<<22n|(BigInt(a)&0b11111110n)<<14n|(BigInt(i)&0b11111111n)<<7n|(BigInt(o)&0b11111110n)>>1n;return Number(r)/90}getNalus=t=>{const s=[];let e=0;for(;!(e+4>t.byteLength);){if(t[e]!==0||t[e+1]!==0||t[e+2]!==1){e+=1;continue}e+=3;let n=e;const a=t[e]&31;for(e+=1;!(e+1>t.byteLength);){if(t[e]!==0||t[e+1]!==0||t[e+2]!==1){e+=1;continue}break}let i=e-n;if(t[e-1]===0&&(i-=1),i!==0){const o=t.slice(n,n+i),r=M(o);s.push({type:a,nalu:r})}}return s}}const k=(u,t)=>u.getUint8(t)<<16|u.getUint8(t+1)<<8|u.getUint8(t+2);class L{audioConfig;videoConfig;header;textDecoder=new TextDecoder("utf-8");on={};constructor(){}parse=async t=>{let s=0;for(this.header||(this.parseHeader(t,s),s+=9);this.isSurplusTag(t,s)!==!1;){const n=this.parseTagHeader(t,s+4),{tagType:a,dataSize:i,timestamp:o}=n;if(a){const r=this.parseTagBody(a,t,s+4+11,i);switch(a){case"script":this.on.info&&this.on.info(r);break;case"audio":{const{accPacketType:h}=r;if(h===0){const{codec:c,sampleRate:g,channelConfiguration:p}=r;this.audioConfig={kind:"audio",codec:c,sampleRate:g,numberOfChannels:p},this.on.config&&this.on.config(this.audioConfig)}else{const{cts:c,data:g}=r,p="key",l=c===void 0?void 0:c+o;this.on.chunk&&this.on.chunk({kind:"audio",type:p,dts:o,pts:l,cts:c,data:g})}}break;case"video":{const{avcPacketType:h}=r;if(h===0){const{codec:c,sps:g,pps:p,data:l}=r;this.videoConfig={kind:"video",codec:c,description:l,sps:g,pps:p},this.on.config&&this.on.config(this.videoConfig)}else{const{frameType:c,cts:g,data:p,nalus:l}=r,d=c===1?"key":"delta",f=g===void 0?void 0:g+o;this.on.chunk&&this.on.chunk({kind:"video",type:d,dts:o,pts:f,cts:g,data:p,nalus:l})}}break}s=s+4+11+i}await new Promise(r=>setTimeout(()=>r(!0),8))}return s};parseHeader=(t,s)=>{let e,n,a,i;e=t.getUint8(s)<<16|t.getUint8(s+1)<<8|t.getUint8(s+2),n=t.getUint8(3);{const r=t.getUint8(0).toString(2).padStart(5,"0").split(""),[,,h,,c]=r;a={audio:c==="1",video:h==="1"}}i=t.getUint32(5),this.header={signature:e,version:n,flags:a,dataOffset:i}};isSurplusTag=(t,s)=>{let e=!0;const n=t.byteLength;if(s+4>n)e=!1;else if(s+4+11>n)e=!1;else{const a=k(t,s+4+1);s+4+11+a>n&&(e=!1)}return e};parseTagHeader=(t,s)=>{let e,n,a,i,o;{const r=t.getUint8(s);let h;switch(r){case 18:h="script";break;case 8:h="audio";break;case 9:h="video";break}e=h}return n=k(t,s+1),a=k(t,s+4),i=t.getUint8(s+7),o=k(t,s+8),{tagType:e,dataSize:n,timestamp:a,timestampExtended:i,streamID:o}};parseTagBody=(t,s,e,n)=>{let a;switch(t){case"script":a=this.parseMetaData(s,e);break;case"audio":a=this.parseAudio(s,e,n);break;case"video":a=this.parseVideo(s,e,n);break}return a};parseMetaData=(t,s)=>{let e=s;{if(t.getUint8(e)!==2)throw new Error("Invalid AMF type for onMetaData (expected 0x02)");e=e+1}const n=t.getUint16(e,!1);e=e+2;{const o=new Int8Array(t.buffer.slice(e,e+n));if((this.textDecoder?.decode(o)||"")!=="onMetaData")throw new Error("Expected \'onMetaData\' string");e=e+n}const a=this.getAmfType(t,e);return e=e+1,this.getAMFValue(t,e,a).value};parseAudio=(t,s,e)=>{let n=s;const a=t.getUint8(n),i=a>>4&15,o=a>>2&3,r=a>>1&1,h=a&1;n=n+1;const c=t.getUint8(n);n=n+1;const g=e-2,p=new Uint8Array(t.buffer.slice(n,n+g));if(i===10&&c===0){const l=t.getUint8(n),d=t.getUint8(n+1),f=(l&248)>>3,y=(l&7)<<1|d>>7,b=(d&120)>>3,U=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],m=`mp4a.40.${f}`,_=U[y];return{soundFormat:i,soundRate:o,soundSize:r,soundType:h,accPacketType:c,data:p,audioObjectType:f,samplingFrequencyIndex:y,channelConfiguration:b,codec:m,sampleRate:_}}return{soundFormat:i,soundRate:o,soundSize:r,soundType:h,accPacketType:c,data:p}};parseVideo=(t,s,e)=>{let n=s;const a=t.getUint8(n),i=a>>4&15,o=a&15;n=n+1;const r=t.getUint8(n);n=n+1;const h=k(t,n);n=n+3;const c=e-5,g=new Uint8Array(t.buffer.slice(n,n+c));switch(o){case 7:if(r===0){const p=T(g);return{frameType:i,codecID:o,avcPacketType:r,cts:h,data:g,...p}}else if(r===1){const p=[],l=n+e-5;for(;!(n+4>l);){const d=t.getUint32(n,!1),f=new Uint8Array(t.buffer.slice(n,n+4+d));n+=4+d,p.push(f)}return{frameType:i,codecID:o,avcPacketType:r,cts:h,data:g,nalus:p}}break;default:throw new Error("Unsupported codecID")}return{frameType:i,codecID:o,avcPacketType:r,cts:h,data:g}};getAmfType=(t,s)=>t.getUint8(s);getAMFName=(t,s,e)=>{const n=new Uint8Array(t.buffer.slice(s,s+e));return this.textDecoder?.decode(n)||""};getAMFValue=(t,s,e)=>{let n=s,a,i=0;switch(e){case 0:a=t.getFloat64(n,!1),i=8;break;case 1:a=!!t.getUint8(n),i=1;break;case 2:{a="";const r=t.getUint16(n,!1);n=n+2;const h=new Int8Array(t.buffer,n,r).filter(g=>g!==0);a=(this.textDecoder?.decode(h)||"").trim(),i=2+r}break;case 3:for(a={};n<t.byteLength;){const r=t.getUint16(n,!1);if(r===0)break;n=n+2;const h=this.getAMFName(t,n,r);n=n+r;const c=this.getAmfType(t,n);if(c===6)break;n=n+1;const g=this.getAMFValue(t,n,c);n=n+g.length,a[h]=g.value,i=2+r+1+g.length}break;case 8:{a={};const r=t.getUint32(n,!1);n=n+4;for(let h=0;h<r;h++){const c=t.getUint16(n,!1);n=n+2;const g=this.getAMFName(t,n,c);n=n+c;const p=this.getAmfType(t,n);n=n+1;const l=this.getAMFValue(t,n,p);n=n+l.length,a[g]=l.value,i=2+c+1+l.length}}break;case 10:{a=[];const r=t.getUint32(n,!1);n=n+4;for(let h=0;h<r;h++){const c=this.getAmfType(t,n);n=n+1;const g=this.getAMFValue(t,n,c);n=n+g.length,a.push(g.value),i=1+g.length}}break}return{amfType:e,length:i,value:a}}}class S{pattern;cacher=new P;isParseing=!1;offset=0;on={};parser;constructor(){}init=t=>{switch(this.destroy(),this.pattern=t,this.pattern){case"flv":this.parser=new L;break;case"hls":this.parser=new D;break;default:throw new Error("is error pattern.")}this.parser.on.debug=s=>this.on.debug&&this.on.debug(s),this.parser.on.info=s=>this.on.info&&this.on.info(s),this.parser.on.config=s=>this.on.config&&this.on.config(s),this.parser.on.chunk=s=>{this.cacher.pushChunk(s),this.on.chunk&&this.on.chunk(s)}};push=t=>{this.cacher.push(t),this.isParseing===!1&&this.parse()};destroy=()=>{this.cacher.destroy(),this.isParseing=!1,this.offset=0};parse=async()=>{try{if(this.isParseing=!0,!this.pattern)throw new Error("You need to set the pattern.");if(!this.parser)throw new Error("You need to init parser.");for(;;){const t=this.cacher.next(this.offset);if(this.offset=0,!t)break;this.offset=await this.parser.parse(t)}this.isParseing=!1}catch{this.destroy()}}}const A=new S;A.on.debug=u=>postMessage({action:"onDebug",data:u}),A.on.info=u=>postMessage({action:"onInfo",data:u}),A.on.config=u=>postMessage({action:"onConfig",data:u}),A.on.chunk=u=>postMessage({action:"onChunk",data:u}),onmessage=u=>{const{action:t,data:s}=u.data,e=A[t];e&&e(s)}})();\n', T = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", D], { type: "text/javascript;charset=utf-8" });
|
|
9
|
+
function L(h) {
|
|
10
10
|
let o;
|
|
11
11
|
try {
|
|
12
|
-
if (o =
|
|
13
|
-
const
|
|
14
|
-
name:
|
|
12
|
+
if (o = T && (self.URL || self.webkitURL).createObjectURL(T), !o) throw "";
|
|
13
|
+
const a = new Worker(o, {
|
|
14
|
+
name: h == null ? void 0 : h.name
|
|
15
15
|
});
|
|
16
|
-
return
|
|
16
|
+
return a.addEventListener("error", () => {
|
|
17
17
|
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
18
|
-
}),
|
|
18
|
+
}), a;
|
|
19
19
|
} catch {
|
|
20
20
|
return new Worker(
|
|
21
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
21
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(D),
|
|
22
22
|
{
|
|
23
|
-
name:
|
|
23
|
+
name: h == null ? void 0 : h.name
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
class
|
|
28
|
+
class B {
|
|
29
29
|
constructor() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
m(this, "worker", new L());
|
|
31
|
+
m(this, "on", {});
|
|
32
|
+
m(this, "init", (o) => this.worker.postMessage({ action: "init", data: o }));
|
|
33
|
+
m(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
|
|
34
|
+
m(this, "destroy", () => {
|
|
35
35
|
this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
|
|
36
36
|
});
|
|
37
37
|
this.worker.onmessage = (o) => {
|
|
38
|
-
const { action:
|
|
39
|
-
|
|
38
|
+
const { action: a, data: u } = o.data;
|
|
39
|
+
switch (a) {
|
|
40
|
+
case "onInfo":
|
|
41
|
+
this.on.info && this.on.info(u);
|
|
42
|
+
break;
|
|
43
|
+
case "onConfig":
|
|
44
|
+
this.on.config && this.on.config(u);
|
|
45
|
+
break;
|
|
46
|
+
case "onDebug":
|
|
47
|
+
this.on.debug && this.on.debug(u);
|
|
48
|
+
break;
|
|
49
|
+
case "onChunk":
|
|
50
|
+
this.on.chunk && this.on.chunk(u);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
40
53
|
};
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
|
-
const
|
|
44
|
-
`,
|
|
45
|
-
function
|
|
56
|
+
const M = `(function(){"use strict";class r{audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;on={audio:{},video:{}};constructor(){}audio={init:i=>{this.audio.destroy(),this.audioDecoderConfig={...i},this.audioDecoder=new AudioDecoder({output:e=>{this.on.audio.decode&&this.on.audio.decode(e)},error:e=>{this.on.audio.error&&this.on.audio.error(e)}}),this.audioDecoder.configure(this.audioDecoderConfig)},decode:i=>{if(!this.audioDecoder)return;const e=new EncodedAudioChunk(i);this.audioDecoder.decode(e)},flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={init:i=>{this.video.destroy(),this.videoDecoderConfig={...i},this.videoDecoder=new VideoDecoder({output:async e=>{const d=await createImageBitmap(e),s=e.timestamp;e.close(),d.width>0&&d.height>0?this.on.video.decode&&this.on.video.decode({timestamp:s,bitmap:d}):d.close()},error:e=>{console.log("\\x1B[38;2;0;151;255m%c%s\\x1B[0m","color:#0097ff;","------->Breathe: e",e),this.on.video.error&&this.on.video.error(e)}}),this.videoDecoder.configure(this.videoDecoderConfig)},decode:i=>{if(this.videoDecoder&&(i.type==="key"&&(this.hasKeyFrame=!0),this.hasKeyFrame&&this.videoDecoder.decodeQueueSize<2)){const e=new EncodedVideoChunk(i);this.videoDecoder.decode(e)}},flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}}const t=new r;t.on.audio.decode=o=>postMessage({type:"audio",action:"onDecode",data:o}),t.on.audio.error=o=>postMessage({type:"audio",action:"onError",data:o}),t.on.video.decode=o=>postMessage({type:"video",action:"onDecode",data:o}),t.on.video.error=o=>postMessage({type:"video",action:"onError",data:o}),onmessage=o=>{const{type:i,action:e,data:d}=o.data,s=t[i][e];s&&s(d)}})();
|
|
57
|
+
`, v = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", M], { type: "text/javascript;charset=utf-8" });
|
|
58
|
+
function F(h) {
|
|
46
59
|
let o;
|
|
47
60
|
try {
|
|
48
|
-
if (o =
|
|
49
|
-
const
|
|
50
|
-
name:
|
|
61
|
+
if (o = v && (self.URL || self.webkitURL).createObjectURL(v), !o) throw "";
|
|
62
|
+
const a = new Worker(o, {
|
|
63
|
+
name: h == null ? void 0 : h.name
|
|
51
64
|
});
|
|
52
|
-
return
|
|
65
|
+
return a.addEventListener("error", () => {
|
|
53
66
|
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
54
|
-
}),
|
|
67
|
+
}), a;
|
|
55
68
|
} catch {
|
|
56
69
|
return new Worker(
|
|
57
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
70
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(M),
|
|
58
71
|
{
|
|
59
|
-
name:
|
|
72
|
+
name: h == null ? void 0 : h.name
|
|
60
73
|
}
|
|
61
74
|
);
|
|
62
75
|
}
|
|
63
76
|
}
|
|
64
|
-
class
|
|
77
|
+
class N {
|
|
65
78
|
constructor() {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
79
|
+
m(this, "worker", new F());
|
|
80
|
+
m(this, "on", { audio: {}, video: {} });
|
|
81
|
+
m(this, "audio", {
|
|
69
82
|
init: (o) => this.worker.postMessage({ type: "audio", action: "init", data: o }),
|
|
70
83
|
decode: (o) => this.worker.postMessage({ type: "audio", action: "decode", data: o }),
|
|
71
84
|
flush: () => this.worker.postMessage({ type: "audio", action: "flush" }),
|
|
@@ -73,7 +86,7 @@ class j {
|
|
|
73
86
|
this.worker.postMessage({ type: "audio", action: "destroy" });
|
|
74
87
|
}
|
|
75
88
|
});
|
|
76
|
-
|
|
89
|
+
m(this, "video", {
|
|
77
90
|
init: (o) => this.worker.postMessage({ type: "video", action: "init", data: o }),
|
|
78
91
|
decode: (o) => this.worker.postMessage({ type: "video", action: "decode", data: o }),
|
|
79
92
|
flush: () => this.worker.postMessage({ type: "video", action: "flush" }),
|
|
@@ -81,122 +94,87 @@ class j {
|
|
|
81
94
|
this.worker.postMessage({ type: "video", action: "destroy", data: {} });
|
|
82
95
|
}
|
|
83
96
|
});
|
|
84
|
-
|
|
97
|
+
m(this, "destroy", () => {
|
|
85
98
|
this.worker.postMessage({ type: "audio", action: "destroy" }), this.worker.postMessage({ type: "video", action: "destroy", data: {} }), this.worker.terminate();
|
|
86
99
|
});
|
|
87
100
|
this.worker.onmessage = (o) => {
|
|
88
|
-
const { type:
|
|
89
|
-
switch (
|
|
101
|
+
const { type: a, action: u, data: n } = o.data;
|
|
102
|
+
switch (a) {
|
|
90
103
|
case "audio":
|
|
91
|
-
|
|
104
|
+
u === "onDecode" && this.on.audio.decode && this.on.audio.decode(n), u === "onError" && this.on.audio.error && this.on.audio.error(n);
|
|
92
105
|
break;
|
|
93
106
|
case "video":
|
|
94
|
-
|
|
107
|
+
u === "onDecode" && this.on.video.decode && this.on.video.decode(n), u === "onError" && this.on.video.error && this.on.video.error(n);
|
|
95
108
|
break;
|
|
96
109
|
}
|
|
97
110
|
};
|
|
98
111
|
}
|
|
99
112
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
try {
|
|
105
|
-
if (o = M && (self.URL || self.webkitURL).createObjectURL(M), !o) throw "";
|
|
106
|
-
const u = new Worker(o, {
|
|
107
|
-
name: f == null ? void 0 : f.name
|
|
108
|
-
});
|
|
109
|
-
return u.addEventListener("error", () => {
|
|
110
|
-
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
111
|
-
}), u;
|
|
112
|
-
} catch {
|
|
113
|
-
return new Worker(
|
|
114
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(F),
|
|
113
|
+
var E = Object.defineProperty, G = (h, o, a) => o in h ? E(h, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : h[o] = a, f = (h, o, a) => G(h, typeof o != "symbol" ? o + "" : o, a);
|
|
114
|
+
class O {
|
|
115
|
+
constructor(o, a) {
|
|
116
|
+
f(this, "inputStream", new MediaStream()), f(this, "outputStream", new MediaStream()), f(this, "inputGain", 1), f(this, "enhanceGain", 1), f(this, "bgsGain", 1), f(this, "bgmGain", 1), f(this, "outputGain", 1), f(this, "mixAudioMap", /* @__PURE__ */ new Map()), f(this, "audioContext", new AudioContext()), f(this, "sourceNode"), f(this, "inputGainNode"), f(this, "enhanceGainNode"), f(this, "bgsGainNode"), f(this, "bgmGainNode"), f(this, "analyserNode"), f(this, "analyserArrayData"), f(this, "outputGainNode"), f(this, "destinationNode"), f(this, "filterStream", (u) => u), f(this, "stop", () => {
|
|
115
117
|
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
class $ {
|
|
122
|
-
constructor() {
|
|
123
|
-
v(this, "worker", new H());
|
|
124
|
-
v(this, "init", ({ offscreenCanvas: o, baseTime: u = 0, writable: c }) => this.worker.postMessage({ action: "init", data: { offscreenCanvas: o, baseTime: u, writable: c } }, [o, c]));
|
|
125
|
-
v(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
|
|
126
|
-
v(this, "setSize", ({ width: o, height: u }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: u } }));
|
|
127
|
-
v(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
|
|
128
|
-
v(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
|
|
129
|
-
v(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
|
|
130
|
-
v(this, "destroy", () => {
|
|
131
|
-
this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
var q = Object.defineProperty, K = (f, o, u) => o in f ? q(f, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : f[o] = u, h = (f, o, u) => K(f, typeof o != "symbol" ? o + "" : o, u);
|
|
136
|
-
class Q {
|
|
137
|
-
constructor(o, u) {
|
|
138
|
-
h(this, "inputStream", new MediaStream()), h(this, "outputStream", new MediaStream()), h(this, "inputGain", 1), h(this, "enhanceGain", 1), h(this, "bgsGain", 1), h(this, "bgmGain", 1), h(this, "outputGain", 1), h(this, "mixAudioMap", /* @__PURE__ */ new Map()), h(this, "audioContext", new AudioContext()), h(this, "sourceNode"), h(this, "inputGainNode"), h(this, "enhanceGainNode"), h(this, "bgsGainNode"), h(this, "bgmGainNode"), h(this, "analyserNode"), h(this, "analyserArrayData"), h(this, "outputGainNode"), h(this, "destinationNode"), h(this, "filterStream", (c) => c), h(this, "stop", () => {
|
|
139
|
-
{
|
|
140
|
-
const c = this.inputStream.getTracks();
|
|
141
|
-
for (const r of c)
|
|
142
|
-
r.stop(), this.inputStream.removeTrack(r);
|
|
118
|
+
const u = this.inputStream.getTracks();
|
|
119
|
+
for (const n of u)
|
|
120
|
+
n.stop(), this.inputStream.removeTrack(n);
|
|
143
121
|
}
|
|
144
|
-
}),
|
|
145
|
-
|
|
146
|
-
}),
|
|
147
|
-
this.inputGain =
|
|
148
|
-
}),
|
|
149
|
-
this.enhanceGain =
|
|
150
|
-
}),
|
|
151
|
-
this.bgsGain =
|
|
152
|
-
}),
|
|
153
|
-
this.bgmGain =
|
|
154
|
-
}),
|
|
155
|
-
this.outputGain =
|
|
156
|
-
}),
|
|
157
|
-
const { analyserNode:
|
|
158
|
-
|
|
159
|
-
let
|
|
160
|
-
for (let i = 0; i <
|
|
161
|
-
|
|
162
|
-
return Math.ceil(
|
|
163
|
-
}),
|
|
122
|
+
}), f(this, "getStream", () => this.filterStream(this.outputStream)), f(this, "setMute", (u = !0) => {
|
|
123
|
+
u ? this.analyserNode.disconnect(this.outputGainNode) : this.analyserNode.connect(this.outputGainNode);
|
|
124
|
+
}), f(this, "setInputGain", (u) => {
|
|
125
|
+
this.inputGain = u, this.inputGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
|
|
126
|
+
}), f(this, "setEnhanceGain", async (u) => {
|
|
127
|
+
this.enhanceGain = u + 1, this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime);
|
|
128
|
+
}), f(this, "setBgsGain", (u) => {
|
|
129
|
+
this.bgsGain = u, this.bgsGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
|
|
130
|
+
}), f(this, "setBgmGain", (u) => {
|
|
131
|
+
this.bgmGain = u, this.bgmGainNode.gain.setValueAtTime(u, this.audioContext.currentTime);
|
|
132
|
+
}), f(this, "setOutputGain", (u) => {
|
|
133
|
+
this.outputGain = u, this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime);
|
|
134
|
+
}), f(this, "getVolume", () => {
|
|
135
|
+
const { analyserNode: u, analyserArrayData: n } = this;
|
|
136
|
+
u.getByteFrequencyData(n);
|
|
137
|
+
let r = 0;
|
|
138
|
+
for (let i = 0; i < n.length; i++)
|
|
139
|
+
r += n[i];
|
|
140
|
+
return Math.ceil(r / n.length);
|
|
141
|
+
}), f(this, "mixAudio", (u, n = "bgm") => new Promise(async (r, i) => {
|
|
164
142
|
try {
|
|
165
143
|
{
|
|
166
|
-
const s = this.mixAudioMap.get(
|
|
144
|
+
const s = this.mixAudioMap.get(n);
|
|
167
145
|
s && s.stop();
|
|
168
146
|
}
|
|
169
|
-
const
|
|
170
|
-
this.mixAudioMap.set(
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
} catch (
|
|
174
|
-
i(
|
|
147
|
+
const t = n === "bgs" ? this.bgsGainNode : this.bgmGainNode, e = this.audioContext.createBufferSource();
|
|
148
|
+
this.mixAudioMap.set(n, e), e.buffer = u, e.connect(t), e.onended = () => {
|
|
149
|
+
e.disconnect(t), this.mixAudioMap.delete(n), r(!0);
|
|
150
|
+
}, e.start(0);
|
|
151
|
+
} catch (t) {
|
|
152
|
+
i(t);
|
|
175
153
|
}
|
|
176
|
-
})),
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
}),
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
}),
|
|
154
|
+
})), f(this, "mixAudioStop", (u) => {
|
|
155
|
+
const n = this.mixAudioMap.get(u);
|
|
156
|
+
n == null || n.stop();
|
|
157
|
+
}), f(this, "changeMix", (u, n) => {
|
|
158
|
+
const r = u === "bgs" ? this.bgsGainNode : this.bgmGainNode;
|
|
159
|
+
n ? r.connect(this.destinationNode) : r.disconnect(this.destinationNode);
|
|
160
|
+
}), a && (this.audioContext = a), this.inputStream = o, this.sourceNode = this.audioContext.createMediaStreamSource(this.inputStream), this.inputGainNode = this.audioContext.createGain(), this.inputGainNode.gain.setValueAtTime(this.inputGain, this.audioContext.currentTime), this.enhanceGainNode = this.audioContext.createGain(), this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime), this.bgsGainNode = this.audioContext.createGain(), this.bgsGainNode.gain.setValueAtTime(this.bgsGain, this.audioContext.currentTime), this.bgmGainNode = this.audioContext.createGain(), this.bgmGainNode.gain.setValueAtTime(this.bgmGain, this.audioContext.currentTime), this.analyserNode = this.audioContext.createAnalyser(), this.analyserNode.fftSize = 512, this.analyserArrayData = new Uint8Array(this.analyserNode.frequencyBinCount), this.outputGainNode = this.audioContext.createGain(), this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime), this.destinationNode = this.audioContext.createMediaStreamDestination(), this.outputStream = this.destinationNode.stream;
|
|
183
161
|
{
|
|
184
|
-
const { sourceNode:
|
|
185
|
-
|
|
162
|
+
const { sourceNode: u, inputGainNode: n, enhanceGainNode: r, bgsGainNode: i, bgmGainNode: t, analyserNode: e, outputGainNode: s, destinationNode: l } = this;
|
|
163
|
+
u.connect(n), n.connect(r), r.connect(e), i.connect(e), t.connect(e), r.connect(l), i.connect(l), t.connect(l), e.connect(s), s.connect(this.audioContext.destination);
|
|
186
164
|
}
|
|
187
165
|
this.setMute(!0), this.audioContext.resume();
|
|
188
166
|
}
|
|
189
167
|
}
|
|
190
|
-
const
|
|
168
|
+
const W = async (h, o) => {
|
|
191
169
|
try {
|
|
192
|
-
const { format:
|
|
193
|
-
for (let
|
|
194
|
-
const
|
|
195
|
-
o.copyTo(s, { planeIndex:
|
|
196
|
-
const l = new DataView(s.buffer),
|
|
197
|
-
for (let d = 0; d <
|
|
170
|
+
const { format: a, numberOfChannels: u, numberOfFrames: n, sampleRate: r } = o, i = h.createBuffer(u, n, r);
|
|
171
|
+
for (let t = 0; t < u; t++) {
|
|
172
|
+
const e = o.allocationSize({ planeIndex: t }), s = new Uint8Array(e);
|
|
173
|
+
o.copyTo(s, { planeIndex: t });
|
|
174
|
+
const l = new DataView(s.buffer), c = i.getChannelData(t);
|
|
175
|
+
for (let d = 0; d < n; d++) {
|
|
198
176
|
let y;
|
|
199
|
-
switch (
|
|
177
|
+
switch (a) {
|
|
200
178
|
case "s16":
|
|
201
179
|
// 16-bit signed PCM (范围: -32768 ~ 32767)
|
|
202
180
|
case "s16-planar":
|
|
@@ -213,28 +191,28 @@ const J = async (f, o) => {
|
|
|
213
191
|
y = (l.getUint8(d) - 128) / 128;
|
|
214
192
|
break;
|
|
215
193
|
default:
|
|
216
|
-
throw new Error(`Unsupported audio format: ${
|
|
194
|
+
throw new Error(`Unsupported audio format: ${a}`);
|
|
217
195
|
}
|
|
218
|
-
|
|
196
|
+
c[d] = Math.max(-1, Math.min(1, y));
|
|
219
197
|
}
|
|
220
198
|
}
|
|
221
199
|
return i;
|
|
222
|
-
} catch (
|
|
223
|
-
throw console.error("Failed to convert AudioData to AudioBuffer:",
|
|
200
|
+
} catch (a) {
|
|
201
|
+
throw console.error("Failed to convert AudioData to AudioBuffer:", a), a;
|
|
224
202
|
}
|
|
225
203
|
};
|
|
226
|
-
class
|
|
204
|
+
class V {
|
|
227
205
|
constructor() {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
o || (o = new (window.AudioContext || window.webkitAudioContext)()), this.audioContext = o, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new
|
|
206
|
+
m(this, "prAudioStream");
|
|
207
|
+
m(this, "audioContext");
|
|
208
|
+
m(this, "destination");
|
|
209
|
+
m(this, "stream", new MediaStream());
|
|
210
|
+
m(this, "nextStartTime", 0);
|
|
211
|
+
m(this, "pendingSources", []);
|
|
212
|
+
m(this, "init", (o) => {
|
|
213
|
+
o || (o = new (window.AudioContext || window.webkitAudioContext)()), this.audioContext = o, this.destination = this.audioContext.createMediaStreamDestination(), this.stream = new MediaStream(), this.stream.addTrack(this.destination.stream.getAudioTracks()[0]), this.prAudioStream = new O(this.stream, this.audioContext), this.nextStartTime = 0, this.pendingSources = [];
|
|
236
214
|
});
|
|
237
|
-
|
|
215
|
+
m(this, "getStream", () => {
|
|
238
216
|
var o;
|
|
239
217
|
return (o = this.prAudioStream) == null ? void 0 : o.getStream();
|
|
240
218
|
});
|
|
@@ -242,206 +220,367 @@ class X {
|
|
|
242
220
|
async push(o) {
|
|
243
221
|
try {
|
|
244
222
|
if (!this.audioContext || !this.destination) return;
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
this.nextStartTime =
|
|
251
|
-
this.pendingSources = this.pendingSources.filter((
|
|
223
|
+
const a = await W(this.audioContext, o);
|
|
224
|
+
if (!a) return;
|
|
225
|
+
const u = this.audioContext.createBufferSource();
|
|
226
|
+
u.buffer = a, u.connect(this.destination);
|
|
227
|
+
const n = Math.max(this.nextStartTime, this.audioContext.currentTime);
|
|
228
|
+
this.nextStartTime = n + a.duration, u.start(n), this.pendingSources.push(u), u.onended = () => {
|
|
229
|
+
this.pendingSources = this.pendingSources.filter((r) => r !== u);
|
|
252
230
|
}, this.audioContext.state === "suspended" && await this.audioContext.resume();
|
|
253
231
|
} finally {
|
|
254
232
|
o.close();
|
|
255
233
|
}
|
|
256
234
|
}
|
|
257
235
|
destroy() {
|
|
258
|
-
var o,
|
|
259
|
-
(o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (
|
|
236
|
+
var o, a;
|
|
237
|
+
(o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (a = this.prAudioStream) == null || a.stop(), this.pendingSources.forEach((u) => u.stop()), this.pendingSources = [];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
const S = `(function(){"use strict";class r{isRendering=!1;pendingFrames=[];offscreenCanvas;writable;writer;ctx;cutOption;baseTime=0;pause=!1;shader=["stream"];constructor(){}init=({offscreenCanvas:e,writable:t})=>{this.destroy(),this.offscreenCanvas=e,this.writable=t,this.writer=this.writable.getWriter(),this.ctx=this.offscreenCanvas.getContext("2d")};setBaseTime=e=>{this.baseTime=e};setShader=e=>{this.shader=e};setSize=({width:e,height:t})=>{this.offscreenCanvas&&(this.offscreenCanvas.width=e,this.offscreenCanvas.height=t)};destroy=()=>{this.isRendering=!1,this.pendingFrames=[],this.offscreenCanvas=void 0,this.ctx=void 0,this.baseTime=0};push=e=>{this.pendingFrames.push(e),this.isRendering===!1&&setTimeout(this.renderFrame,0)};setCut=e=>{this.cutOption=e};setPause=e=>{this.pause=e,this.isRendering===!1&&setTimeout(this.renderFrame,0)};calculateTimeUntilNextFrame=e=>{const t=performance.timeOrigin+performance.now(),i=this.baseTime+e/1e3-t;return Math.max(0,i)};renderFrame=async()=>{for(this.isRendering=!0;;){const e=this.pendingFrames.shift();if(!e)break;let{timestamp:t,bitmap:s}=e;if(this.cutOption){const{sx:a=0,sy:c=0,sw:m=s.width,sh:o=s.height}=this.cutOption;s=await createImageBitmap(s,a,c,m,o)}const i=this.calculateTimeUntilNextFrame(t);await new Promise(a=>setTimeout(()=>a(!0),i)),this.drawImage({timestamp:t,bitmap:s}),this.cutOption&&s.close()}this.isRendering=!1};drawImage=e=>{if(this.pause!==!0){if(this.shader.includes("stream")){const t=new VideoFrame(e.bitmap,{timestamp:e.timestamp});this.writer.write(t),t.close()}this.shader.includes("canvas")&&this.ctx&&this.offscreenCanvas&&this.ctx.drawImage(e.bitmap,0,0,this.offscreenCanvas.width,this.offscreenCanvas.height)}}}const h=new r;onmessage=n=>{const{action:e,data:t}=n.data,s=h[e];s&&s(t)}})();
|
|
241
|
+
`, x = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", S], { type: "text/javascript;charset=utf-8" });
|
|
242
|
+
function z(h) {
|
|
243
|
+
let o;
|
|
244
|
+
try {
|
|
245
|
+
if (o = x && (self.URL || self.webkitURL).createObjectURL(x), !o) throw "";
|
|
246
|
+
const a = new Worker(o, {
|
|
247
|
+
name: h == null ? void 0 : h.name
|
|
248
|
+
});
|
|
249
|
+
return a.addEventListener("error", () => {
|
|
250
|
+
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
251
|
+
}), a;
|
|
252
|
+
} catch {
|
|
253
|
+
return new Worker(
|
|
254
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(S),
|
|
255
|
+
{
|
|
256
|
+
name: h == null ? void 0 : h.name
|
|
257
|
+
}
|
|
258
|
+
);
|
|
260
259
|
}
|
|
261
260
|
}
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
class j {
|
|
262
|
+
constructor() {
|
|
263
|
+
m(this, "worker", new z());
|
|
264
|
+
m(this, "init", ({ offscreenCanvas: o, writable: a }) => this.worker.postMessage({ action: "init", data: { offscreenCanvas: o, writable: a } }, [o, a]));
|
|
265
|
+
m(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
|
|
266
|
+
m(this, "setBaseTime", (o) => this.worker.postMessage({ action: "setBaseTime", data: o }));
|
|
267
|
+
m(this, "setSize", ({ width: o, height: a }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: a } }));
|
|
268
|
+
m(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
|
|
269
|
+
m(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
|
|
270
|
+
m(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
|
|
271
|
+
m(this, "destroy", () => {
|
|
272
|
+
this.worker.postMessage({ action: "destroy", data: {} }), this.worker.terminate();
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const $ = (h) => {
|
|
277
|
+
const o = h.toLowerCase();
|
|
278
|
+
return o.includes(".m3u8") || o.includes("hls") || o.includes("master.m3u8") || o.match(/index\d*\.m3u8/) ? "hls" : o.includes(".mpd") || o.includes("dash") ? "dash" : o.startsWith("rtmp://") || o.startsWith("rtmps://") ? "rtmp" : o.includes(".flv") || o.includes("flv") && !o.includes("flash") ? "flv" : "unknown";
|
|
279
|
+
}, P = (h) => {
|
|
280
|
+
const o = (h == null ? void 0 : h.getTracks()) || [];
|
|
281
|
+
for (const a of o)
|
|
282
|
+
a.stop();
|
|
283
|
+
}, A = () => {
|
|
284
|
+
const h = new j(), o = document.createElement("canvas"), a = o.transferControlToOffscreen(), u = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([u]), r = () => {
|
|
285
|
+
h.destroy(), P(n);
|
|
286
|
+
};
|
|
287
|
+
return h.init({ offscreenCanvas: a, writable: u.writable }), { worker: h, canvas: o, stream: n, destroy: r };
|
|
288
|
+
};
|
|
289
|
+
class H {
|
|
290
|
+
constructor() {
|
|
291
|
+
m(this, "resolvesMap", /* @__PURE__ */ new Map());
|
|
292
|
+
m(this, "index", 0);
|
|
293
|
+
/**
|
|
294
|
+
*
|
|
295
|
+
* @param eventKey 唯一key
|
|
296
|
+
* @param checkFun 检测函数
|
|
297
|
+
* @param timeout 超时时间 ms
|
|
298
|
+
* @returns
|
|
299
|
+
*/
|
|
300
|
+
m(this, "add", (o, a = () => !1, u = 0) => new Promise((n) => {
|
|
301
|
+
var t, e;
|
|
302
|
+
if (a()) return n(!0);
|
|
303
|
+
this.resolvesMap.has(o) || this.resolvesMap.set(o, /* @__PURE__ */ new Map()), this.index++;
|
|
304
|
+
const r = `${this.index}`;
|
|
305
|
+
if (u = Math.max(0, u), u === 0) {
|
|
306
|
+
(t = this.resolvesMap.get(o)) == null || t.set(r, { resolve: n, timer: 0 });
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const i = window.setTimeout(() => {
|
|
310
|
+
this.emit(o);
|
|
311
|
+
}, u);
|
|
312
|
+
(e = this.resolvesMap.get(o)) == null || e.set(r, { resolve: n, timer: i });
|
|
313
|
+
}));
|
|
314
|
+
m(this, "emit", async (o) => {
|
|
315
|
+
const a = this.resolvesMap.get(o);
|
|
316
|
+
if (!a) return;
|
|
317
|
+
const u = [...a.keys()];
|
|
318
|
+
for (const n of u) {
|
|
319
|
+
const r = a.get(n);
|
|
320
|
+
r && (clearTimeout(r.timer), r.resolve(), a.delete(n));
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const Y = (h) => {
|
|
326
|
+
const o = new DataView(h.buffer);
|
|
327
|
+
let a = 0, u, n, r;
|
|
328
|
+
u = o.getUint32(a, !1), a += 4;
|
|
329
|
+
{
|
|
330
|
+
const i = o.getUint8(a), t = i >> 7 & 1, e = i >> 5 & 3, s = i & 31;
|
|
331
|
+
n = { forbidden_zero_bit: t, nal_ref_idc: e, nal_unit_type: s }, a += 1;
|
|
332
|
+
}
|
|
333
|
+
{
|
|
334
|
+
const i = u - 1;
|
|
335
|
+
r = new Uint8Array(o.buffer.slice(a, a + i));
|
|
336
|
+
}
|
|
337
|
+
return { size: u, header: n, data: r };
|
|
338
|
+
};
|
|
339
|
+
var q, I;
|
|
340
|
+
class C {
|
|
264
341
|
constructor(o = {}) {
|
|
265
|
-
|
|
266
|
-
timeout: 5 * 1e3
|
|
342
|
+
J(this, q, {
|
|
343
|
+
timeout: 5 * 1e3,
|
|
344
|
+
check: !1
|
|
267
345
|
});
|
|
268
|
-
|
|
346
|
+
J(this, I);
|
|
269
347
|
/**
|
|
270
348
|
*
|
|
271
349
|
* @param input string | URL | Request
|
|
272
350
|
* @param init RequestInit
|
|
273
351
|
*/
|
|
274
|
-
|
|
352
|
+
m(this, "check", (o, a) => new Promise(async (u, n) => {
|
|
275
353
|
var i;
|
|
276
|
-
this.stop(),
|
|
277
|
-
const
|
|
278
|
-
var
|
|
279
|
-
(
|
|
280
|
-
},
|
|
354
|
+
this.stop(), K(this, I, new AbortController());
|
|
355
|
+
const r = window.setTimeout(() => {
|
|
356
|
+
var t;
|
|
357
|
+
(t = U(this, I)) == null || t.abort("Timeout."), n({ status: "timeout", reason: "" });
|
|
358
|
+
}, U(this, q).timeout);
|
|
281
359
|
try {
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
} catch (
|
|
285
|
-
|
|
360
|
+
const t = await fetch(o, { ...a, method: "HEAD", signal: (i = U(this, I)) == null ? void 0 : i.signal });
|
|
361
|
+
t.status === 200 ? u({ status: "successed", reason: "" }) : n({ status: "failed", reason: `${t.status}` });
|
|
362
|
+
} catch (t) {
|
|
363
|
+
n({ status: "error", reason: t.message });
|
|
286
364
|
}
|
|
287
|
-
clearTimeout(
|
|
365
|
+
clearTimeout(r);
|
|
288
366
|
}));
|
|
289
367
|
/**
|
|
290
368
|
*
|
|
291
369
|
* @param input string | URL | Request
|
|
292
370
|
* @param init RequestInit
|
|
293
371
|
*/
|
|
294
|
-
|
|
295
|
-
var
|
|
372
|
+
m(this, "request", async (o, a) => new Promise(async (u, n) => {
|
|
373
|
+
var r;
|
|
296
374
|
try {
|
|
297
|
-
await this.check(o,
|
|
298
|
-
const i = await fetch(o, { ...
|
|
299
|
-
|
|
375
|
+
U(this, q).check && await this.check(o, a), K(this, I, new AbortController());
|
|
376
|
+
const i = await fetch(o, { ...a, signal: (r = U(this, I)) == null ? void 0 : r.signal });
|
|
377
|
+
u(i);
|
|
300
378
|
} catch (i) {
|
|
301
|
-
this.stop(),
|
|
379
|
+
this.stop(), n(i);
|
|
302
380
|
}
|
|
303
381
|
}));
|
|
304
382
|
/**
|
|
305
383
|
* stop
|
|
306
384
|
*/
|
|
307
|
-
|
|
385
|
+
m(this, "stop", () => {
|
|
308
386
|
var o;
|
|
309
|
-
((o =
|
|
387
|
+
((o = U(this, I)) == null ? void 0 : o.signal.aborted) === !1 && U(this, I).abort("Actively stop.");
|
|
310
388
|
});
|
|
311
|
-
|
|
389
|
+
K(this, q, { ...U(this, q), ...o });
|
|
312
390
|
}
|
|
313
391
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
const o = (f == null ? void 0 : f.getTracks()) || [];
|
|
317
|
-
for (const u of o)
|
|
318
|
-
u.stop();
|
|
319
|
-
}, G = (f) => {
|
|
320
|
-
const o = new $(), u = document.createElement("canvas"), c = u.transferControlToOffscreen(), r = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([r]), i = () => {
|
|
321
|
-
o.destroy(), O(n);
|
|
322
|
-
};
|
|
323
|
-
return o.init({ offscreenCanvas: c, baseTime: f, writable: r.writable }), { worker: o, canvas: u, stream: n, destroy: i };
|
|
324
|
-
};
|
|
325
|
-
class be {
|
|
392
|
+
q = new WeakMap(), I = new WeakMap();
|
|
393
|
+
class et {
|
|
326
394
|
constructor() {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
395
|
+
m(this, "prFetch", new C());
|
|
396
|
+
m(this, "prResolves", new H());
|
|
397
|
+
m(this, "url", "");
|
|
398
|
+
m(this, "demuxerWorker");
|
|
399
|
+
m(this, "decoderWorker");
|
|
400
|
+
m(this, "audioPlayer");
|
|
401
|
+
m(this, "renderWorker");
|
|
402
|
+
m(this, "renderBaseTime");
|
|
403
|
+
m(this, "stream");
|
|
404
|
+
m(this, "canvas");
|
|
405
|
+
m(this, "on", { demuxer: {}, decoder: {} });
|
|
406
|
+
m(this, "cutRenders", /* @__PURE__ */ new Map());
|
|
337
407
|
// @ts-ignore
|
|
338
|
-
|
|
408
|
+
m(this, "trackGenerator");
|
|
339
409
|
/**
|
|
340
410
|
* 初始化
|
|
341
411
|
*/
|
|
342
|
-
|
|
343
|
-
this.
|
|
412
|
+
m(this, "init", () => {
|
|
413
|
+
this.initDecoder(), this.audioPlayer = new V(), this.audioPlayer.init(), this.initRender();
|
|
344
414
|
});
|
|
345
415
|
/**
|
|
346
416
|
* 开始播放
|
|
347
417
|
* @param url : string
|
|
348
418
|
*/
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
}).catch((u) => {
|
|
363
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: err", u);
|
|
364
|
-
})));
|
|
419
|
+
m(this, "start", async (o) => {
|
|
420
|
+
this.stop(), this.url = o, this.init();
|
|
421
|
+
const a = $(o);
|
|
422
|
+
if (a === "unknown") throw new Error("This address cannot be parsed.");
|
|
423
|
+
switch (this.initDemuxer(a), a) {
|
|
424
|
+
case "flv":
|
|
425
|
+
this.flv.start();
|
|
426
|
+
break;
|
|
427
|
+
case "hls":
|
|
428
|
+
this.hls.start();
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
365
432
|
/**
|
|
366
433
|
* 停止
|
|
367
434
|
*/
|
|
368
|
-
|
|
369
|
-
var u,
|
|
435
|
+
m(this, "stop", async () => {
|
|
436
|
+
var a, u, n, r;
|
|
370
437
|
try {
|
|
371
|
-
this.prFetch.stop();
|
|
438
|
+
clearInterval(this.hls.getSegmentsTimer), this.prFetch.stop();
|
|
372
439
|
} catch (i) {
|
|
373
440
|
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", i);
|
|
374
441
|
}
|
|
375
|
-
(
|
|
442
|
+
(a = this.demuxerWorker) == null || a.destroy(), (u = this.decoderWorker) == null || u.destroy(), (n = this.renderWorker) == null || n.destroy(), P(this.stream);
|
|
376
443
|
const o = [...this.cutRenders.keys()];
|
|
377
444
|
for (const i of o)
|
|
378
445
|
this.cut.remove(i);
|
|
379
|
-
(
|
|
446
|
+
(r = this.audioPlayer) == null || r.destroy(), this.renderBaseTime = void 0, this.canvas = void 0;
|
|
447
|
+
});
|
|
448
|
+
m(this, "getCanvas", () => this.canvas);
|
|
449
|
+
m(this, "getStream", () => this.stream);
|
|
450
|
+
m(this, "setPause", (o) => {
|
|
451
|
+
var a;
|
|
452
|
+
(a = this.renderWorker) == null || a.setPause(o);
|
|
453
|
+
});
|
|
454
|
+
/**
|
|
455
|
+
* 设置渲染模式
|
|
456
|
+
*/
|
|
457
|
+
m(this, "setShader", (o) => {
|
|
458
|
+
var a;
|
|
459
|
+
(a = this.renderWorker) == null || a.setShader(o);
|
|
380
460
|
});
|
|
381
461
|
/**
|
|
382
|
-
*
|
|
462
|
+
* 是否静音 默认为true
|
|
463
|
+
* @param state?: boolean
|
|
383
464
|
*/
|
|
384
|
-
|
|
385
|
-
var
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
465
|
+
m(this, "setMute", (o) => {
|
|
466
|
+
var a, u;
|
|
467
|
+
return (u = (a = this.audioPlayer) == null ? void 0 : a.prAudioStream) == null ? void 0 : u.setMute(o);
|
|
468
|
+
});
|
|
469
|
+
/**
|
|
470
|
+
* 是否已准备好
|
|
471
|
+
*/
|
|
472
|
+
m(this, "isReady", () => {
|
|
473
|
+
const o = () => {
|
|
474
|
+
var a;
|
|
475
|
+
return ((a = this.stream) == null ? void 0 : a.active) === !0;
|
|
476
|
+
};
|
|
477
|
+
return this.prResolves.add("isReady", o);
|
|
478
|
+
});
|
|
479
|
+
m(this, "cut", {
|
|
480
|
+
/**
|
|
481
|
+
* 创建剪切
|
|
482
|
+
*/
|
|
483
|
+
create: (o, a) => {
|
|
484
|
+
let u = this.cutRenders.get(o);
|
|
485
|
+
return u ? (u.worker.setCut(a), u.worker.setPause(!1), u) : (u = A(), u.worker.setBaseTime(this.renderBaseTime || 0), u.worker.setCut(a), this.cutRenders.set(o, u), u);
|
|
486
|
+
},
|
|
487
|
+
getCanvas: (o) => {
|
|
488
|
+
var a;
|
|
489
|
+
return (a = this.cutRenders.get(o)) == null ? void 0 : a.canvas;
|
|
490
|
+
},
|
|
491
|
+
getStream: (o) => {
|
|
492
|
+
var a;
|
|
493
|
+
return (a = this.cutRenders.get(o)) == null ? void 0 : a.stream;
|
|
494
|
+
},
|
|
495
|
+
setPause: (o, a) => {
|
|
496
|
+
var u;
|
|
497
|
+
(u = this.cutRenders.get(o)) == null || u.worker.setPause(a);
|
|
498
|
+
},
|
|
499
|
+
/**
|
|
500
|
+
* 设置渲染模式
|
|
501
|
+
*/
|
|
502
|
+
setShader: (o, a) => {
|
|
503
|
+
var u;
|
|
504
|
+
(u = this.cutRenders.get(o)) == null || u.worker.setShader(a);
|
|
505
|
+
},
|
|
506
|
+
/**
|
|
507
|
+
* 移除剪切
|
|
508
|
+
*/
|
|
509
|
+
remove: (o) => {
|
|
510
|
+
var a;
|
|
511
|
+
(a = this.cutRenders.get(o)) == null || a.destroy(), this.cutRenders.delete(o);
|
|
422
512
|
}
|
|
423
513
|
});
|
|
424
514
|
/**
|
|
425
|
-
*
|
|
515
|
+
* 初始化解复器
|
|
426
516
|
*/
|
|
427
|
-
|
|
428
|
-
this.demuxerWorker = new
|
|
517
|
+
m(this, "initDemuxer", (o) => {
|
|
518
|
+
this.demuxerWorker = new B(), this.demuxerWorker.init(o), this.demuxerWorker.on.debug = (a) => {
|
|
519
|
+
}, this.demuxerWorker.on.info = (a) => {
|
|
520
|
+
this.on.demuxer.info && this.on.demuxer.info(a);
|
|
521
|
+
}, this.demuxerWorker.on.config = (a) => {
|
|
522
|
+
var n, r;
|
|
523
|
+
this.on.demuxer.config && this.on.demuxer.config(a);
|
|
524
|
+
const { kind: u } = a;
|
|
525
|
+
switch (u) {
|
|
526
|
+
case "audio":
|
|
527
|
+
{
|
|
528
|
+
const { codec: i, sampleRate: t, numberOfChannels: e } = a;
|
|
529
|
+
(n = this.decoderWorker) == null || n.audio.init({ codec: i, sampleRate: t, numberOfChannels: e });
|
|
530
|
+
}
|
|
531
|
+
break;
|
|
532
|
+
case "video":
|
|
533
|
+
{
|
|
534
|
+
const { codec: i, description: t } = a;
|
|
535
|
+
(r = this.decoderWorker) == null || r.video.init({ codec: i, description: t });
|
|
536
|
+
}
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
}, this.demuxerWorker.on.chunk = (a) => {
|
|
540
|
+
var n;
|
|
541
|
+
if (this.on.demuxer.chunk && this.on.demuxer.chunk(a), !this.decoderWorker) return;
|
|
542
|
+
const { kind: u } = a;
|
|
543
|
+
switch (u) {
|
|
544
|
+
case "audio":
|
|
545
|
+
{
|
|
546
|
+
const { type: r, dts: i, data: t } = a, e = i * 1;
|
|
547
|
+
this.decoderWorker.audio.decode({ type: r, timestamp: e, data: t });
|
|
548
|
+
}
|
|
549
|
+
break;
|
|
550
|
+
case "video":
|
|
551
|
+
{
|
|
552
|
+
const { type: r, dts: i, data: t, nalus: e = [] } = a;
|
|
553
|
+
if (this.renderBaseTime === void 0) {
|
|
554
|
+
const l = (/* @__PURE__ */ new Date()).getTime();
|
|
555
|
+
this.renderBaseTime = l - i, (n = this.renderWorker) == null || n.setBaseTime(this.renderBaseTime);
|
|
556
|
+
}
|
|
557
|
+
const s = i * 1e3;
|
|
558
|
+
this.decoderWorker.video.decode({ type: r, timestamp: s, data: t });
|
|
559
|
+
for (const l of e) {
|
|
560
|
+
if (l.byteLength <= 4) continue;
|
|
561
|
+
const { header: c, data: d } = Y(l), { nal_unit_type: y } = c;
|
|
562
|
+
y === 6 && this.on.demuxer.sei && this.on.demuxer.sei(d);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
break;
|
|
566
|
+
}
|
|
567
|
+
};
|
|
429
568
|
});
|
|
430
569
|
/**
|
|
431
570
|
* 初始化解码器
|
|
432
571
|
*/
|
|
433
|
-
|
|
434
|
-
this.decoderWorker = new
|
|
435
|
-
var
|
|
436
|
-
(
|
|
572
|
+
m(this, "initDecoder", () => {
|
|
573
|
+
this.decoderWorker = new N(), this.decoderWorker.on.audio.decode = (o) => {
|
|
574
|
+
var a;
|
|
575
|
+
(a = this.audioPlayer) == null || a.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
|
|
437
576
|
}, this.decoderWorker.on.audio.error = (o) => {
|
|
438
577
|
this.stop(), this.on.error && this.on.error(o);
|
|
439
578
|
}, this.decoderWorker.on.video.decode = async (o) => {
|
|
440
|
-
var
|
|
441
|
-
(
|
|
442
|
-
const
|
|
443
|
-
for (const
|
|
444
|
-
(
|
|
579
|
+
var u, n;
|
|
580
|
+
(u = this.renderWorker) == null || u.push(o);
|
|
581
|
+
const a = [...this.cutRenders.keys()];
|
|
582
|
+
for (const r of a)
|
|
583
|
+
(n = this.cutRenders.get(r)) == null || n.worker.push(o);
|
|
445
584
|
this.on.decoder.video && this.on.decoder.video(o), o.bitmap.close();
|
|
446
585
|
}, this.decoderWorker.on.video.error = (o) => {
|
|
447
586
|
this.stop(), this.on.error && this.on.error(o);
|
|
@@ -450,89 +589,104 @@ class be {
|
|
|
450
589
|
/**
|
|
451
590
|
* 初始化渲染器
|
|
452
591
|
*/
|
|
453
|
-
|
|
454
|
-
const { worker: o, canvas:
|
|
455
|
-
this.renderWorker = o, this.canvas =
|
|
456
|
-
});
|
|
457
|
-
v(this, "getCanvas", () => this.canvas);
|
|
458
|
-
v(this, "getStream", () => this.stream);
|
|
459
|
-
v(this, "getCutCanvas", (o) => {
|
|
460
|
-
var u;
|
|
461
|
-
return (u = this.cutRenders.get(o)) == null ? void 0 : u.canvas;
|
|
462
|
-
});
|
|
463
|
-
v(this, "getCutStream", (o) => {
|
|
464
|
-
var u;
|
|
465
|
-
return (u = this.cutRenders.get(o)) == null ? void 0 : u.stream;
|
|
466
|
-
});
|
|
467
|
-
v(this, "setPause", (o) => {
|
|
468
|
-
var u;
|
|
469
|
-
(u = this.renderWorker) == null || u.setPause(o);
|
|
470
|
-
});
|
|
471
|
-
/**
|
|
472
|
-
* 设置渲染模式
|
|
473
|
-
*/
|
|
474
|
-
v(this, "setShader", (o) => {
|
|
475
|
-
var u;
|
|
476
|
-
(u = this.renderWorker) == null || u.setShader(o);
|
|
592
|
+
m(this, "initRender", () => {
|
|
593
|
+
const { worker: o, canvas: a, stream: u } = A();
|
|
594
|
+
this.renderWorker = o, this.canvas = a, this.stream = u, this.renderWorker.setPause(!1);
|
|
477
595
|
});
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
596
|
+
m(this, "flv", {
|
|
597
|
+
start: async () => {
|
|
598
|
+
var o, a;
|
|
599
|
+
try {
|
|
600
|
+
const u = (o = (await this.prFetch.request(this.url)).body) == null ? void 0 : o.getReader();
|
|
601
|
+
if (!u) throw new Error("reader is error.");
|
|
602
|
+
for (; ; ) {
|
|
603
|
+
const { done: n, value: r } = await u.read();
|
|
604
|
+
if (r && ((a = this.demuxerWorker) == null || a.push(r)), n) break;
|
|
605
|
+
}
|
|
606
|
+
} catch (u) {
|
|
607
|
+
if ((u == null ? void 0 : u.name) !== "AbortError") throw Error(u);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
485
610
|
});
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
611
|
+
m(this, "hls", {
|
|
612
|
+
isLive: !1,
|
|
613
|
+
urls: [],
|
|
614
|
+
url: "",
|
|
615
|
+
getSegmentsTimer: 0,
|
|
616
|
+
parse: async (o) => {
|
|
617
|
+
const a = new TextDecoder("utf-8").decode(o).split(`
|
|
618
|
+
`).map((e) => e.replace("\r", "")), u = this.url.substring(0, this.url.lastIndexOf("/") + 1);
|
|
619
|
+
let n = 4, r = 0, i = !1;
|
|
620
|
+
const t = [];
|
|
621
|
+
for (const e of a)
|
|
622
|
+
e.startsWith("#EXTINF:") ? n = parseFloat(e.split(":")[1].split(",")[0]) : e.startsWith("#EXT-X-TARGETDURATION:") ? r = parseInt(e.split(":")[1]) : e.startsWith("#EXT-X-ENDLIST") ? i = !1 : e.startsWith("#EXT-X-MEDIA-SEQUENCE:") ? i = !0 : e.includes(".ts") && !e.startsWith("#") && t.push({
|
|
623
|
+
url: e.startsWith("http") ? e : u + e,
|
|
624
|
+
duration: n,
|
|
625
|
+
isLive: i
|
|
626
|
+
});
|
|
627
|
+
return { baseUrl: u, targetDuration: r, isLive: i, segments: t };
|
|
493
628
|
},
|
|
494
|
-
|
|
495
|
-
var
|
|
496
|
-
(
|
|
629
|
+
getSegments: async () => {
|
|
630
|
+
var a;
|
|
631
|
+
const o = (a = (await new C().request(this.url)).body) == null ? void 0 : a.getReader();
|
|
632
|
+
if (!o) throw new Error("reader is error.");
|
|
633
|
+
for (; ; ) {
|
|
634
|
+
const { done: u, value: n } = await o.read();
|
|
635
|
+
if (n) {
|
|
636
|
+
const r = await this.hls.parse(n), { segments: i = [], isLive: t = !1 } = r;
|
|
637
|
+
this.hls.isLive = t;
|
|
638
|
+
let e = Array.from(i, (l) => l.url);
|
|
639
|
+
const s = e.findIndex((l) => l === this.hls.url);
|
|
640
|
+
s !== -1 && (e = e.slice(s + 1)), this.hls.urls = e;
|
|
641
|
+
}
|
|
642
|
+
if (u) break;
|
|
643
|
+
}
|
|
497
644
|
},
|
|
498
|
-
|
|
499
|
-
* 设置渲染模式
|
|
500
|
-
*/
|
|
501
|
-
setShader: (o, u) => {
|
|
502
|
-
var c;
|
|
503
|
-
(c = this.cutRenders.get(o)) == null || c.worker.setShader(u);
|
|
645
|
+
getData: async () => {
|
|
504
646
|
},
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
647
|
+
start: async () => {
|
|
648
|
+
var o, a;
|
|
649
|
+
try {
|
|
650
|
+
for (await this.hls.getSegments(), this.hls.getSegmentsTimer = window.setInterval(this.hls.getSegments, 1e3), this.hls.isLive === !1 && clearInterval(this.hls.getSegmentsTimer); ; ) {
|
|
651
|
+
const u = this.hls.urls.shift();
|
|
652
|
+
if (u) {
|
|
653
|
+
this.hls.url = u;
|
|
654
|
+
const n = (o = (await this.prFetch.request(u)).body) == null ? void 0 : o.getReader();
|
|
655
|
+
if (!n) throw new Error("segment reader is error.");
|
|
656
|
+
for (; ; ) {
|
|
657
|
+
const { done: r, value: i } = await n.read();
|
|
658
|
+
if (i && ((a = this.demuxerWorker) == null || a.push(i)), r) break;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
await new Promise((n) => setTimeout(() => n(!0), 500));
|
|
662
|
+
}
|
|
663
|
+
} catch (u) {
|
|
664
|
+
if ((u == null ? void 0 : u.name) !== "AbortError") throw Error(u);
|
|
665
|
+
}
|
|
511
666
|
}
|
|
512
667
|
});
|
|
513
668
|
}
|
|
514
669
|
}
|
|
515
|
-
new TextDecoder("utf-8");
|
|
516
670
|
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, indexMinimal = {}, minimal$1 = {}, aspromise, hasRequiredAspromise;
|
|
517
671
|
function requireAspromise() {
|
|
518
672
|
if (hasRequiredAspromise) return aspromise;
|
|
519
|
-
hasRequiredAspromise = 1, aspromise =
|
|
520
|
-
function
|
|
521
|
-
for (var
|
|
522
|
-
|
|
523
|
-
return new Promise(function(
|
|
524
|
-
|
|
673
|
+
hasRequiredAspromise = 1, aspromise = h;
|
|
674
|
+
function h(o, a) {
|
|
675
|
+
for (var u = new Array(arguments.length - 1), n = 0, r = 2, i = !0; r < arguments.length; )
|
|
676
|
+
u[n++] = arguments[r++];
|
|
677
|
+
return new Promise(function(e, s) {
|
|
678
|
+
u[n] = function(c) {
|
|
525
679
|
if (i)
|
|
526
|
-
if (i = !1,
|
|
527
|
-
s(
|
|
680
|
+
if (i = !1, c)
|
|
681
|
+
s(c);
|
|
528
682
|
else {
|
|
529
683
|
for (var d = new Array(arguments.length - 1), y = 0; y < d.length; )
|
|
530
684
|
d[y++] = arguments[y];
|
|
531
|
-
|
|
685
|
+
e.apply(null, d);
|
|
532
686
|
}
|
|
533
687
|
};
|
|
534
688
|
try {
|
|
535
|
-
o.apply(
|
|
689
|
+
o.apply(a || null, u);
|
|
536
690
|
} catch (l) {
|
|
537
691
|
i && (i = !1, s(l));
|
|
538
692
|
}
|
|
@@ -542,95 +696,95 @@ function requireAspromise() {
|
|
|
542
696
|
}
|
|
543
697
|
var base64 = {}, hasRequiredBase64;
|
|
544
698
|
function requireBase64() {
|
|
545
|
-
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(
|
|
546
|
-
var o =
|
|
547
|
-
o.length = function(
|
|
548
|
-
var
|
|
549
|
-
if (!
|
|
699
|
+
return hasRequiredBase64 || (hasRequiredBase64 = 1, function(h) {
|
|
700
|
+
var o = h;
|
|
701
|
+
o.length = function(t) {
|
|
702
|
+
var e = t.length;
|
|
703
|
+
if (!e)
|
|
550
704
|
return 0;
|
|
551
|
-
for (var s = 0; --
|
|
705
|
+
for (var s = 0; --e % 4 > 1 && t.charAt(e) === "="; )
|
|
552
706
|
++s;
|
|
553
|
-
return Math.ceil(
|
|
707
|
+
return Math.ceil(t.length * 3) / 4 - s;
|
|
554
708
|
};
|
|
555
|
-
for (var
|
|
556
|
-
|
|
557
|
-
o.encode = function(
|
|
558
|
-
for (var l = null,
|
|
559
|
-
var w = e
|
|
709
|
+
for (var a = new Array(64), u = new Array(123), n = 0; n < 64; )
|
|
710
|
+
u[a[n] = n < 26 ? n + 65 : n < 52 ? n + 71 : n < 62 ? n - 4 : n - 59 | 43] = n++;
|
|
711
|
+
o.encode = function(t, e, s) {
|
|
712
|
+
for (var l = null, c = [], d = 0, y = 0, p; e < s; ) {
|
|
713
|
+
var w = t[e++];
|
|
560
714
|
switch (y) {
|
|
561
715
|
case 0:
|
|
562
|
-
|
|
716
|
+
c[d++] = a[w >> 2], p = (w & 3) << 4, y = 1;
|
|
563
717
|
break;
|
|
564
718
|
case 1:
|
|
565
|
-
|
|
719
|
+
c[d++] = a[p | w >> 4], p = (w & 15) << 2, y = 2;
|
|
566
720
|
break;
|
|
567
721
|
case 2:
|
|
568
|
-
|
|
722
|
+
c[d++] = a[p | w >> 6], c[d++] = a[w & 63], y = 0;
|
|
569
723
|
break;
|
|
570
724
|
}
|
|
571
|
-
d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String,
|
|
725
|
+
d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, c)), d = 0);
|
|
572
726
|
}
|
|
573
|
-
return y && (
|
|
727
|
+
return y && (c[d++] = a[p], c[d++] = 61, y === 1 && (c[d++] = 61)), l ? (d && l.push(String.fromCharCode.apply(String, c.slice(0, d))), l.join("")) : String.fromCharCode.apply(String, c.slice(0, d));
|
|
574
728
|
};
|
|
575
|
-
var
|
|
576
|
-
o.decode = function(
|
|
577
|
-
for (var l = s,
|
|
578
|
-
var p =
|
|
579
|
-
if (p === 61 &&
|
|
729
|
+
var r = "invalid encoding";
|
|
730
|
+
o.decode = function(t, e, s) {
|
|
731
|
+
for (var l = s, c = 0, d, y = 0; y < t.length; ) {
|
|
732
|
+
var p = t.charCodeAt(y++);
|
|
733
|
+
if (p === 61 && c > 1)
|
|
580
734
|
break;
|
|
581
|
-
if ((p =
|
|
582
|
-
throw Error(
|
|
583
|
-
switch (
|
|
735
|
+
if ((p = u[p]) === void 0)
|
|
736
|
+
throw Error(r);
|
|
737
|
+
switch (c) {
|
|
584
738
|
case 0:
|
|
585
|
-
d = p,
|
|
739
|
+
d = p, c = 1;
|
|
586
740
|
break;
|
|
587
741
|
case 1:
|
|
588
|
-
|
|
742
|
+
e[s++] = d << 2 | (p & 48) >> 4, d = p, c = 2;
|
|
589
743
|
break;
|
|
590
744
|
case 2:
|
|
591
|
-
|
|
745
|
+
e[s++] = (d & 15) << 4 | (p & 60) >> 2, d = p, c = 3;
|
|
592
746
|
break;
|
|
593
747
|
case 3:
|
|
594
|
-
|
|
748
|
+
e[s++] = (d & 3) << 6 | p, c = 0;
|
|
595
749
|
break;
|
|
596
750
|
}
|
|
597
751
|
}
|
|
598
|
-
if (
|
|
599
|
-
throw Error(
|
|
752
|
+
if (c === 1)
|
|
753
|
+
throw Error(r);
|
|
600
754
|
return s - l;
|
|
601
|
-
}, o.test = function(
|
|
602
|
-
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(
|
|
755
|
+
}, o.test = function(t) {
|
|
756
|
+
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t);
|
|
603
757
|
};
|
|
604
758
|
}(base64)), base64;
|
|
605
759
|
}
|
|
606
760
|
var eventemitter, hasRequiredEventemitter;
|
|
607
761
|
function requireEventemitter() {
|
|
608
762
|
if (hasRequiredEventemitter) return eventemitter;
|
|
609
|
-
hasRequiredEventemitter = 1, eventemitter =
|
|
610
|
-
function
|
|
763
|
+
hasRequiredEventemitter = 1, eventemitter = h;
|
|
764
|
+
function h() {
|
|
611
765
|
this._listeners = {};
|
|
612
766
|
}
|
|
613
|
-
return
|
|
614
|
-
return (this._listeners[
|
|
615
|
-
fn:
|
|
616
|
-
ctx:
|
|
767
|
+
return h.prototype.on = function(a, u, n) {
|
|
768
|
+
return (this._listeners[a] || (this._listeners[a] = [])).push({
|
|
769
|
+
fn: u,
|
|
770
|
+
ctx: n || this
|
|
617
771
|
}), this;
|
|
618
|
-
},
|
|
619
|
-
if (
|
|
772
|
+
}, h.prototype.off = function(a, u) {
|
|
773
|
+
if (a === void 0)
|
|
620
774
|
this._listeners = {};
|
|
621
|
-
else if (
|
|
622
|
-
this._listeners[
|
|
775
|
+
else if (u === void 0)
|
|
776
|
+
this._listeners[a] = [];
|
|
623
777
|
else
|
|
624
|
-
for (var
|
|
625
|
-
r
|
|
778
|
+
for (var n = this._listeners[a], r = 0; r < n.length; )
|
|
779
|
+
n[r].fn === u ? n.splice(r, 1) : ++r;
|
|
626
780
|
return this;
|
|
627
|
-
},
|
|
628
|
-
var
|
|
629
|
-
if (
|
|
630
|
-
for (var
|
|
631
|
-
|
|
632
|
-
for (
|
|
633
|
-
|
|
781
|
+
}, h.prototype.emit = function(a) {
|
|
782
|
+
var u = this._listeners[a];
|
|
783
|
+
if (u) {
|
|
784
|
+
for (var n = [], r = 1; r < arguments.length; )
|
|
785
|
+
n.push(arguments[r++]);
|
|
786
|
+
for (r = 0; r < u.length; )
|
|
787
|
+
u[r].fn.apply(u[r++].ctx, n);
|
|
634
788
|
}
|
|
635
789
|
return this;
|
|
636
790
|
}, eventemitter;
|
|
@@ -638,112 +792,112 @@ function requireEventemitter() {
|
|
|
638
792
|
var float, hasRequiredFloat;
|
|
639
793
|
function requireFloat() {
|
|
640
794
|
if (hasRequiredFloat) return float;
|
|
641
|
-
hasRequiredFloat = 1, float =
|
|
642
|
-
function
|
|
795
|
+
hasRequiredFloat = 1, float = h(h);
|
|
796
|
+
function h(r) {
|
|
643
797
|
return typeof Float32Array < "u" ? function() {
|
|
644
|
-
var i = new Float32Array([-0]),
|
|
798
|
+
var i = new Float32Array([-0]), t = new Uint8Array(i.buffer), e = t[3] === 128;
|
|
645
799
|
function s(y, p, w) {
|
|
646
|
-
i[0] = y, p[w] =
|
|
800
|
+
i[0] = y, p[w] = t[0], p[w + 1] = t[1], p[w + 2] = t[2], p[w + 3] = t[3];
|
|
647
801
|
}
|
|
648
802
|
function l(y, p, w) {
|
|
649
|
-
i[0] = y, p[w] =
|
|
803
|
+
i[0] = y, p[w] = t[3], p[w + 1] = t[2], p[w + 2] = t[1], p[w + 3] = t[0];
|
|
650
804
|
}
|
|
651
|
-
|
|
652
|
-
function
|
|
653
|
-
return
|
|
805
|
+
r.writeFloatLE = e ? s : l, r.writeFloatBE = e ? l : s;
|
|
806
|
+
function c(y, p) {
|
|
807
|
+
return t[0] = y[p], t[1] = y[p + 1], t[2] = y[p + 2], t[3] = y[p + 3], i[0];
|
|
654
808
|
}
|
|
655
809
|
function d(y, p) {
|
|
656
|
-
return
|
|
810
|
+
return t[3] = y[p], t[2] = y[p + 1], t[1] = y[p + 2], t[0] = y[p + 3], i[0];
|
|
657
811
|
}
|
|
658
|
-
|
|
812
|
+
r.readFloatLE = e ? c : d, r.readFloatBE = e ? d : c;
|
|
659
813
|
}() : function() {
|
|
660
|
-
function i(
|
|
814
|
+
function i(e, s, l, c) {
|
|
661
815
|
var d = s < 0 ? 1 : 0;
|
|
662
816
|
if (d && (s = -s), s === 0)
|
|
663
|
-
|
|
817
|
+
e(1 / s > 0 ? (
|
|
664
818
|
/* positive */
|
|
665
819
|
0
|
|
666
820
|
) : (
|
|
667
821
|
/* negative 0 */
|
|
668
822
|
2147483648
|
|
669
|
-
), l,
|
|
823
|
+
), l, c);
|
|
670
824
|
else if (isNaN(s))
|
|
671
|
-
|
|
825
|
+
e(2143289344, l, c);
|
|
672
826
|
else if (s > 34028234663852886e22)
|
|
673
|
-
|
|
827
|
+
e((d << 31 | 2139095040) >>> 0, l, c);
|
|
674
828
|
else if (s < 11754943508222875e-54)
|
|
675
|
-
|
|
829
|
+
e((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l, c);
|
|
676
830
|
else {
|
|
677
831
|
var y = Math.floor(Math.log(s) / Math.LN2), p = Math.round(s * Math.pow(2, -y) * 8388608) & 8388607;
|
|
678
|
-
|
|
832
|
+
e((d << 31 | y + 127 << 23 | p) >>> 0, l, c);
|
|
679
833
|
}
|
|
680
834
|
}
|
|
681
|
-
|
|
682
|
-
function e
|
|
683
|
-
var
|
|
835
|
+
r.writeFloatLE = i.bind(null, o), r.writeFloatBE = i.bind(null, a);
|
|
836
|
+
function t(e, s, l) {
|
|
837
|
+
var c = e(s, l), d = (c >> 31) * 2 + 1, y = c >>> 23 & 255, p = c & 8388607;
|
|
684
838
|
return y === 255 ? p ? NaN : d * (1 / 0) : y === 0 ? d * 1401298464324817e-60 * p : d * Math.pow(2, y - 150) * (p + 8388608);
|
|
685
839
|
}
|
|
686
|
-
|
|
840
|
+
r.readFloatLE = t.bind(null, u), r.readFloatBE = t.bind(null, n);
|
|
687
841
|
}(), typeof Float64Array < "u" ? function() {
|
|
688
|
-
var i = new Float64Array([-0]),
|
|
842
|
+
var i = new Float64Array([-0]), t = new Uint8Array(i.buffer), e = t[7] === 128;
|
|
689
843
|
function s(y, p, w) {
|
|
690
|
-
i[0] = y, p[w] =
|
|
844
|
+
i[0] = y, p[w] = t[0], p[w + 1] = t[1], p[w + 2] = t[2], p[w + 3] = t[3], p[w + 4] = t[4], p[w + 5] = t[5], p[w + 6] = t[6], p[w + 7] = t[7];
|
|
691
845
|
}
|
|
692
846
|
function l(y, p, w) {
|
|
693
|
-
i[0] = y, p[w] =
|
|
847
|
+
i[0] = y, p[w] = t[7], p[w + 1] = t[6], p[w + 2] = t[5], p[w + 3] = t[4], p[w + 4] = t[3], p[w + 5] = t[2], p[w + 6] = t[1], p[w + 7] = t[0];
|
|
694
848
|
}
|
|
695
|
-
|
|
696
|
-
function
|
|
697
|
-
return
|
|
849
|
+
r.writeDoubleLE = e ? s : l, r.writeDoubleBE = e ? l : s;
|
|
850
|
+
function c(y, p) {
|
|
851
|
+
return t[0] = y[p], t[1] = y[p + 1], t[2] = y[p + 2], t[3] = y[p + 3], t[4] = y[p + 4], t[5] = y[p + 5], t[6] = y[p + 6], t[7] = y[p + 7], i[0];
|
|
698
852
|
}
|
|
699
853
|
function d(y, p) {
|
|
700
|
-
return
|
|
854
|
+
return t[7] = y[p], t[6] = y[p + 1], t[5] = y[p + 2], t[4] = y[p + 3], t[3] = y[p + 4], t[2] = y[p + 5], t[1] = y[p + 6], t[0] = y[p + 7], i[0];
|
|
701
855
|
}
|
|
702
|
-
|
|
856
|
+
r.readDoubleLE = e ? c : d, r.readDoubleBE = e ? d : c;
|
|
703
857
|
}() : function() {
|
|
704
|
-
function i(
|
|
705
|
-
var p =
|
|
706
|
-
if (p && (
|
|
707
|
-
|
|
858
|
+
function i(e, s, l, c, d, y) {
|
|
859
|
+
var p = c < 0 ? 1 : 0;
|
|
860
|
+
if (p && (c = -c), c === 0)
|
|
861
|
+
e(0, d, y + s), e(1 / c > 0 ? (
|
|
708
862
|
/* positive */
|
|
709
863
|
0
|
|
710
864
|
) : (
|
|
711
865
|
/* negative 0 */
|
|
712
866
|
2147483648
|
|
713
867
|
), d, y + l);
|
|
714
|
-
else if (isNaN(
|
|
715
|
-
|
|
716
|
-
else if (
|
|
717
|
-
|
|
868
|
+
else if (isNaN(c))
|
|
869
|
+
e(0, d, y + s), e(2146959360, d, y + l);
|
|
870
|
+
else if (c > 17976931348623157e292)
|
|
871
|
+
e(0, d, y + s), e((p << 31 | 2146435072) >>> 0, d, y + l);
|
|
718
872
|
else {
|
|
719
873
|
var w;
|
|
720
|
-
if (
|
|
721
|
-
w =
|
|
874
|
+
if (c < 22250738585072014e-324)
|
|
875
|
+
w = c / 5e-324, e(w >>> 0, d, y + s), e((p << 31 | w / 4294967296) >>> 0, d, y + l);
|
|
722
876
|
else {
|
|
723
|
-
var b = Math.floor(Math.log(
|
|
724
|
-
b === 1024 && (b = 1023), w =
|
|
877
|
+
var b = Math.floor(Math.log(c) / Math.LN2);
|
|
878
|
+
b === 1024 && (b = 1023), w = c * Math.pow(2, -b), e(w * 4503599627370496 >>> 0, d, y + s), e((p << 31 | b + 1023 << 20 | w * 1048576 & 1048575) >>> 0, d, y + l);
|
|
725
879
|
}
|
|
726
880
|
}
|
|
727
881
|
}
|
|
728
|
-
|
|
729
|
-
function e
|
|
730
|
-
var y =
|
|
731
|
-
return b === 2047 ?
|
|
882
|
+
r.writeDoubleLE = i.bind(null, o, 0, 4), r.writeDoubleBE = i.bind(null, a, 4, 0);
|
|
883
|
+
function t(e, s, l, c, d) {
|
|
884
|
+
var y = e(c, d + s), p = e(c, d + l), w = (p >> 31) * 2 + 1, b = p >>> 20 & 2047, g = 4294967296 * (p & 1048575) + y;
|
|
885
|
+
return b === 2047 ? g ? NaN : w * (1 / 0) : b === 0 ? w * 5e-324 * g : w * Math.pow(2, b - 1075) * (g + 4503599627370496);
|
|
732
886
|
}
|
|
733
|
-
|
|
734
|
-
}(),
|
|
887
|
+
r.readDoubleLE = t.bind(null, u, 0, 4), r.readDoubleBE = t.bind(null, n, 4, 0);
|
|
888
|
+
}(), r;
|
|
735
889
|
}
|
|
736
|
-
function o(
|
|
737
|
-
i[
|
|
890
|
+
function o(r, i, t) {
|
|
891
|
+
i[t] = r & 255, i[t + 1] = r >>> 8 & 255, i[t + 2] = r >>> 16 & 255, i[t + 3] = r >>> 24;
|
|
738
892
|
}
|
|
739
|
-
function
|
|
740
|
-
i[
|
|
893
|
+
function a(r, i, t) {
|
|
894
|
+
i[t] = r >>> 24, i[t + 1] = r >>> 16 & 255, i[t + 2] = r >>> 8 & 255, i[t + 3] = r & 255;
|
|
741
895
|
}
|
|
742
|
-
function
|
|
743
|
-
return (
|
|
896
|
+
function u(r, i) {
|
|
897
|
+
return (r[i] | r[i + 1] << 8 | r[i + 2] << 16 | r[i + 3] << 24) >>> 0;
|
|
744
898
|
}
|
|
745
|
-
function r
|
|
746
|
-
return (
|
|
899
|
+
function n(r, i) {
|
|
900
|
+
return (r[i] << 24 | r[i + 1] << 16 | r[i + 2] << 8 | r[i + 3]) >>> 0;
|
|
747
901
|
}
|
|
748
902
|
return float;
|
|
749
903
|
}
|
|
@@ -756,7 +910,7 @@ function requireInquire() {
|
|
|
756
910
|
var mod = eval("quire".replace(/^/, "re"))(moduleName);
|
|
757
911
|
if (mod && (mod.length || Object.keys(mod).length))
|
|
758
912
|
return mod;
|
|
759
|
-
} catch (
|
|
913
|
+
} catch (h) {
|
|
760
914
|
}
|
|
761
915
|
return null;
|
|
762
916
|
}
|
|
@@ -764,38 +918,38 @@ function requireInquire() {
|
|
|
764
918
|
}
|
|
765
919
|
var utf8 = {}, hasRequiredUtf8;
|
|
766
920
|
function requireUtf8() {
|
|
767
|
-
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(
|
|
768
|
-
var o =
|
|
769
|
-
o.length = function(
|
|
770
|
-
for (var
|
|
771
|
-
|
|
772
|
-
return
|
|
773
|
-
}, o.read = function(
|
|
774
|
-
var i =
|
|
921
|
+
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(h) {
|
|
922
|
+
var o = h;
|
|
923
|
+
o.length = function(u) {
|
|
924
|
+
for (var n = 0, r = 0, i = 0; i < u.length; ++i)
|
|
925
|
+
r = u.charCodeAt(i), r < 128 ? n += 1 : r < 2048 ? n += 2 : (r & 64512) === 55296 && (u.charCodeAt(i + 1) & 64512) === 56320 ? (++i, n += 4) : n += 3;
|
|
926
|
+
return n;
|
|
927
|
+
}, o.read = function(u, n, r) {
|
|
928
|
+
var i = r - n;
|
|
775
929
|
if (i < 1)
|
|
776
930
|
return "";
|
|
777
|
-
for (var
|
|
778
|
-
l =
|
|
779
|
-
return
|
|
780
|
-
}, o.write = function(
|
|
781
|
-
for (var i =
|
|
782
|
-
|
|
783
|
-
return
|
|
931
|
+
for (var t = null, e = [], s = 0, l; n < r; )
|
|
932
|
+
l = u[n++], l < 128 ? e[s++] = l : l > 191 && l < 224 ? e[s++] = (l & 31) << 6 | u[n++] & 63 : l > 239 && l < 365 ? (l = ((l & 7) << 18 | (u[n++] & 63) << 12 | (u[n++] & 63) << 6 | u[n++] & 63) - 65536, e[s++] = 55296 + (l >> 10), e[s++] = 56320 + (l & 1023)) : e[s++] = (l & 15) << 12 | (u[n++] & 63) << 6 | u[n++] & 63, s > 8191 && ((t || (t = [])).push(String.fromCharCode.apply(String, e)), s = 0);
|
|
933
|
+
return t ? (s && t.push(String.fromCharCode.apply(String, e.slice(0, s))), t.join("")) : String.fromCharCode.apply(String, e.slice(0, s));
|
|
934
|
+
}, o.write = function(u, n, r) {
|
|
935
|
+
for (var i = r, t, e, s = 0; s < u.length; ++s)
|
|
936
|
+
t = u.charCodeAt(s), t < 128 ? n[r++] = t : t < 2048 ? (n[r++] = t >> 6 | 192, n[r++] = t & 63 | 128) : (t & 64512) === 55296 && ((e = u.charCodeAt(s + 1)) & 64512) === 56320 ? (t = 65536 + ((t & 1023) << 10) + (e & 1023), ++s, n[r++] = t >> 18 | 240, n[r++] = t >> 12 & 63 | 128, n[r++] = t >> 6 & 63 | 128, n[r++] = t & 63 | 128) : (n[r++] = t >> 12 | 224, n[r++] = t >> 6 & 63 | 128, n[r++] = t & 63 | 128);
|
|
937
|
+
return r - i;
|
|
784
938
|
};
|
|
785
939
|
}(utf8)), utf8;
|
|
786
940
|
}
|
|
787
941
|
var pool_1, hasRequiredPool;
|
|
788
942
|
function requirePool() {
|
|
789
943
|
if (hasRequiredPool) return pool_1;
|
|
790
|
-
hasRequiredPool = 1, pool_1 =
|
|
791
|
-
function
|
|
792
|
-
var
|
|
944
|
+
hasRequiredPool = 1, pool_1 = h;
|
|
945
|
+
function h(o, a, u) {
|
|
946
|
+
var n = u || 8192, r = n >>> 1, i = null, t = n;
|
|
793
947
|
return function(s) {
|
|
794
|
-
if (s < 1 || s >
|
|
948
|
+
if (s < 1 || s > r)
|
|
795
949
|
return o(s);
|
|
796
|
-
|
|
797
|
-
var l =
|
|
798
|
-
return
|
|
950
|
+
t + s > n && (i = o(n), t = 0);
|
|
951
|
+
var l = a.call(i, t, t += s);
|
|
952
|
+
return t & 7 && (t = (t | 7) + 1), l;
|
|
799
953
|
};
|
|
800
954
|
}
|
|
801
955
|
return pool_1;
|
|
@@ -804,49 +958,49 @@ var longbits, hasRequiredLongbits;
|
|
|
804
958
|
function requireLongbits() {
|
|
805
959
|
if (hasRequiredLongbits) return longbits;
|
|
806
960
|
hasRequiredLongbits = 1, longbits = o;
|
|
807
|
-
var
|
|
808
|
-
function o(
|
|
809
|
-
this.lo =
|
|
961
|
+
var h = requireMinimal$1();
|
|
962
|
+
function o(r, i) {
|
|
963
|
+
this.lo = r >>> 0, this.hi = i >>> 0;
|
|
810
964
|
}
|
|
811
|
-
var
|
|
812
|
-
|
|
965
|
+
var a = o.zero = new o(0, 0);
|
|
966
|
+
a.toNumber = function() {
|
|
813
967
|
return 0;
|
|
814
|
-
},
|
|
968
|
+
}, a.zzEncode = a.zzDecode = function() {
|
|
815
969
|
return this;
|
|
816
|
-
},
|
|
970
|
+
}, a.length = function() {
|
|
817
971
|
return 1;
|
|
818
972
|
};
|
|
819
|
-
var
|
|
973
|
+
var u = o.zeroHash = "\0\0\0\0\0\0\0\0";
|
|
820
974
|
o.fromNumber = function(i) {
|
|
821
975
|
if (i === 0)
|
|
822
|
-
return
|
|
823
|
-
var
|
|
824
|
-
|
|
825
|
-
var
|
|
826
|
-
return
|
|
976
|
+
return a;
|
|
977
|
+
var t = i < 0;
|
|
978
|
+
t && (i = -i);
|
|
979
|
+
var e = i >>> 0, s = (i - e) / 4294967296 >>> 0;
|
|
980
|
+
return t && (s = ~s >>> 0, e = ~e >>> 0, ++e > 4294967295 && (e = 0, ++s > 4294967295 && (s = 0))), new o(e, s);
|
|
827
981
|
}, o.from = function(i) {
|
|
828
982
|
if (typeof i == "number")
|
|
829
983
|
return o.fromNumber(i);
|
|
830
|
-
if (
|
|
831
|
-
if (
|
|
832
|
-
i =
|
|
984
|
+
if (h.isString(i))
|
|
985
|
+
if (h.Long)
|
|
986
|
+
i = h.Long.fromString(i);
|
|
833
987
|
else
|
|
834
988
|
return o.fromNumber(parseInt(i, 10));
|
|
835
|
-
return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) :
|
|
989
|
+
return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) : a;
|
|
836
990
|
}, o.prototype.toNumber = function(i) {
|
|
837
991
|
if (!i && this.hi >>> 31) {
|
|
838
|
-
var
|
|
839
|
-
return
|
|
992
|
+
var t = ~this.lo + 1 >>> 0, e = ~this.hi >>> 0;
|
|
993
|
+
return t || (e = e + 1 >>> 0), -(t + e * 4294967296);
|
|
840
994
|
}
|
|
841
995
|
return this.lo + this.hi * 4294967296;
|
|
842
996
|
}, o.prototype.toLong = function(i) {
|
|
843
|
-
return
|
|
997
|
+
return h.Long ? new h.Long(this.lo | 0, this.hi | 0, !!i) : { low: this.lo | 0, high: this.hi | 0, unsigned: !!i };
|
|
844
998
|
};
|
|
845
|
-
var
|
|
999
|
+
var n = String.prototype.charCodeAt;
|
|
846
1000
|
return o.fromHash = function(i) {
|
|
847
|
-
return i ===
|
|
848
|
-
(
|
|
849
|
-
(
|
|
1001
|
+
return i === u ? a : new o(
|
|
1002
|
+
(n.call(i, 0) | n.call(i, 1) << 8 | n.call(i, 2) << 16 | n.call(i, 3) << 24) >>> 0,
|
|
1003
|
+
(n.call(i, 4) | n.call(i, 5) << 8 | n.call(i, 6) << 16 | n.call(i, 7) << 24) >>> 0
|
|
850
1004
|
);
|
|
851
1005
|
}, o.prototype.toHash = function() {
|
|
852
1006
|
return String.fromCharCode(
|
|
@@ -866,14 +1020,14 @@ function requireLongbits() {
|
|
|
866
1020
|
var i = -(this.lo & 1);
|
|
867
1021
|
return this.lo = ((this.lo >>> 1 | this.hi << 31) ^ i) >>> 0, this.hi = (this.hi >>> 1 ^ i) >>> 0, this;
|
|
868
1022
|
}, o.prototype.length = function() {
|
|
869
|
-
var i = this.lo,
|
|
870
|
-
return
|
|
1023
|
+
var i = this.lo, t = (this.lo >>> 28 | this.hi << 4) >>> 0, e = this.hi >>> 24;
|
|
1024
|
+
return e === 0 ? t === 0 ? i < 16384 ? i < 128 ? 1 : 2 : i < 2097152 ? 3 : 4 : t < 16384 ? t < 128 ? 5 : 6 : t < 2097152 ? 7 : 8 : e < 128 ? 9 : 10;
|
|
871
1025
|
}, longbits;
|
|
872
1026
|
}
|
|
873
1027
|
var hasRequiredMinimal$1;
|
|
874
1028
|
function requireMinimal$1() {
|
|
875
|
-
return hasRequiredMinimal$1 || (hasRequiredMinimal$1 = 1, function(
|
|
876
|
-
var o =
|
|
1029
|
+
return hasRequiredMinimal$1 || (hasRequiredMinimal$1 = 1, function(h) {
|
|
1030
|
+
var o = h;
|
|
877
1031
|
o.asPromise = requireAspromise(), o.base64 = requireBase64(), o.EventEmitter = requireEventemitter(), o.float = requireFloat(), o.inquire = requireInquire(), o.utf8 = requireUtf8(), o.pool = requirePool(), o.LongBits = requireLongbits(), o.isNode = !!(typeof commonjsGlobal < "u" && commonjsGlobal && commonjsGlobal.process && commonjsGlobal.process.versions && commonjsGlobal.process.versions.node), o.global = o.isNode && commonjsGlobal || typeof window < "u" && window || typeof self < "u" && self || minimal$1, o.emptyArray = Object.freeze ? Object.freeze([]) : (
|
|
878
1032
|
/* istanbul ignore next */
|
|
879
1033
|
[]
|
|
@@ -881,68 +1035,68 @@ function requireMinimal$1() {
|
|
|
881
1035
|
/* istanbul ignore next */
|
|
882
1036
|
{}
|
|
883
1037
|
), o.isInteger = Number.isInteger || /* istanbul ignore next */
|
|
884
|
-
function(
|
|
885
|
-
return typeof
|
|
886
|
-
}, o.isString = function(
|
|
887
|
-
return typeof
|
|
888
|
-
}, o.isObject = function(
|
|
889
|
-
return
|
|
1038
|
+
function(r) {
|
|
1039
|
+
return typeof r == "number" && isFinite(r) && Math.floor(r) === r;
|
|
1040
|
+
}, o.isString = function(r) {
|
|
1041
|
+
return typeof r == "string" || r instanceof String;
|
|
1042
|
+
}, o.isObject = function(r) {
|
|
1043
|
+
return r && typeof r == "object";
|
|
890
1044
|
}, o.isset = /**
|
|
891
1045
|
* Checks if a property on a message is considered to be present.
|
|
892
1046
|
* @param {Object} obj Plain object or message instance
|
|
893
1047
|
* @param {string} prop Property name
|
|
894
1048
|
* @returns {boolean} `true` if considered to be present, otherwise `false`
|
|
895
1049
|
*/
|
|
896
|
-
o.isSet = function(
|
|
897
|
-
var
|
|
898
|
-
return
|
|
1050
|
+
o.isSet = function(r, i) {
|
|
1051
|
+
var t = r[i];
|
|
1052
|
+
return t != null && r.hasOwnProperty(i) ? typeof t != "object" || (Array.isArray(t) ? t.length : Object.keys(t).length) > 0 : !1;
|
|
899
1053
|
}, o.Buffer = function() {
|
|
900
1054
|
try {
|
|
901
|
-
var
|
|
902
|
-
return
|
|
1055
|
+
var n = o.inquire("buffer").Buffer;
|
|
1056
|
+
return n.prototype.utf8Write ? n : (
|
|
903
1057
|
/* istanbul ignore next */
|
|
904
1058
|
null
|
|
905
1059
|
);
|
|
906
1060
|
} catch {
|
|
907
1061
|
return null;
|
|
908
1062
|
}
|
|
909
|
-
}(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(
|
|
910
|
-
return typeof
|
|
1063
|
+
}(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(r) {
|
|
1064
|
+
return typeof r == "number" ? o.Buffer ? o._Buffer_allocUnsafe(r) : new o.Array(r) : o.Buffer ? o._Buffer_from(r) : typeof Uint8Array > "u" ? r : new Uint8Array(r);
|
|
911
1065
|
}, o.Array = typeof Uint8Array < "u" ? Uint8Array : Array, o.Long = /* istanbul ignore next */
|
|
912
1066
|
o.global.dcodeIO && /* istanbul ignore next */
|
|
913
1067
|
o.global.dcodeIO.Long || /* istanbul ignore next */
|
|
914
|
-
o.global.Long || o.inquire("long"), o.key2Re = /^true|false|0|1$/, o.key32Re = /^-?(?:0|[1-9][0-9]*)$/, o.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, o.longToHash = function(
|
|
915
|
-
return
|
|
916
|
-
}, o.longFromHash = function(
|
|
917
|
-
var
|
|
918
|
-
return o.Long ? o.Long.fromBits(
|
|
1068
|
+
o.global.Long || o.inquire("long"), o.key2Re = /^true|false|0|1$/, o.key32Re = /^-?(?:0|[1-9][0-9]*)$/, o.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/, o.longToHash = function(r) {
|
|
1069
|
+
return r ? o.LongBits.from(r).toHash() : o.LongBits.zeroHash;
|
|
1070
|
+
}, o.longFromHash = function(r, i) {
|
|
1071
|
+
var t = o.LongBits.fromHash(r);
|
|
1072
|
+
return o.Long ? o.Long.fromBits(t.lo, t.hi, i) : t.toNumber(!!i);
|
|
919
1073
|
};
|
|
920
|
-
function
|
|
921
|
-
for (var
|
|
922
|
-
(
|
|
923
|
-
return
|
|
1074
|
+
function a(n, r, i) {
|
|
1075
|
+
for (var t = Object.keys(r), e = 0; e < t.length; ++e)
|
|
1076
|
+
(n[t[e]] === void 0 || !i) && (n[t[e]] = r[t[e]]);
|
|
1077
|
+
return n;
|
|
924
1078
|
}
|
|
925
|
-
o.merge =
|
|
926
|
-
return
|
|
1079
|
+
o.merge = a, o.lcFirst = function(r) {
|
|
1080
|
+
return r.charAt(0).toLowerCase() + r.substring(1);
|
|
927
1081
|
};
|
|
928
|
-
function
|
|
929
|
-
function
|
|
930
|
-
if (!(this instanceof
|
|
931
|
-
return new
|
|
1082
|
+
function u(n) {
|
|
1083
|
+
function r(i, t) {
|
|
1084
|
+
if (!(this instanceof r))
|
|
1085
|
+
return new r(i, t);
|
|
932
1086
|
Object.defineProperty(this, "message", { get: function() {
|
|
933
1087
|
return i;
|
|
934
|
-
} }), Error.captureStackTrace ? Error.captureStackTrace(this,
|
|
1088
|
+
} }), Error.captureStackTrace ? Error.captureStackTrace(this, r) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), t && a(this, t);
|
|
935
1089
|
}
|
|
936
|
-
return
|
|
1090
|
+
return r.prototype = Object.create(Error.prototype, {
|
|
937
1091
|
constructor: {
|
|
938
|
-
value:
|
|
1092
|
+
value: r,
|
|
939
1093
|
writable: !0,
|
|
940
1094
|
enumerable: !1,
|
|
941
1095
|
configurable: !0
|
|
942
1096
|
},
|
|
943
1097
|
name: {
|
|
944
1098
|
get: function() {
|
|
945
|
-
return
|
|
1099
|
+
return n;
|
|
946
1100
|
},
|
|
947
1101
|
set: void 0,
|
|
948
1102
|
enumerable: !1,
|
|
@@ -960,20 +1114,20 @@ function requireMinimal$1() {
|
|
|
960
1114
|
enumerable: !1,
|
|
961
1115
|
configurable: !0
|
|
962
1116
|
}
|
|
963
|
-
}),
|
|
1117
|
+
}), r;
|
|
964
1118
|
}
|
|
965
|
-
o.newError =
|
|
966
|
-
for (var i = {},
|
|
967
|
-
i[
|
|
1119
|
+
o.newError = u, o.ProtocolError = u("ProtocolError"), o.oneOfGetter = function(r) {
|
|
1120
|
+
for (var i = {}, t = 0; t < r.length; ++t)
|
|
1121
|
+
i[r[t]] = 1;
|
|
968
1122
|
return function() {
|
|
969
|
-
for (var
|
|
970
|
-
if (i[
|
|
971
|
-
return
|
|
1123
|
+
for (var e = Object.keys(this), s = e.length - 1; s > -1; --s)
|
|
1124
|
+
if (i[e[s]] === 1 && this[e[s]] !== void 0 && this[e[s]] !== null)
|
|
1125
|
+
return e[s];
|
|
972
1126
|
};
|
|
973
|
-
}, o.oneOfSetter = function(
|
|
1127
|
+
}, o.oneOfSetter = function(r) {
|
|
974
1128
|
return function(i) {
|
|
975
|
-
for (var
|
|
976
|
-
|
|
1129
|
+
for (var t = 0; t < r.length; ++t)
|
|
1130
|
+
r[t] !== i && delete this[r[t]];
|
|
977
1131
|
};
|
|
978
1132
|
}, o.toJSONOptions = {
|
|
979
1133
|
longs: String,
|
|
@@ -981,17 +1135,17 @@ function requireMinimal$1() {
|
|
|
981
1135
|
bytes: String,
|
|
982
1136
|
json: !0
|
|
983
1137
|
}, o._configure = function() {
|
|
984
|
-
var
|
|
985
|
-
if (!
|
|
1138
|
+
var n = o.Buffer;
|
|
1139
|
+
if (!n) {
|
|
986
1140
|
o._Buffer_from = o._Buffer_allocUnsafe = null;
|
|
987
1141
|
return;
|
|
988
1142
|
}
|
|
989
|
-
o._Buffer_from =
|
|
990
|
-
function(i,
|
|
991
|
-
return new
|
|
992
|
-
}, o._Buffer_allocUnsafe =
|
|
1143
|
+
o._Buffer_from = n.from !== Uint8Array.from && n.from || /* istanbul ignore next */
|
|
1144
|
+
function(i, t) {
|
|
1145
|
+
return new n(i, t);
|
|
1146
|
+
}, o._Buffer_allocUnsafe = n.allocUnsafe || /* istanbul ignore next */
|
|
993
1147
|
function(i) {
|
|
994
|
-
return new
|
|
1148
|
+
return new n(i);
|
|
995
1149
|
};
|
|
996
1150
|
};
|
|
997
1151
|
}(minimal$1)), minimal$1;
|
|
@@ -999,277 +1153,277 @@ function requireMinimal$1() {
|
|
|
999
1153
|
var writer, hasRequiredWriter;
|
|
1000
1154
|
function requireWriter() {
|
|
1001
1155
|
if (hasRequiredWriter) return writer;
|
|
1002
|
-
hasRequiredWriter = 1, writer =
|
|
1003
|
-
var
|
|
1004
|
-
function
|
|
1005
|
-
this.fn = b, this.len =
|
|
1156
|
+
hasRequiredWriter = 1, writer = e;
|
|
1157
|
+
var h = requireMinimal$1(), o, a = h.LongBits, u = h.base64, n = h.utf8;
|
|
1158
|
+
function r(b, g, k) {
|
|
1159
|
+
this.fn = b, this.len = g, this.next = void 0, this.val = k;
|
|
1006
1160
|
}
|
|
1007
1161
|
function i() {
|
|
1008
1162
|
}
|
|
1009
|
-
function
|
|
1163
|
+
function t(b) {
|
|
1010
1164
|
this.head = b.head, this.tail = b.tail, this.len = b.len, this.next = b.states;
|
|
1011
1165
|
}
|
|
1012
|
-
function
|
|
1013
|
-
this.len = 0, this.head = new
|
|
1166
|
+
function e() {
|
|
1167
|
+
this.len = 0, this.head = new r(i, 0, 0), this.tail = this.head, this.states = null;
|
|
1014
1168
|
}
|
|
1015
1169
|
var s = function() {
|
|
1016
|
-
return
|
|
1017
|
-
return (
|
|
1170
|
+
return h.Buffer ? function() {
|
|
1171
|
+
return (e.create = function() {
|
|
1018
1172
|
return new o();
|
|
1019
1173
|
})();
|
|
1020
1174
|
} : function() {
|
|
1021
|
-
return new
|
|
1175
|
+
return new e();
|
|
1022
1176
|
};
|
|
1023
1177
|
};
|
|
1024
|
-
|
|
1025
|
-
return new
|
|
1026
|
-
},
|
|
1027
|
-
return this.tail = this.tail.next = new
|
|
1178
|
+
e.create = s(), e.alloc = function(g) {
|
|
1179
|
+
return new h.Array(g);
|
|
1180
|
+
}, h.Array !== Array && (e.alloc = h.pool(e.alloc, h.Array.prototype.subarray)), e.prototype._push = function(g, k, _) {
|
|
1181
|
+
return this.tail = this.tail.next = new r(g, k, _), this.len += k, this;
|
|
1028
1182
|
};
|
|
1029
|
-
function l(b,
|
|
1030
|
-
|
|
1183
|
+
function l(b, g, k) {
|
|
1184
|
+
g[k] = b & 255;
|
|
1031
1185
|
}
|
|
1032
|
-
function
|
|
1186
|
+
function c(b, g, k) {
|
|
1033
1187
|
for (; b > 127; )
|
|
1034
|
-
|
|
1035
|
-
|
|
1188
|
+
g[k++] = b & 127 | 128, b >>>= 7;
|
|
1189
|
+
g[k] = b;
|
|
1036
1190
|
}
|
|
1037
|
-
function d(b,
|
|
1038
|
-
this.len = b, this.next = void 0, this.val =
|
|
1191
|
+
function d(b, g) {
|
|
1192
|
+
this.len = b, this.next = void 0, this.val = g;
|
|
1039
1193
|
}
|
|
1040
|
-
d.prototype = Object.create(
|
|
1194
|
+
d.prototype = Object.create(r.prototype), d.prototype.fn = c, e.prototype.uint32 = function(g) {
|
|
1041
1195
|
return this.len += (this.tail = this.tail.next = new d(
|
|
1042
|
-
(
|
|
1043
|
-
|
|
1196
|
+
(g = g >>> 0) < 128 ? 1 : g < 16384 ? 2 : g < 2097152 ? 3 : g < 268435456 ? 4 : 5,
|
|
1197
|
+
g
|
|
1044
1198
|
)).len, this;
|
|
1045
|
-
},
|
|
1046
|
-
return
|
|
1047
|
-
},
|
|
1048
|
-
return this.uint32((
|
|
1199
|
+
}, e.prototype.int32 = function(g) {
|
|
1200
|
+
return g < 0 ? this._push(y, 10, a.fromNumber(g)) : this.uint32(g);
|
|
1201
|
+
}, e.prototype.sint32 = function(g) {
|
|
1202
|
+
return this.uint32((g << 1 ^ g >> 31) >>> 0);
|
|
1049
1203
|
};
|
|
1050
|
-
function y(b,
|
|
1204
|
+
function y(b, g, k) {
|
|
1051
1205
|
for (; b.hi; )
|
|
1052
|
-
|
|
1206
|
+
g[k++] = b.lo & 127 | 128, b.lo = (b.lo >>> 7 | b.hi << 25) >>> 0, b.hi >>>= 7;
|
|
1053
1207
|
for (; b.lo > 127; )
|
|
1054
|
-
|
|
1055
|
-
|
|
1208
|
+
g[k++] = b.lo & 127 | 128, b.lo = b.lo >>> 7;
|
|
1209
|
+
g[k++] = b.lo;
|
|
1056
1210
|
}
|
|
1057
|
-
|
|
1058
|
-
var
|
|
1059
|
-
return this._push(y,
|
|
1060
|
-
},
|
|
1061
|
-
var
|
|
1062
|
-
return this._push(y,
|
|
1063
|
-
},
|
|
1064
|
-
return this._push(l, 1,
|
|
1211
|
+
e.prototype.uint64 = function(g) {
|
|
1212
|
+
var k = a.from(g);
|
|
1213
|
+
return this._push(y, k.length(), k);
|
|
1214
|
+
}, e.prototype.int64 = e.prototype.uint64, e.prototype.sint64 = function(g) {
|
|
1215
|
+
var k = a.from(g).zzEncode();
|
|
1216
|
+
return this._push(y, k.length(), k);
|
|
1217
|
+
}, e.prototype.bool = function(g) {
|
|
1218
|
+
return this._push(l, 1, g ? 1 : 0);
|
|
1065
1219
|
};
|
|
1066
|
-
function p(b,
|
|
1067
|
-
|
|
1220
|
+
function p(b, g, k) {
|
|
1221
|
+
g[k] = b & 255, g[k + 1] = b >>> 8 & 255, g[k + 2] = b >>> 16 & 255, g[k + 3] = b >>> 24;
|
|
1068
1222
|
}
|
|
1069
|
-
|
|
1070
|
-
return this._push(p, 4,
|
|
1071
|
-
},
|
|
1072
|
-
var
|
|
1073
|
-
return this._push(p, 4,
|
|
1074
|
-
},
|
|
1075
|
-
return this._push(
|
|
1076
|
-
},
|
|
1077
|
-
return this._push(
|
|
1223
|
+
e.prototype.fixed32 = function(g) {
|
|
1224
|
+
return this._push(p, 4, g >>> 0);
|
|
1225
|
+
}, e.prototype.sfixed32 = e.prototype.fixed32, e.prototype.fixed64 = function(g) {
|
|
1226
|
+
var k = a.from(g);
|
|
1227
|
+
return this._push(p, 4, k.lo)._push(p, 4, k.hi);
|
|
1228
|
+
}, e.prototype.sfixed64 = e.prototype.fixed64, e.prototype.float = function(g) {
|
|
1229
|
+
return this._push(h.float.writeFloatLE, 4, g);
|
|
1230
|
+
}, e.prototype.double = function(g) {
|
|
1231
|
+
return this._push(h.float.writeDoubleLE, 8, g);
|
|
1078
1232
|
};
|
|
1079
|
-
var w =
|
|
1080
|
-
|
|
1081
|
-
} : function(
|
|
1082
|
-
for (var
|
|
1083
|
-
|
|
1233
|
+
var w = h.Array.prototype.set ? function(g, k, _) {
|
|
1234
|
+
k.set(g, _);
|
|
1235
|
+
} : function(g, k, _) {
|
|
1236
|
+
for (var R = 0; R < g.length; ++R)
|
|
1237
|
+
k[_ + R] = g[R];
|
|
1084
1238
|
};
|
|
1085
|
-
return
|
|
1086
|
-
var
|
|
1087
|
-
if (!
|
|
1239
|
+
return e.prototype.bytes = function(g) {
|
|
1240
|
+
var k = g.length >>> 0;
|
|
1241
|
+
if (!k)
|
|
1088
1242
|
return this._push(l, 1, 0);
|
|
1089
|
-
if (
|
|
1090
|
-
var
|
|
1091
|
-
|
|
1243
|
+
if (h.isString(g)) {
|
|
1244
|
+
var _ = e.alloc(k = u.length(g));
|
|
1245
|
+
u.decode(g, _, 0), g = _;
|
|
1092
1246
|
}
|
|
1093
|
-
return this.uint32(
|
|
1094
|
-
},
|
|
1095
|
-
var
|
|
1096
|
-
return
|
|
1097
|
-
},
|
|
1098
|
-
return this.states = new
|
|
1099
|
-
},
|
|
1100
|
-
return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new
|
|
1101
|
-
},
|
|
1102
|
-
var
|
|
1103
|
-
return this.reset().uint32(
|
|
1104
|
-
},
|
|
1105
|
-
for (var
|
|
1106
|
-
|
|
1107
|
-
return
|
|
1108
|
-
},
|
|
1109
|
-
o = b,
|
|
1247
|
+
return this.uint32(k)._push(w, k, g);
|
|
1248
|
+
}, e.prototype.string = function(g) {
|
|
1249
|
+
var k = n.length(g);
|
|
1250
|
+
return k ? this.uint32(k)._push(n.write, k, g) : this._push(l, 1, 0);
|
|
1251
|
+
}, e.prototype.fork = function() {
|
|
1252
|
+
return this.states = new t(this), this.head = this.tail = new r(i, 0, 0), this.len = 0, this;
|
|
1253
|
+
}, e.prototype.reset = function() {
|
|
1254
|
+
return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new r(i, 0, 0), this.len = 0), this;
|
|
1255
|
+
}, e.prototype.ldelim = function() {
|
|
1256
|
+
var g = this.head, k = this.tail, _ = this.len;
|
|
1257
|
+
return this.reset().uint32(_), _ && (this.tail.next = g.next, this.tail = k, this.len += _), this;
|
|
1258
|
+
}, e.prototype.finish = function() {
|
|
1259
|
+
for (var g = this.head.next, k = this.constructor.alloc(this.len), _ = 0; g; )
|
|
1260
|
+
g.fn(g.val, k, _), _ += g.len, g = g.next;
|
|
1261
|
+
return k;
|
|
1262
|
+
}, e._configure = function(b) {
|
|
1263
|
+
o = b, e.create = s(), o._configure();
|
|
1110
1264
|
}, writer;
|
|
1111
1265
|
}
|
|
1112
1266
|
var writer_buffer, hasRequiredWriter_buffer;
|
|
1113
1267
|
function requireWriter_buffer() {
|
|
1114
1268
|
if (hasRequiredWriter_buffer) return writer_buffer;
|
|
1115
|
-
hasRequiredWriter_buffer = 1, writer_buffer =
|
|
1116
|
-
var
|
|
1117
|
-
(
|
|
1269
|
+
hasRequiredWriter_buffer = 1, writer_buffer = a;
|
|
1270
|
+
var h = requireWriter();
|
|
1271
|
+
(a.prototype = Object.create(h.prototype)).constructor = a;
|
|
1118
1272
|
var o = requireMinimal$1();
|
|
1119
|
-
function
|
|
1120
|
-
|
|
1273
|
+
function a() {
|
|
1274
|
+
h.call(this);
|
|
1121
1275
|
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
i.set(
|
|
1125
|
-
} : function(
|
|
1126
|
-
if (
|
|
1127
|
-
|
|
1128
|
-
else for (var
|
|
1129
|
-
i[
|
|
1276
|
+
a._configure = function() {
|
|
1277
|
+
a.alloc = o._Buffer_allocUnsafe, a.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(r, i, t) {
|
|
1278
|
+
i.set(r, t);
|
|
1279
|
+
} : function(r, i, t) {
|
|
1280
|
+
if (r.copy)
|
|
1281
|
+
r.copy(i, t, 0, r.length);
|
|
1282
|
+
else for (var e = 0; e < r.length; )
|
|
1283
|
+
i[t++] = r[e++];
|
|
1130
1284
|
};
|
|
1131
|
-
},
|
|
1132
|
-
o.isString(
|
|
1133
|
-
var i =
|
|
1134
|
-
return this.uint32(i), i && this._push(
|
|
1285
|
+
}, a.prototype.bytes = function(r) {
|
|
1286
|
+
o.isString(r) && (r = o._Buffer_from(r, "base64"));
|
|
1287
|
+
var i = r.length >>> 0;
|
|
1288
|
+
return this.uint32(i), i && this._push(a.writeBytesBuffer, i, r), this;
|
|
1135
1289
|
};
|
|
1136
|
-
function
|
|
1137
|
-
|
|
1290
|
+
function u(n, r, i) {
|
|
1291
|
+
n.length < 40 ? o.utf8.write(n, r, i) : r.utf8Write ? r.utf8Write(n, i) : r.write(n, i);
|
|
1138
1292
|
}
|
|
1139
|
-
return
|
|
1140
|
-
var i = o.Buffer.byteLength(
|
|
1141
|
-
return this.uint32(i), i && this._push(
|
|
1142
|
-
},
|
|
1293
|
+
return a.prototype.string = function(r) {
|
|
1294
|
+
var i = o.Buffer.byteLength(r);
|
|
1295
|
+
return this.uint32(i), i && this._push(u, i, r), this;
|
|
1296
|
+
}, a._configure(), writer_buffer;
|
|
1143
1297
|
}
|
|
1144
1298
|
var reader, hasRequiredReader;
|
|
1145
1299
|
function requireReader() {
|
|
1146
1300
|
if (hasRequiredReader) return reader;
|
|
1147
|
-
hasRequiredReader = 1, reader =
|
|
1148
|
-
var
|
|
1149
|
-
function
|
|
1150
|
-
return RangeError("index out of range: " +
|
|
1301
|
+
hasRequiredReader = 1, reader = r;
|
|
1302
|
+
var h = requireMinimal$1(), o, a = h.LongBits, u = h.utf8;
|
|
1303
|
+
function n(c, d) {
|
|
1304
|
+
return RangeError("index out of range: " + c.pos + " + " + (d || 1) + " > " + c.len);
|
|
1151
1305
|
}
|
|
1152
|
-
function
|
|
1153
|
-
this.buf =
|
|
1306
|
+
function r(c) {
|
|
1307
|
+
this.buf = c, this.pos = 0, this.len = c.length;
|
|
1154
1308
|
}
|
|
1155
1309
|
var i = typeof Uint8Array < "u" ? function(d) {
|
|
1156
1310
|
if (d instanceof Uint8Array || Array.isArray(d))
|
|
1157
|
-
return new
|
|
1311
|
+
return new r(d);
|
|
1158
1312
|
throw Error("illegal buffer");
|
|
1159
1313
|
} : function(d) {
|
|
1160
1314
|
if (Array.isArray(d))
|
|
1161
|
-
return new
|
|
1315
|
+
return new r(d);
|
|
1162
1316
|
throw Error("illegal buffer");
|
|
1163
|
-
},
|
|
1164
|
-
return
|
|
1165
|
-
return (
|
|
1166
|
-
return
|
|
1317
|
+
}, t = function() {
|
|
1318
|
+
return h.Buffer ? function(y) {
|
|
1319
|
+
return (r.create = function(w) {
|
|
1320
|
+
return h.Buffer.isBuffer(w) ? new o(w) : i(w);
|
|
1167
1321
|
})(y);
|
|
1168
1322
|
} : i;
|
|
1169
1323
|
};
|
|
1170
|
-
|
|
1171
|
-
|
|
1324
|
+
r.create = t(), r.prototype._slice = h.Array.prototype.subarray || /* istanbul ignore next */
|
|
1325
|
+
h.Array.prototype.slice, r.prototype.uint32 = /* @__PURE__ */ function() {
|
|
1172
1326
|
var d = 4294967295;
|
|
1173
1327
|
return function() {
|
|
1174
1328
|
if (d = (this.buf[this.pos] & 127) >>> 0, this.buf[this.pos++] < 128 || (d = (d | (this.buf[this.pos] & 127) << 7) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 127) << 14) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 127) << 21) >>> 0, this.buf[this.pos++] < 128) || (d = (d | (this.buf[this.pos] & 15) << 28) >>> 0, this.buf[this.pos++] < 128)) return d;
|
|
1175
1329
|
if ((this.pos += 5) > this.len)
|
|
1176
|
-
throw this.pos = this.len,
|
|
1330
|
+
throw this.pos = this.len, n(this, 10);
|
|
1177
1331
|
return d;
|
|
1178
1332
|
};
|
|
1179
|
-
}(),
|
|
1333
|
+
}(), r.prototype.int32 = function() {
|
|
1180
1334
|
return this.uint32() | 0;
|
|
1181
|
-
},
|
|
1335
|
+
}, r.prototype.sint32 = function() {
|
|
1182
1336
|
var d = this.uint32();
|
|
1183
1337
|
return d >>> 1 ^ -(d & 1) | 0;
|
|
1184
1338
|
};
|
|
1185
|
-
function
|
|
1186
|
-
var
|
|
1339
|
+
function e() {
|
|
1340
|
+
var c = new a(0, 0), d = 0;
|
|
1187
1341
|
if (this.len - this.pos > 4) {
|
|
1188
1342
|
for (; d < 4; ++d)
|
|
1189
|
-
if (
|
|
1190
|
-
return
|
|
1191
|
-
if (
|
|
1192
|
-
return
|
|
1343
|
+
if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
1344
|
+
return c;
|
|
1345
|
+
if (c.lo = (c.lo | (this.buf[this.pos] & 127) << 28) >>> 0, c.hi = (c.hi | (this.buf[this.pos] & 127) >> 4) >>> 0, this.buf[this.pos++] < 128)
|
|
1346
|
+
return c;
|
|
1193
1347
|
d = 0;
|
|
1194
1348
|
} else {
|
|
1195
1349
|
for (; d < 3; ++d) {
|
|
1196
1350
|
if (this.pos >= this.len)
|
|
1197
|
-
throw
|
|
1198
|
-
if (
|
|
1199
|
-
return
|
|
1351
|
+
throw n(this);
|
|
1352
|
+
if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
1353
|
+
return c;
|
|
1200
1354
|
}
|
|
1201
|
-
return
|
|
1355
|
+
return c.lo = (c.lo | (this.buf[this.pos++] & 127) << d * 7) >>> 0, c;
|
|
1202
1356
|
}
|
|
1203
1357
|
if (this.len - this.pos > 4) {
|
|
1204
1358
|
for (; d < 5; ++d)
|
|
1205
|
-
if (
|
|
1206
|
-
return
|
|
1359
|
+
if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
1360
|
+
return c;
|
|
1207
1361
|
} else
|
|
1208
1362
|
for (; d < 5; ++d) {
|
|
1209
1363
|
if (this.pos >= this.len)
|
|
1210
|
-
throw
|
|
1211
|
-
if (
|
|
1212
|
-
return
|
|
1364
|
+
throw n(this);
|
|
1365
|
+
if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
1366
|
+
return c;
|
|
1213
1367
|
}
|
|
1214
1368
|
throw Error("invalid varint encoding");
|
|
1215
1369
|
}
|
|
1216
|
-
|
|
1370
|
+
r.prototype.bool = function() {
|
|
1217
1371
|
return this.uint32() !== 0;
|
|
1218
1372
|
};
|
|
1219
|
-
function s(
|
|
1220
|
-
return (
|
|
1373
|
+
function s(c, d) {
|
|
1374
|
+
return (c[d - 4] | c[d - 3] << 8 | c[d - 2] << 16 | c[d - 1] << 24) >>> 0;
|
|
1221
1375
|
}
|
|
1222
|
-
|
|
1376
|
+
r.prototype.fixed32 = function() {
|
|
1223
1377
|
if (this.pos + 4 > this.len)
|
|
1224
|
-
throw
|
|
1378
|
+
throw n(this, 4);
|
|
1225
1379
|
return s(this.buf, this.pos += 4);
|
|
1226
|
-
},
|
|
1380
|
+
}, r.prototype.sfixed32 = function() {
|
|
1227
1381
|
if (this.pos + 4 > this.len)
|
|
1228
|
-
throw
|
|
1382
|
+
throw n(this, 4);
|
|
1229
1383
|
return s(this.buf, this.pos += 4) | 0;
|
|
1230
1384
|
};
|
|
1231
1385
|
function l() {
|
|
1232
1386
|
if (this.pos + 8 > this.len)
|
|
1233
|
-
throw
|
|
1234
|
-
return new
|
|
1387
|
+
throw n(this, 8);
|
|
1388
|
+
return new a(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
|
|
1235
1389
|
}
|
|
1236
|
-
return
|
|
1390
|
+
return r.prototype.float = function() {
|
|
1237
1391
|
if (this.pos + 4 > this.len)
|
|
1238
|
-
throw
|
|
1239
|
-
var d =
|
|
1392
|
+
throw n(this, 4);
|
|
1393
|
+
var d = h.float.readFloatLE(this.buf, this.pos);
|
|
1240
1394
|
return this.pos += 4, d;
|
|
1241
|
-
},
|
|
1395
|
+
}, r.prototype.double = function() {
|
|
1242
1396
|
if (this.pos + 8 > this.len)
|
|
1243
|
-
throw
|
|
1244
|
-
var d =
|
|
1397
|
+
throw n(this, 4);
|
|
1398
|
+
var d = h.float.readDoubleLE(this.buf, this.pos);
|
|
1245
1399
|
return this.pos += 8, d;
|
|
1246
|
-
},
|
|
1400
|
+
}, r.prototype.bytes = function() {
|
|
1247
1401
|
var d = this.uint32(), y = this.pos, p = this.pos + d;
|
|
1248
1402
|
if (p > this.len)
|
|
1249
|
-
throw
|
|
1403
|
+
throw n(this, d);
|
|
1250
1404
|
if (this.pos += d, Array.isArray(this.buf))
|
|
1251
1405
|
return this.buf.slice(y, p);
|
|
1252
1406
|
if (y === p) {
|
|
1253
|
-
var w =
|
|
1407
|
+
var w = h.Buffer;
|
|
1254
1408
|
return w ? w.alloc(0) : new this.buf.constructor(0);
|
|
1255
1409
|
}
|
|
1256
1410
|
return this._slice.call(this.buf, y, p);
|
|
1257
|
-
},
|
|
1411
|
+
}, r.prototype.string = function() {
|
|
1258
1412
|
var d = this.bytes();
|
|
1259
|
-
return
|
|
1260
|
-
},
|
|
1413
|
+
return u.read(d, 0, d.length);
|
|
1414
|
+
}, r.prototype.skip = function(d) {
|
|
1261
1415
|
if (typeof d == "number") {
|
|
1262
1416
|
if (this.pos + d > this.len)
|
|
1263
|
-
throw
|
|
1417
|
+
throw n(this, d);
|
|
1264
1418
|
this.pos += d;
|
|
1265
1419
|
} else
|
|
1266
1420
|
do
|
|
1267
1421
|
if (this.pos >= this.len)
|
|
1268
|
-
throw
|
|
1422
|
+
throw n(this);
|
|
1269
1423
|
while (this.buf[this.pos++] & 128);
|
|
1270
1424
|
return this;
|
|
1271
|
-
},
|
|
1272
|
-
switch (
|
|
1425
|
+
}, r.prototype.skipType = function(c) {
|
|
1426
|
+
switch (c) {
|
|
1273
1427
|
case 0:
|
|
1274
1428
|
this.skip();
|
|
1275
1429
|
break;
|
|
@@ -1280,32 +1434,32 @@ function requireReader() {
|
|
|
1280
1434
|
this.skip(this.uint32());
|
|
1281
1435
|
break;
|
|
1282
1436
|
case 3:
|
|
1283
|
-
for (; (
|
|
1284
|
-
this.skipType(
|
|
1437
|
+
for (; (c = this.uint32() & 7) !== 4; )
|
|
1438
|
+
this.skipType(c);
|
|
1285
1439
|
break;
|
|
1286
1440
|
case 5:
|
|
1287
1441
|
this.skip(4);
|
|
1288
1442
|
break;
|
|
1289
1443
|
/* istanbul ignore next */
|
|
1290
1444
|
default:
|
|
1291
|
-
throw Error("invalid wire type " +
|
|
1445
|
+
throw Error("invalid wire type " + c + " at offset " + this.pos);
|
|
1292
1446
|
}
|
|
1293
1447
|
return this;
|
|
1294
|
-
},
|
|
1295
|
-
o =
|
|
1296
|
-
var d =
|
|
1448
|
+
}, r._configure = function(c) {
|
|
1449
|
+
o = c, r.create = t(), o._configure();
|
|
1450
|
+
var d = h.Long ? "toLong" : (
|
|
1297
1451
|
/* istanbul ignore next */
|
|
1298
1452
|
"toNumber"
|
|
1299
1453
|
);
|
|
1300
|
-
|
|
1454
|
+
h.merge(r.prototype, {
|
|
1301
1455
|
int64: function() {
|
|
1302
|
-
return
|
|
1456
|
+
return e.call(this)[d](!1);
|
|
1303
1457
|
},
|
|
1304
1458
|
uint64: function() {
|
|
1305
|
-
return
|
|
1459
|
+
return e.call(this)[d](!0);
|
|
1306
1460
|
},
|
|
1307
1461
|
sint64: function() {
|
|
1308
|
-
return
|
|
1462
|
+
return e.call(this).zzDecode()[d](!1);
|
|
1309
1463
|
},
|
|
1310
1464
|
fixed64: function() {
|
|
1311
1465
|
return l.call(this)[d](!0);
|
|
@@ -1319,80 +1473,80 @@ function requireReader() {
|
|
|
1319
1473
|
var reader_buffer, hasRequiredReader_buffer;
|
|
1320
1474
|
function requireReader_buffer() {
|
|
1321
1475
|
if (hasRequiredReader_buffer) return reader_buffer;
|
|
1322
|
-
hasRequiredReader_buffer = 1, reader_buffer =
|
|
1323
|
-
var
|
|
1324
|
-
(
|
|
1476
|
+
hasRequiredReader_buffer = 1, reader_buffer = a;
|
|
1477
|
+
var h = requireReader();
|
|
1478
|
+
(a.prototype = Object.create(h.prototype)).constructor = a;
|
|
1325
1479
|
var o = requireMinimal$1();
|
|
1326
|
-
function u
|
|
1327
|
-
|
|
1480
|
+
function a(u) {
|
|
1481
|
+
h.call(this, u);
|
|
1328
1482
|
}
|
|
1329
|
-
return
|
|
1330
|
-
o.Buffer && (
|
|
1331
|
-
},
|
|
1332
|
-
var
|
|
1333
|
-
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos +
|
|
1334
|
-
},
|
|
1483
|
+
return a._configure = function() {
|
|
1484
|
+
o.Buffer && (a.prototype._slice = o.Buffer.prototype.slice);
|
|
1485
|
+
}, a.prototype.string = function() {
|
|
1486
|
+
var n = this.uint32();
|
|
1487
|
+
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + n, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + n, this.len));
|
|
1488
|
+
}, a._configure(), reader_buffer;
|
|
1335
1489
|
}
|
|
1336
1490
|
var rpc = {}, service, hasRequiredService;
|
|
1337
1491
|
function requireService() {
|
|
1338
1492
|
if (hasRequiredService) return service;
|
|
1339
1493
|
hasRequiredService = 1, service = o;
|
|
1340
|
-
var
|
|
1341
|
-
(o.prototype = Object.create(
|
|
1342
|
-
function o(
|
|
1343
|
-
if (typeof
|
|
1494
|
+
var h = requireMinimal$1();
|
|
1495
|
+
(o.prototype = Object.create(h.EventEmitter.prototype)).constructor = o;
|
|
1496
|
+
function o(a, u, n) {
|
|
1497
|
+
if (typeof a != "function")
|
|
1344
1498
|
throw TypeError("rpcImpl must be a function");
|
|
1345
|
-
|
|
1499
|
+
h.EventEmitter.call(this), this.rpcImpl = a, this.requestDelimited = !!u, this.responseDelimited = !!n;
|
|
1346
1500
|
}
|
|
1347
|
-
return o.prototype.rpcCall = function u
|
|
1501
|
+
return o.prototype.rpcCall = function a(u, n, r, i, t) {
|
|
1348
1502
|
if (!i)
|
|
1349
1503
|
throw TypeError("request must be specified");
|
|
1350
|
-
var
|
|
1351
|
-
if (!
|
|
1352
|
-
return
|
|
1353
|
-
if (!
|
|
1504
|
+
var e = this;
|
|
1505
|
+
if (!t)
|
|
1506
|
+
return h.asPromise(a, e, u, n, r, i);
|
|
1507
|
+
if (!e.rpcImpl) {
|
|
1354
1508
|
setTimeout(function() {
|
|
1355
|
-
|
|
1509
|
+
t(Error("already ended"));
|
|
1356
1510
|
}, 0);
|
|
1357
1511
|
return;
|
|
1358
1512
|
}
|
|
1359
1513
|
try {
|
|
1360
|
-
return
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
function(l,
|
|
1514
|
+
return e.rpcImpl(
|
|
1515
|
+
u,
|
|
1516
|
+
n[e.requestDelimited ? "encodeDelimited" : "encode"](i).finish(),
|
|
1517
|
+
function(l, c) {
|
|
1364
1518
|
if (l)
|
|
1365
|
-
return
|
|
1366
|
-
if (
|
|
1367
|
-
|
|
1519
|
+
return e.emit("error", l, u), t(l);
|
|
1520
|
+
if (c === null) {
|
|
1521
|
+
e.end(
|
|
1368
1522
|
/* endedByRPC */
|
|
1369
1523
|
!0
|
|
1370
1524
|
);
|
|
1371
1525
|
return;
|
|
1372
1526
|
}
|
|
1373
|
-
if (!(
|
|
1527
|
+
if (!(c instanceof r))
|
|
1374
1528
|
try {
|
|
1375
|
-
|
|
1529
|
+
c = r[e.responseDelimited ? "decodeDelimited" : "decode"](c);
|
|
1376
1530
|
} catch (d) {
|
|
1377
|
-
return
|
|
1531
|
+
return e.emit("error", d, u), t(d);
|
|
1378
1532
|
}
|
|
1379
|
-
return
|
|
1533
|
+
return e.emit("data", c, u), t(null, c);
|
|
1380
1534
|
}
|
|
1381
1535
|
);
|
|
1382
1536
|
} catch (s) {
|
|
1383
|
-
|
|
1384
|
-
|
|
1537
|
+
e.emit("error", s, u), setTimeout(function() {
|
|
1538
|
+
t(s);
|
|
1385
1539
|
}, 0);
|
|
1386
1540
|
return;
|
|
1387
1541
|
}
|
|
1388
|
-
}, o.prototype.end = function(
|
|
1389
|
-
return this.rpcImpl && (
|
|
1542
|
+
}, o.prototype.end = function(u) {
|
|
1543
|
+
return this.rpcImpl && (u || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
|
|
1390
1544
|
}, service;
|
|
1391
1545
|
}
|
|
1392
1546
|
var hasRequiredRpc;
|
|
1393
1547
|
function requireRpc() {
|
|
1394
|
-
return hasRequiredRpc || (hasRequiredRpc = 1, function(
|
|
1395
|
-
var o =
|
|
1548
|
+
return hasRequiredRpc || (hasRequiredRpc = 1, function(h) {
|
|
1549
|
+
var o = h;
|
|
1396
1550
|
o.Service = requireService();
|
|
1397
1551
|
}(rpc)), rpc;
|
|
1398
1552
|
}
|
|
@@ -1402,13 +1556,13 @@ function requireRoots() {
|
|
|
1402
1556
|
}
|
|
1403
1557
|
var hasRequiredIndexMinimal;
|
|
1404
1558
|
function requireIndexMinimal() {
|
|
1405
|
-
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(
|
|
1406
|
-
var o =
|
|
1407
|
-
o.build = "minimal", o.Writer = requireWriter(), o.BufferWriter = requireWriter_buffer(), o.Reader = requireReader(), o.BufferReader = requireReader_buffer(), o.util = requireMinimal$1(), o.rpc = requireRpc(), o.roots = requireRoots(), o.configure =
|
|
1408
|
-
function
|
|
1559
|
+
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(h) {
|
|
1560
|
+
var o = h;
|
|
1561
|
+
o.build = "minimal", o.Writer = requireWriter(), o.BufferWriter = requireWriter_buffer(), o.Reader = requireReader(), o.BufferReader = requireReader_buffer(), o.util = requireMinimal$1(), o.rpc = requireRpc(), o.roots = requireRoots(), o.configure = a;
|
|
1562
|
+
function a() {
|
|
1409
1563
|
o.util._configure(), o.Writer._configure(o.BufferWriter), o.Reader._configure(o.BufferReader);
|
|
1410
1564
|
}
|
|
1411
|
-
|
|
1565
|
+
a();
|
|
1412
1566
|
}(indexMinimal)), indexMinimal;
|
|
1413
1567
|
}
|
|
1414
1568
|
var minimal, hasRequiredMinimal;
|
|
@@ -1417,42 +1571,42 @@ function requireMinimal() {
|
|
|
1417
1571
|
}
|
|
1418
1572
|
var minimalExports = requireMinimal();
|
|
1419
1573
|
const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util = minimalExports.util, $root = minimalExports.roots.default || (minimalExports.roots.default = {}), com = $root.com = (() => {
|
|
1420
|
-
const
|
|
1421
|
-
return
|
|
1574
|
+
const h = {};
|
|
1575
|
+
return h.quick = function() {
|
|
1422
1576
|
const o = {};
|
|
1423
1577
|
return o.voice = function() {
|
|
1424
|
-
const
|
|
1425
|
-
return
|
|
1426
|
-
const
|
|
1427
|
-
return
|
|
1428
|
-
function r
|
|
1429
|
-
if (
|
|
1578
|
+
const a = {};
|
|
1579
|
+
return a.proto = function() {
|
|
1580
|
+
const u = {};
|
|
1581
|
+
return u.SeiData = function() {
|
|
1582
|
+
function n(r) {
|
|
1583
|
+
if (r) for (let i = Object.keys(r), t = 0; t < i.length; ++t) r[i[t]] != null && (this[i[t]] = r[i[t]]);
|
|
1430
1584
|
}
|
|
1431
|
-
return
|
|
1432
|
-
return new
|
|
1433
|
-
},
|
|
1434
|
-
return
|
|
1585
|
+
return n.prototype.event = 0, n.prototype.data = $util.newBuffer([]), n.prototype.compress = !1, n.prototype.version = 0, n.create = function(i) {
|
|
1586
|
+
return new n(i);
|
|
1587
|
+
}, n.encode = function(i, t) {
|
|
1588
|
+
return t || (t = $Writer.create()), i.event != null && Object.hasOwnProperty.call(i, "event") && t.uint32(
|
|
1435
1589
|
/* id 1, wireType 0 =*/
|
|
1436
1590
|
8
|
|
1437
|
-
).int32(i.event), i.data != null && Object.hasOwnProperty.call(i, "data") &&
|
|
1591
|
+
).int32(i.event), i.data != null && Object.hasOwnProperty.call(i, "data") && t.uint32(
|
|
1438
1592
|
/* id 2, wireType 2 =*/
|
|
1439
1593
|
18
|
|
1440
|
-
).bytes(i.data), i.compress != null && Object.hasOwnProperty.call(i, "compress") &&
|
|
1594
|
+
).bytes(i.data), i.compress != null && Object.hasOwnProperty.call(i, "compress") && t.uint32(
|
|
1441
1595
|
/* id 3, wireType 0 =*/
|
|
1442
1596
|
24
|
|
1443
|
-
).bool(i.compress), i.version != null && Object.hasOwnProperty.call(i, "version") &&
|
|
1597
|
+
).bool(i.compress), i.version != null && Object.hasOwnProperty.call(i, "version") && t.uint32(
|
|
1444
1598
|
/* id 4, wireType 0 =*/
|
|
1445
1599
|
32
|
|
1446
|
-
).int32(i.version),
|
|
1447
|
-
},
|
|
1448
|
-
return this.encode(i,
|
|
1449
|
-
},
|
|
1600
|
+
).int32(i.version), t;
|
|
1601
|
+
}, n.encodeDelimited = function(i, t) {
|
|
1602
|
+
return this.encode(i, t).ldelim();
|
|
1603
|
+
}, n.decode = function(i, t, e) {
|
|
1450
1604
|
i instanceof $Reader || (i = $Reader.create(i));
|
|
1451
|
-
let s =
|
|
1605
|
+
let s = t === void 0 ? i.len : i.pos + t, l = new $root.com.quick.voice.proto.SeiData();
|
|
1452
1606
|
for (; i.pos < s; ) {
|
|
1453
|
-
let
|
|
1454
|
-
if (
|
|
1455
|
-
switch (
|
|
1607
|
+
let c = i.uint32();
|
|
1608
|
+
if (c === e) break;
|
|
1609
|
+
switch (c >>> 3) {
|
|
1456
1610
|
case 1: {
|
|
1457
1611
|
l.event = i.int32();
|
|
1458
1612
|
break;
|
|
@@ -1470,14 +1624,14 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1470
1624
|
break;
|
|
1471
1625
|
}
|
|
1472
1626
|
default:
|
|
1473
|
-
i.skipType(
|
|
1627
|
+
i.skipType(c & 7);
|
|
1474
1628
|
break;
|
|
1475
1629
|
}
|
|
1476
1630
|
}
|
|
1477
1631
|
return l;
|
|
1478
|
-
},
|
|
1632
|
+
}, n.decodeDelimited = function(i) {
|
|
1479
1633
|
return i instanceof $Reader || (i = new $Reader(i)), this.decode(i, i.uint32());
|
|
1480
|
-
},
|
|
1634
|
+
}, n.verify = function(i) {
|
|
1481
1635
|
if (typeof i != "object" || i === null) return "object expected";
|
|
1482
1636
|
if (i.event != null && i.hasOwnProperty("event"))
|
|
1483
1637
|
switch (i.event) {
|
|
@@ -1488,126 +1642,126 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1488
1642
|
break;
|
|
1489
1643
|
}
|
|
1490
1644
|
return i.data != null && i.hasOwnProperty("data") && !(i.data && typeof i.data.length == "number" || $util.isString(i.data)) ? "data: buffer expected" : i.compress != null && i.hasOwnProperty("compress") && typeof i.compress != "boolean" ? "compress: boolean expected" : i.version != null && i.hasOwnProperty("version") && !$util.isInteger(i.version) ? "version: integer expected" : null;
|
|
1491
|
-
},
|
|
1645
|
+
}, n.fromObject = function(i) {
|
|
1492
1646
|
if (i instanceof $root.com.quick.voice.proto.SeiData) return i;
|
|
1493
|
-
let
|
|
1647
|
+
let t = new $root.com.quick.voice.proto.SeiData();
|
|
1494
1648
|
switch (i.event) {
|
|
1495
1649
|
default:
|
|
1496
1650
|
if (typeof i.event == "number") {
|
|
1497
|
-
|
|
1651
|
+
t.event = i.event;
|
|
1498
1652
|
break;
|
|
1499
1653
|
}
|
|
1500
1654
|
break;
|
|
1501
1655
|
case "Layout":
|
|
1502
1656
|
case 0:
|
|
1503
|
-
|
|
1657
|
+
t.event = 0;
|
|
1504
1658
|
break;
|
|
1505
1659
|
case "Custom":
|
|
1506
1660
|
case 1:
|
|
1507
|
-
|
|
1661
|
+
t.event = 1;
|
|
1508
1662
|
break;
|
|
1509
1663
|
}
|
|
1510
|
-
return i.data != null && (typeof i.data == "string" ? $util.base64.decode(i.data,
|
|
1511
|
-
},
|
|
1512
|
-
|
|
1513
|
-
let
|
|
1514
|
-
return
|
|
1515
|
-
},
|
|
1664
|
+
return i.data != null && (typeof i.data == "string" ? $util.base64.decode(i.data, t.data = $util.newBuffer($util.base64.length(i.data)), 0) : i.data.length >= 0 && (t.data = i.data)), i.compress != null && (t.compress = !!i.compress), i.version != null && (t.version = i.version | 0), t;
|
|
1665
|
+
}, n.toObject = function(i, t) {
|
|
1666
|
+
t || (t = {});
|
|
1667
|
+
let e = {};
|
|
1668
|
+
return t.defaults && (e.event = t.enums === String ? "Layout" : 0, t.bytes === String ? e.data = "" : (e.data = [], t.bytes !== Array && (e.data = $util.newBuffer(e.data))), e.compress = !1, e.version = 0), i.event != null && i.hasOwnProperty("event") && (e.event = t.enums === String ? $root.com.quick.voice.proto.EventType[i.event] === void 0 ? i.event : $root.com.quick.voice.proto.EventType[i.event] : i.event), i.data != null && i.hasOwnProperty("data") && (e.data = t.bytes === String ? $util.base64.encode(i.data, 0, i.data.length) : t.bytes === Array ? Array.prototype.slice.call(i.data) : i.data), i.compress != null && i.hasOwnProperty("compress") && (e.compress = i.compress), i.version != null && i.hasOwnProperty("version") && (e.version = i.version), e;
|
|
1669
|
+
}, n.prototype.toJSON = function() {
|
|
1516
1670
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1517
|
-
},
|
|
1671
|
+
}, n.getTypeUrl = function(i) {
|
|
1518
1672
|
return i === void 0 && (i = "type.googleapis.com"), i + "/com.quick.voice.proto.SeiData";
|
|
1519
|
-
},
|
|
1520
|
-
}(),
|
|
1521
|
-
const
|
|
1522
|
-
return n[
|
|
1523
|
-
}(),
|
|
1524
|
-
function
|
|
1525
|
-
if (this.userMap = {}, i) for (let
|
|
1673
|
+
}, n;
|
|
1674
|
+
}(), u.EventType = function() {
|
|
1675
|
+
const n = {}, r = Object.create(n);
|
|
1676
|
+
return r[n[0] = "Layout"] = 0, r[n[1] = "Custom"] = 1, r;
|
|
1677
|
+
}(), u.LayoutData = function() {
|
|
1678
|
+
function n(i) {
|
|
1679
|
+
if (this.userMap = {}, i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1526
1680
|
}
|
|
1527
|
-
|
|
1528
|
-
let
|
|
1529
|
-
return Object.defineProperty(
|
|
1530
|
-
get: $util.oneOfGetter(
|
|
1531
|
-
set: $util.oneOfSetter(
|
|
1532
|
-
}),
|
|
1533
|
-
return new
|
|
1534
|
-
},
|
|
1535
|
-
if (
|
|
1681
|
+
n.prototype.roomId = "", n.prototype.type = 0, n.prototype.userMap = $util.emptyObject, n.prototype.globalCustom = null;
|
|
1682
|
+
let r;
|
|
1683
|
+
return Object.defineProperty(n.prototype, "_globalCustom", {
|
|
1684
|
+
get: $util.oneOfGetter(r = ["globalCustom"]),
|
|
1685
|
+
set: $util.oneOfSetter(r)
|
|
1686
|
+
}), n.create = function(t) {
|
|
1687
|
+
return new n(t);
|
|
1688
|
+
}, n.encode = function(t, e) {
|
|
1689
|
+
if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
|
|
1536
1690
|
/* id 1, wireType 2 =*/
|
|
1537
1691
|
10
|
|
1538
|
-
).string(
|
|
1692
|
+
).string(t.roomId), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
1539
1693
|
/* id 2, wireType 0 =*/
|
|
1540
1694
|
16
|
|
1541
|
-
).int32(
|
|
1542
|
-
for (let s = Object.keys(
|
|
1543
|
-
|
|
1695
|
+
).int32(t.type), t.userMap != null && Object.hasOwnProperty.call(t, "userMap"))
|
|
1696
|
+
for (let s = Object.keys(t.userMap), l = 0; l < s.length; ++l)
|
|
1697
|
+
e.uint32(
|
|
1544
1698
|
/* id 3, wireType 2 =*/
|
|
1545
1699
|
26
|
|
1546
1700
|
).fork().uint32(
|
|
1547
1701
|
/* id 1, wireType 2 =*/
|
|
1548
1702
|
10
|
|
1549
|
-
).string(s[l]), $root.com.quick.voice.proto.UserInfo.encode(
|
|
1703
|
+
).string(s[l]), $root.com.quick.voice.proto.UserInfo.encode(t.userMap[s[l]], e.uint32(
|
|
1550
1704
|
/* id 2, wireType 2 =*/
|
|
1551
1705
|
18
|
|
1552
1706
|
).fork()).ldelim().ldelim();
|
|
1553
|
-
return
|
|
1707
|
+
return t.globalCustom != null && Object.hasOwnProperty.call(t, "globalCustom") && $root.com.quick.voice.proto.CustomInfo.encode(t.globalCustom, e.uint32(
|
|
1554
1708
|
/* id 4, wireType 2 =*/
|
|
1555
1709
|
34
|
|
1556
|
-
).fork()).ldelim(),
|
|
1557
|
-
},
|
|
1558
|
-
return this.encode(
|
|
1559
|
-
},
|
|
1560
|
-
|
|
1561
|
-
let l =
|
|
1562
|
-
for (;
|
|
1563
|
-
let p =
|
|
1710
|
+
).fork()).ldelim(), e;
|
|
1711
|
+
}, n.encodeDelimited = function(t, e) {
|
|
1712
|
+
return this.encode(t, e).ldelim();
|
|
1713
|
+
}, n.decode = function(t, e, s) {
|
|
1714
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
1715
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.LayoutData(), d, y;
|
|
1716
|
+
for (; t.pos < l; ) {
|
|
1717
|
+
let p = t.uint32();
|
|
1564
1718
|
if (p === s) break;
|
|
1565
1719
|
switch (p >>> 3) {
|
|
1566
1720
|
case 1: {
|
|
1567
|
-
|
|
1721
|
+
c.roomId = t.string();
|
|
1568
1722
|
break;
|
|
1569
1723
|
}
|
|
1570
1724
|
case 2: {
|
|
1571
|
-
|
|
1725
|
+
c.type = t.int32();
|
|
1572
1726
|
break;
|
|
1573
1727
|
}
|
|
1574
1728
|
case 3: {
|
|
1575
|
-
|
|
1576
|
-
let w =
|
|
1577
|
-
for (d = "", y = null;
|
|
1578
|
-
let b =
|
|
1729
|
+
c.userMap === $util.emptyObject && (c.userMap = {});
|
|
1730
|
+
let w = t.uint32() + t.pos;
|
|
1731
|
+
for (d = "", y = null; t.pos < w; ) {
|
|
1732
|
+
let b = t.uint32();
|
|
1579
1733
|
switch (b >>> 3) {
|
|
1580
1734
|
case 1:
|
|
1581
|
-
d =
|
|
1735
|
+
d = t.string();
|
|
1582
1736
|
break;
|
|
1583
1737
|
case 2:
|
|
1584
|
-
y = $root.com.quick.voice.proto.UserInfo.decode(
|
|
1738
|
+
y = $root.com.quick.voice.proto.UserInfo.decode(t, t.uint32());
|
|
1585
1739
|
break;
|
|
1586
1740
|
default:
|
|
1587
|
-
|
|
1741
|
+
t.skipType(b & 7);
|
|
1588
1742
|
break;
|
|
1589
1743
|
}
|
|
1590
1744
|
}
|
|
1591
|
-
|
|
1745
|
+
c.userMap[d] = y;
|
|
1592
1746
|
break;
|
|
1593
1747
|
}
|
|
1594
1748
|
case 4: {
|
|
1595
|
-
|
|
1749
|
+
c.globalCustom = $root.com.quick.voice.proto.CustomInfo.decode(t, t.uint32());
|
|
1596
1750
|
break;
|
|
1597
1751
|
}
|
|
1598
1752
|
default:
|
|
1599
|
-
|
|
1753
|
+
t.skipType(p & 7);
|
|
1600
1754
|
break;
|
|
1601
1755
|
}
|
|
1602
1756
|
}
|
|
1603
|
-
return
|
|
1604
|
-
},
|
|
1605
|
-
return
|
|
1606
|
-
},
|
|
1607
|
-
if (typeof
|
|
1608
|
-
if (
|
|
1609
|
-
if (
|
|
1610
|
-
switch (
|
|
1757
|
+
return c;
|
|
1758
|
+
}, n.decodeDelimited = function(t) {
|
|
1759
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
1760
|
+
}, n.verify = function(t) {
|
|
1761
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
1762
|
+
if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
|
|
1763
|
+
if (t.type != null && t.hasOwnProperty("type"))
|
|
1764
|
+
switch (t.type) {
|
|
1611
1765
|
default:
|
|
1612
1766
|
return "type: enum value expected";
|
|
1613
1767
|
case 0:
|
|
@@ -1615,440 +1769,440 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1615
1769
|
case 2:
|
|
1616
1770
|
break;
|
|
1617
1771
|
}
|
|
1618
|
-
if (
|
|
1619
|
-
if (!$util.isObject(
|
|
1620
|
-
let
|
|
1621
|
-
for (let s = 0; s <
|
|
1622
|
-
let l = $root.com.quick.voice.proto.UserInfo.verify(
|
|
1772
|
+
if (t.userMap != null && t.hasOwnProperty("userMap")) {
|
|
1773
|
+
if (!$util.isObject(t.userMap)) return "userMap: object expected";
|
|
1774
|
+
let e = Object.keys(t.userMap);
|
|
1775
|
+
for (let s = 0; s < e.length; ++s) {
|
|
1776
|
+
let l = $root.com.quick.voice.proto.UserInfo.verify(t.userMap[e[s]]);
|
|
1623
1777
|
if (l) return "userMap." + l;
|
|
1624
1778
|
}
|
|
1625
1779
|
}
|
|
1626
|
-
if (
|
|
1627
|
-
let
|
|
1628
|
-
if (
|
|
1780
|
+
if (t.globalCustom != null && t.hasOwnProperty("globalCustom")) {
|
|
1781
|
+
let e = $root.com.quick.voice.proto.CustomInfo.verify(t.globalCustom);
|
|
1782
|
+
if (e) return "globalCustom." + e;
|
|
1629
1783
|
}
|
|
1630
1784
|
return null;
|
|
1631
|
-
},
|
|
1632
|
-
if (
|
|
1633
|
-
let
|
|
1634
|
-
switch (
|
|
1785
|
+
}, n.fromObject = function(t) {
|
|
1786
|
+
if (t instanceof $root.com.quick.voice.proto.LayoutData) return t;
|
|
1787
|
+
let e = new $root.com.quick.voice.proto.LayoutData();
|
|
1788
|
+
switch (t.roomId != null && (e.roomId = String(t.roomId)), t.type) {
|
|
1635
1789
|
default:
|
|
1636
|
-
if (typeof
|
|
1637
|
-
|
|
1790
|
+
if (typeof t.type == "number") {
|
|
1791
|
+
e.type = t.type;
|
|
1638
1792
|
break;
|
|
1639
1793
|
}
|
|
1640
1794
|
break;
|
|
1641
1795
|
case "AudioAndVideo":
|
|
1642
1796
|
case 0:
|
|
1643
|
-
|
|
1797
|
+
e.type = 0;
|
|
1644
1798
|
break;
|
|
1645
1799
|
case "OnlyAudio":
|
|
1646
1800
|
case 1:
|
|
1647
|
-
|
|
1801
|
+
e.type = 1;
|
|
1648
1802
|
break;
|
|
1649
1803
|
case "OnlyVideo":
|
|
1650
1804
|
case 2:
|
|
1651
|
-
|
|
1805
|
+
e.type = 2;
|
|
1652
1806
|
break;
|
|
1653
1807
|
}
|
|
1654
|
-
if (
|
|
1655
|
-
if (typeof
|
|
1656
|
-
|
|
1657
|
-
for (let s = Object.keys(
|
|
1658
|
-
if (typeof
|
|
1659
|
-
|
|
1808
|
+
if (t.userMap) {
|
|
1809
|
+
if (typeof t.userMap != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
|
|
1810
|
+
e.userMap = {};
|
|
1811
|
+
for (let s = Object.keys(t.userMap), l = 0; l < s.length; ++l) {
|
|
1812
|
+
if (typeof t.userMap[s[l]] != "object") throw TypeError(".com.quick.voice.proto.LayoutData.userMap: object expected");
|
|
1813
|
+
e.userMap[s[l]] = $root.com.quick.voice.proto.UserInfo.fromObject(t.userMap[s[l]]);
|
|
1660
1814
|
}
|
|
1661
1815
|
}
|
|
1662
|
-
if (
|
|
1663
|
-
if (typeof
|
|
1664
|
-
|
|
1816
|
+
if (t.globalCustom != null) {
|
|
1817
|
+
if (typeof t.globalCustom != "object") throw TypeError(".com.quick.voice.proto.LayoutData.globalCustom: object expected");
|
|
1818
|
+
e.globalCustom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.globalCustom);
|
|
1665
1819
|
}
|
|
1666
|
-
return
|
|
1667
|
-
},
|
|
1668
|
-
|
|
1820
|
+
return e;
|
|
1821
|
+
}, n.toObject = function(t, e) {
|
|
1822
|
+
e || (e = {});
|
|
1669
1823
|
let s = {};
|
|
1670
|
-
(
|
|
1824
|
+
(e.objects || e.defaults) && (s.userMap = {}), e.defaults && (s.roomId = "", s.type = e.enums === String ? "AudioAndVideo" : 0), t.roomId != null && t.hasOwnProperty("roomId") && (s.roomId = t.roomId), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.LayoutType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.LayoutType[t.type] : t.type);
|
|
1671
1825
|
let l;
|
|
1672
|
-
if (
|
|
1826
|
+
if (t.userMap && (l = Object.keys(t.userMap)).length) {
|
|
1673
1827
|
s.userMap = {};
|
|
1674
|
-
for (let
|
|
1828
|
+
for (let c = 0; c < l.length; ++c) s.userMap[l[c]] = $root.com.quick.voice.proto.UserInfo.toObject(t.userMap[l[c]], e);
|
|
1675
1829
|
}
|
|
1676
|
-
return
|
|
1677
|
-
},
|
|
1830
|
+
return t.globalCustom != null && t.hasOwnProperty("globalCustom") && (s.globalCustom = $root.com.quick.voice.proto.CustomInfo.toObject(t.globalCustom, e), e.oneofs && (s._globalCustom = "globalCustom")), s;
|
|
1831
|
+
}, n.prototype.toJSON = function() {
|
|
1678
1832
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1679
|
-
},
|
|
1680
|
-
return
|
|
1681
|
-
},
|
|
1682
|
-
}(),
|
|
1683
|
-
function
|
|
1684
|
-
if (this.audios = [], this.videos = [], i) for (let
|
|
1833
|
+
}, n.getTypeUrl = function(t) {
|
|
1834
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.LayoutData";
|
|
1835
|
+
}, n;
|
|
1836
|
+
}(), u.UserInfo = function() {
|
|
1837
|
+
function n(i) {
|
|
1838
|
+
if (this.audios = [], this.videos = [], i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1685
1839
|
}
|
|
1686
|
-
|
|
1687
|
-
let
|
|
1688
|
-
return Object.defineProperty(
|
|
1689
|
-
get: $util.oneOfGetter(
|
|
1690
|
-
set: $util.oneOfSetter(
|
|
1691
|
-
}),
|
|
1692
|
-
return new
|
|
1693
|
-
},
|
|
1694
|
-
if (
|
|
1840
|
+
n.prototype.id = "", n.prototype.audios = $util.emptyArray, n.prototype.videos = $util.emptyArray, n.prototype.custom = null;
|
|
1841
|
+
let r;
|
|
1842
|
+
return Object.defineProperty(n.prototype, "_custom", {
|
|
1843
|
+
get: $util.oneOfGetter(r = ["custom"]),
|
|
1844
|
+
set: $util.oneOfSetter(r)
|
|
1845
|
+
}), n.create = function(t) {
|
|
1846
|
+
return new n(t);
|
|
1847
|
+
}, n.encode = function(t, e) {
|
|
1848
|
+
if (e || (e = $Writer.create()), t.id != null && Object.hasOwnProperty.call(t, "id") && e.uint32(
|
|
1695
1849
|
/* id 1, wireType 2 =*/
|
|
1696
1850
|
10
|
|
1697
|
-
).string(
|
|
1851
|
+
).string(t.id), t.audios != null && t.audios.length) for (let s = 0; s < t.audios.length; ++s) $root.com.quick.voice.proto.AudioInfo.encode(t.audios[s], e.uint32(
|
|
1698
1852
|
/* id 2, wireType 2 =*/
|
|
1699
1853
|
18
|
|
1700
1854
|
).fork()).ldelim();
|
|
1701
|
-
if (
|
|
1855
|
+
if (t.videos != null && t.videos.length) for (let s = 0; s < t.videos.length; ++s) $root.com.quick.voice.proto.VideoInfo.encode(t.videos[s], e.uint32(
|
|
1702
1856
|
/* id 3, wireType 2 =*/
|
|
1703
1857
|
26
|
|
1704
1858
|
).fork()).ldelim();
|
|
1705
|
-
return
|
|
1859
|
+
return t.custom != null && Object.hasOwnProperty.call(t, "custom") && $root.com.quick.voice.proto.CustomInfo.encode(t.custom, e.uint32(
|
|
1706
1860
|
/* id 4, wireType 2 =*/
|
|
1707
1861
|
34
|
|
1708
|
-
).fork()).ldelim(),
|
|
1709
|
-
},
|
|
1710
|
-
return this.encode(
|
|
1711
|
-
},
|
|
1712
|
-
|
|
1713
|
-
let l =
|
|
1714
|
-
for (;
|
|
1715
|
-
let d =
|
|
1862
|
+
).fork()).ldelim(), e;
|
|
1863
|
+
}, n.encodeDelimited = function(t, e) {
|
|
1864
|
+
return this.encode(t, e).ldelim();
|
|
1865
|
+
}, n.decode = function(t, e, s) {
|
|
1866
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
1867
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.UserInfo();
|
|
1868
|
+
for (; t.pos < l; ) {
|
|
1869
|
+
let d = t.uint32();
|
|
1716
1870
|
if (d === s) break;
|
|
1717
1871
|
switch (d >>> 3) {
|
|
1718
1872
|
case 1: {
|
|
1719
|
-
|
|
1873
|
+
c.id = t.string();
|
|
1720
1874
|
break;
|
|
1721
1875
|
}
|
|
1722
1876
|
case 2: {
|
|
1723
|
-
|
|
1877
|
+
c.audios && c.audios.length || (c.audios = []), c.audios.push($root.com.quick.voice.proto.AudioInfo.decode(t, t.uint32()));
|
|
1724
1878
|
break;
|
|
1725
1879
|
}
|
|
1726
1880
|
case 3: {
|
|
1727
|
-
|
|
1881
|
+
c.videos && c.videos.length || (c.videos = []), c.videos.push($root.com.quick.voice.proto.VideoInfo.decode(t, t.uint32()));
|
|
1728
1882
|
break;
|
|
1729
1883
|
}
|
|
1730
1884
|
case 4: {
|
|
1731
|
-
|
|
1885
|
+
c.custom = $root.com.quick.voice.proto.CustomInfo.decode(t, t.uint32());
|
|
1732
1886
|
break;
|
|
1733
1887
|
}
|
|
1734
1888
|
default:
|
|
1735
|
-
|
|
1889
|
+
t.skipType(d & 7);
|
|
1736
1890
|
break;
|
|
1737
1891
|
}
|
|
1738
1892
|
}
|
|
1739
|
-
return
|
|
1740
|
-
},
|
|
1741
|
-
return
|
|
1742
|
-
},
|
|
1743
|
-
if (typeof
|
|
1744
|
-
if (
|
|
1745
|
-
if (
|
|
1746
|
-
if (!Array.isArray(
|
|
1747
|
-
for (let
|
|
1748
|
-
let s = $root.com.quick.voice.proto.AudioInfo.verify(
|
|
1893
|
+
return c;
|
|
1894
|
+
}, n.decodeDelimited = function(t) {
|
|
1895
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
1896
|
+
}, n.verify = function(t) {
|
|
1897
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
1898
|
+
if (t.id != null && t.hasOwnProperty("id") && !$util.isString(t.id)) return "id: string expected";
|
|
1899
|
+
if (t.audios != null && t.hasOwnProperty("audios")) {
|
|
1900
|
+
if (!Array.isArray(t.audios)) return "audios: array expected";
|
|
1901
|
+
for (let e = 0; e < t.audios.length; ++e) {
|
|
1902
|
+
let s = $root.com.quick.voice.proto.AudioInfo.verify(t.audios[e]);
|
|
1749
1903
|
if (s) return "audios." + s;
|
|
1750
1904
|
}
|
|
1751
1905
|
}
|
|
1752
|
-
if (
|
|
1753
|
-
if (!Array.isArray(
|
|
1754
|
-
for (let
|
|
1755
|
-
let s = $root.com.quick.voice.proto.VideoInfo.verify(
|
|
1906
|
+
if (t.videos != null && t.hasOwnProperty("videos")) {
|
|
1907
|
+
if (!Array.isArray(t.videos)) return "videos: array expected";
|
|
1908
|
+
for (let e = 0; e < t.videos.length; ++e) {
|
|
1909
|
+
let s = $root.com.quick.voice.proto.VideoInfo.verify(t.videos[e]);
|
|
1756
1910
|
if (s) return "videos." + s;
|
|
1757
1911
|
}
|
|
1758
1912
|
}
|
|
1759
|
-
if (
|
|
1760
|
-
let
|
|
1761
|
-
if (
|
|
1913
|
+
if (t.custom != null && t.hasOwnProperty("custom")) {
|
|
1914
|
+
let e = $root.com.quick.voice.proto.CustomInfo.verify(t.custom);
|
|
1915
|
+
if (e) return "custom." + e;
|
|
1762
1916
|
}
|
|
1763
1917
|
return null;
|
|
1764
|
-
},
|
|
1765
|
-
if (
|
|
1766
|
-
let
|
|
1767
|
-
if (
|
|
1768
|
-
if (!Array.isArray(
|
|
1769
|
-
|
|
1770
|
-
for (let s = 0; s <
|
|
1771
|
-
if (typeof
|
|
1772
|
-
|
|
1918
|
+
}, n.fromObject = function(t) {
|
|
1919
|
+
if (t instanceof $root.com.quick.voice.proto.UserInfo) return t;
|
|
1920
|
+
let e = new $root.com.quick.voice.proto.UserInfo();
|
|
1921
|
+
if (t.id != null && (e.id = String(t.id)), t.audios) {
|
|
1922
|
+
if (!Array.isArray(t.audios)) throw TypeError(".com.quick.voice.proto.UserInfo.audios: array expected");
|
|
1923
|
+
e.audios = [];
|
|
1924
|
+
for (let s = 0; s < t.audios.length; ++s) {
|
|
1925
|
+
if (typeof t.audios[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.audios: object expected");
|
|
1926
|
+
e.audios[s] = $root.com.quick.voice.proto.AudioInfo.fromObject(t.audios[s]);
|
|
1773
1927
|
}
|
|
1774
1928
|
}
|
|
1775
|
-
if (
|
|
1776
|
-
if (!Array.isArray(
|
|
1777
|
-
|
|
1778
|
-
for (let s = 0; s <
|
|
1779
|
-
if (typeof
|
|
1780
|
-
|
|
1929
|
+
if (t.videos) {
|
|
1930
|
+
if (!Array.isArray(t.videos)) throw TypeError(".com.quick.voice.proto.UserInfo.videos: array expected");
|
|
1931
|
+
e.videos = [];
|
|
1932
|
+
for (let s = 0; s < t.videos.length; ++s) {
|
|
1933
|
+
if (typeof t.videos[s] != "object") throw TypeError(".com.quick.voice.proto.UserInfo.videos: object expected");
|
|
1934
|
+
e.videos[s] = $root.com.quick.voice.proto.VideoInfo.fromObject(t.videos[s]);
|
|
1781
1935
|
}
|
|
1782
1936
|
}
|
|
1783
|
-
if (
|
|
1784
|
-
if (typeof
|
|
1785
|
-
|
|
1937
|
+
if (t.custom != null) {
|
|
1938
|
+
if (typeof t.custom != "object") throw TypeError(".com.quick.voice.proto.UserInfo.custom: object expected");
|
|
1939
|
+
e.custom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.custom);
|
|
1786
1940
|
}
|
|
1787
|
-
return
|
|
1788
|
-
},
|
|
1789
|
-
|
|
1941
|
+
return e;
|
|
1942
|
+
}, n.toObject = function(t, e) {
|
|
1943
|
+
e || (e = {});
|
|
1790
1944
|
let s = {};
|
|
1791
|
-
if ((
|
|
1945
|
+
if ((e.arrays || e.defaults) && (s.audios = [], s.videos = []), e.defaults && (s.id = ""), t.id != null && t.hasOwnProperty("id") && (s.id = t.id), t.audios && t.audios.length) {
|
|
1792
1946
|
s.audios = [];
|
|
1793
|
-
for (let l = 0; l <
|
|
1947
|
+
for (let l = 0; l < t.audios.length; ++l) s.audios[l] = $root.com.quick.voice.proto.AudioInfo.toObject(t.audios[l], e);
|
|
1794
1948
|
}
|
|
1795
|
-
if (
|
|
1949
|
+
if (t.videos && t.videos.length) {
|
|
1796
1950
|
s.videos = [];
|
|
1797
|
-
for (let l = 0; l <
|
|
1951
|
+
for (let l = 0; l < t.videos.length; ++l) s.videos[l] = $root.com.quick.voice.proto.VideoInfo.toObject(t.videos[l], e);
|
|
1798
1952
|
}
|
|
1799
|
-
return
|
|
1800
|
-
},
|
|
1953
|
+
return t.custom != null && t.hasOwnProperty("custom") && (s.custom = $root.com.quick.voice.proto.CustomInfo.toObject(t.custom, e), e.oneofs && (s._custom = "custom")), s;
|
|
1954
|
+
}, n.prototype.toJSON = function() {
|
|
1801
1955
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1802
|
-
},
|
|
1803
|
-
return
|
|
1804
|
-
},
|
|
1805
|
-
}(),
|
|
1806
|
-
function
|
|
1807
|
-
if (i) for (let
|
|
1956
|
+
}, n.getTypeUrl = function(t) {
|
|
1957
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.UserInfo";
|
|
1958
|
+
}, n;
|
|
1959
|
+
}(), u.AudioInfo = function() {
|
|
1960
|
+
function n(i) {
|
|
1961
|
+
if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1808
1962
|
}
|
|
1809
|
-
|
|
1810
|
-
let
|
|
1811
|
-
return Object.defineProperty(
|
|
1812
|
-
get: $util.oneOfGetter(
|
|
1813
|
-
set: $util.oneOfSetter(
|
|
1814
|
-
}),
|
|
1815
|
-
return new
|
|
1816
|
-
},
|
|
1817
|
-
return
|
|
1963
|
+
n.prototype.type = 0, n.prototype.isEnable = !1, n.prototype.isMute = !1, n.prototype.volume = 0, n.prototype.updateTime = null;
|
|
1964
|
+
let r;
|
|
1965
|
+
return Object.defineProperty(n.prototype, "_updateTime", {
|
|
1966
|
+
get: $util.oneOfGetter(r = ["updateTime"]),
|
|
1967
|
+
set: $util.oneOfSetter(r)
|
|
1968
|
+
}), n.create = function(t) {
|
|
1969
|
+
return new n(t);
|
|
1970
|
+
}, n.encode = function(t, e) {
|
|
1971
|
+
return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
1818
1972
|
/* id 1, wireType 0 =*/
|
|
1819
1973
|
8
|
|
1820
|
-
).int32(
|
|
1974
|
+
).int32(t.type), t.isEnable != null && Object.hasOwnProperty.call(t, "isEnable") && e.uint32(
|
|
1821
1975
|
/* id 2, wireType 0 =*/
|
|
1822
1976
|
16
|
|
1823
|
-
).bool(
|
|
1977
|
+
).bool(t.isEnable), t.isMute != null && Object.hasOwnProperty.call(t, "isMute") && e.uint32(
|
|
1824
1978
|
/* id 3, wireType 0 =*/
|
|
1825
1979
|
24
|
|
1826
|
-
).bool(
|
|
1980
|
+
).bool(t.isMute), t.volume != null && Object.hasOwnProperty.call(t, "volume") && e.uint32(
|
|
1827
1981
|
/* id 4, wireType 1 =*/
|
|
1828
1982
|
33
|
|
1829
|
-
).double(
|
|
1983
|
+
).double(t.volume), t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
|
|
1830
1984
|
/* id 5, wireType 0 =*/
|
|
1831
1985
|
40
|
|
1832
|
-
).int64(
|
|
1833
|
-
},
|
|
1834
|
-
return this.encode(
|
|
1835
|
-
},
|
|
1836
|
-
|
|
1837
|
-
let l =
|
|
1838
|
-
for (;
|
|
1839
|
-
let d =
|
|
1986
|
+
).int64(t.updateTime), e;
|
|
1987
|
+
}, n.encodeDelimited = function(t, e) {
|
|
1988
|
+
return this.encode(t, e).ldelim();
|
|
1989
|
+
}, n.decode = function(t, e, s) {
|
|
1990
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
1991
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.AudioInfo();
|
|
1992
|
+
for (; t.pos < l; ) {
|
|
1993
|
+
let d = t.uint32();
|
|
1840
1994
|
if (d === s) break;
|
|
1841
1995
|
switch (d >>> 3) {
|
|
1842
1996
|
case 1: {
|
|
1843
|
-
|
|
1997
|
+
c.type = t.int32();
|
|
1844
1998
|
break;
|
|
1845
1999
|
}
|
|
1846
2000
|
case 2: {
|
|
1847
|
-
|
|
2001
|
+
c.isEnable = t.bool();
|
|
1848
2002
|
break;
|
|
1849
2003
|
}
|
|
1850
2004
|
case 3: {
|
|
1851
|
-
|
|
2005
|
+
c.isMute = t.bool();
|
|
1852
2006
|
break;
|
|
1853
2007
|
}
|
|
1854
2008
|
case 4: {
|
|
1855
|
-
|
|
2009
|
+
c.volume = t.double();
|
|
1856
2010
|
break;
|
|
1857
2011
|
}
|
|
1858
2012
|
case 5: {
|
|
1859
|
-
|
|
2013
|
+
c.updateTime = t.int64();
|
|
1860
2014
|
break;
|
|
1861
2015
|
}
|
|
1862
2016
|
default:
|
|
1863
|
-
|
|
2017
|
+
t.skipType(d & 7);
|
|
1864
2018
|
break;
|
|
1865
2019
|
}
|
|
1866
2020
|
}
|
|
1867
|
-
return
|
|
1868
|
-
},
|
|
1869
|
-
return
|
|
1870
|
-
},
|
|
1871
|
-
if (typeof
|
|
1872
|
-
if (
|
|
1873
|
-
switch (
|
|
2021
|
+
return c;
|
|
2022
|
+
}, n.decodeDelimited = function(t) {
|
|
2023
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2024
|
+
}, n.verify = function(t) {
|
|
2025
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
2026
|
+
if (t.type != null && t.hasOwnProperty("type"))
|
|
2027
|
+
switch (t.type) {
|
|
1874
2028
|
default:
|
|
1875
2029
|
return "type: enum value expected";
|
|
1876
2030
|
case 0:
|
|
1877
2031
|
case 1:
|
|
1878
2032
|
break;
|
|
1879
2033
|
}
|
|
1880
|
-
return
|
|
1881
|
-
},
|
|
1882
|
-
if (
|
|
1883
|
-
let
|
|
1884
|
-
switch (
|
|
2034
|
+
return t.isEnable != null && t.hasOwnProperty("isEnable") && typeof t.isEnable != "boolean" ? "isEnable: boolean expected" : t.isMute != null && t.hasOwnProperty("isMute") && typeof t.isMute != "boolean" ? "isMute: boolean expected" : t.volume != null && t.hasOwnProperty("volume") && typeof t.volume != "number" ? "volume: number expected" : t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
|
|
2035
|
+
}, n.fromObject = function(t) {
|
|
2036
|
+
if (t instanceof $root.com.quick.voice.proto.AudioInfo) return t;
|
|
2037
|
+
let e = new $root.com.quick.voice.proto.AudioInfo();
|
|
2038
|
+
switch (t.type) {
|
|
1885
2039
|
default:
|
|
1886
|
-
if (typeof
|
|
1887
|
-
|
|
2040
|
+
if (typeof t.type == "number") {
|
|
2041
|
+
e.type = t.type;
|
|
1888
2042
|
break;
|
|
1889
2043
|
}
|
|
1890
2044
|
break;
|
|
1891
2045
|
case "Microphone":
|
|
1892
2046
|
case 0:
|
|
1893
|
-
|
|
2047
|
+
e.type = 0;
|
|
1894
2048
|
break;
|
|
1895
2049
|
case "SystemVoice":
|
|
1896
2050
|
case 1:
|
|
1897
|
-
|
|
2051
|
+
e.type = 1;
|
|
1898
2052
|
break;
|
|
1899
2053
|
}
|
|
1900
|
-
return
|
|
1901
|
-
},
|
|
1902
|
-
|
|
2054
|
+
return t.isEnable != null && (e.isEnable = !!t.isEnable), t.isMute != null && (e.isMute = !!t.isMute), t.volume != null && (e.volume = Number(t.volume)), t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
|
|
2055
|
+
}, n.toObject = function(t, e) {
|
|
2056
|
+
e || (e = {});
|
|
1903
2057
|
let s = {};
|
|
1904
|
-
return
|
|
1905
|
-
},
|
|
2058
|
+
return e.defaults && (s.type = e.enums === String ? "Microphone" : 0, s.isEnable = !1, s.isMute = !1, s.volume = 0), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.AudioType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.AudioType[t.type] : t.type), t.isEnable != null && t.hasOwnProperty("isEnable") && (s.isEnable = t.isEnable), t.isMute != null && t.hasOwnProperty("isMute") && (s.isMute = t.isMute), t.volume != null && t.hasOwnProperty("volume") && (s.volume = e.json && !isFinite(t.volume) ? String(t.volume) : t.volume), t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
|
|
2059
|
+
}, n.prototype.toJSON = function() {
|
|
1906
2060
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1907
|
-
},
|
|
1908
|
-
return
|
|
1909
|
-
},
|
|
1910
|
-
}(),
|
|
1911
|
-
function
|
|
1912
|
-
if (i) for (let
|
|
2061
|
+
}, n.getTypeUrl = function(t) {
|
|
2062
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.AudioInfo";
|
|
2063
|
+
}, n;
|
|
2064
|
+
}(), u.VideoInfo = function() {
|
|
2065
|
+
function n(i) {
|
|
2066
|
+
if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1913
2067
|
}
|
|
1914
|
-
|
|
1915
|
-
let
|
|
1916
|
-
return Object.defineProperty(
|
|
1917
|
-
get: $util.oneOfGetter(
|
|
1918
|
-
set: $util.oneOfSetter(
|
|
1919
|
-
}),
|
|
1920
|
-
return new
|
|
1921
|
-
},
|
|
1922
|
-
return
|
|
2068
|
+
n.prototype.type = 0, n.prototype.isEnable = !1, n.prototype.isMute = !1, n.prototype.width = 0, n.prototype.height = 0, n.prototype.x = 0, n.prototype.y = 0, n.prototype.updateTime = null;
|
|
2069
|
+
let r;
|
|
2070
|
+
return Object.defineProperty(n.prototype, "_updateTime", {
|
|
2071
|
+
get: $util.oneOfGetter(r = ["updateTime"]),
|
|
2072
|
+
set: $util.oneOfSetter(r)
|
|
2073
|
+
}), n.create = function(t) {
|
|
2074
|
+
return new n(t);
|
|
2075
|
+
}, n.encode = function(t, e) {
|
|
2076
|
+
return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
1923
2077
|
/* id 1, wireType 0 =*/
|
|
1924
2078
|
8
|
|
1925
|
-
).int32(
|
|
2079
|
+
).int32(t.type), t.isEnable != null && Object.hasOwnProperty.call(t, "isEnable") && e.uint32(
|
|
1926
2080
|
/* id 2, wireType 0 =*/
|
|
1927
2081
|
16
|
|
1928
|
-
).bool(
|
|
2082
|
+
).bool(t.isEnable), t.isMute != null && Object.hasOwnProperty.call(t, "isMute") && e.uint32(
|
|
1929
2083
|
/* id 3, wireType 0 =*/
|
|
1930
2084
|
24
|
|
1931
|
-
).bool(
|
|
2085
|
+
).bool(t.isMute), t.width != null && Object.hasOwnProperty.call(t, "width") && e.uint32(
|
|
1932
2086
|
/* id 4, wireType 0 =*/
|
|
1933
2087
|
32
|
|
1934
|
-
).int32(
|
|
2088
|
+
).int32(t.width), t.height != null && Object.hasOwnProperty.call(t, "height") && e.uint32(
|
|
1935
2089
|
/* id 5, wireType 0 =*/
|
|
1936
2090
|
40
|
|
1937
|
-
).int32(
|
|
2091
|
+
).int32(t.height), t.x != null && Object.hasOwnProperty.call(t, "x") && e.uint32(
|
|
1938
2092
|
/* id 6, wireType 0 =*/
|
|
1939
2093
|
48
|
|
1940
|
-
).int32(
|
|
2094
|
+
).int32(t.x), t.y != null && Object.hasOwnProperty.call(t, "y") && e.uint32(
|
|
1941
2095
|
/* id 7, wireType 0 =*/
|
|
1942
2096
|
56
|
|
1943
|
-
).int32(
|
|
2097
|
+
).int32(t.y), t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
|
|
1944
2098
|
/* id 8, wireType 0 =*/
|
|
1945
2099
|
64
|
|
1946
|
-
).int64(
|
|
1947
|
-
},
|
|
1948
|
-
return this.encode(
|
|
1949
|
-
},
|
|
1950
|
-
|
|
1951
|
-
let l =
|
|
1952
|
-
for (;
|
|
1953
|
-
let d =
|
|
2100
|
+
).int64(t.updateTime), e;
|
|
2101
|
+
}, n.encodeDelimited = function(t, e) {
|
|
2102
|
+
return this.encode(t, e).ldelim();
|
|
2103
|
+
}, n.decode = function(t, e, s) {
|
|
2104
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
2105
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.VideoInfo();
|
|
2106
|
+
for (; t.pos < l; ) {
|
|
2107
|
+
let d = t.uint32();
|
|
1954
2108
|
if (d === s) break;
|
|
1955
2109
|
switch (d >>> 3) {
|
|
1956
2110
|
case 1: {
|
|
1957
|
-
|
|
2111
|
+
c.type = t.int32();
|
|
1958
2112
|
break;
|
|
1959
2113
|
}
|
|
1960
2114
|
case 2: {
|
|
1961
|
-
|
|
2115
|
+
c.isEnable = t.bool();
|
|
1962
2116
|
break;
|
|
1963
2117
|
}
|
|
1964
2118
|
case 3: {
|
|
1965
|
-
|
|
2119
|
+
c.isMute = t.bool();
|
|
1966
2120
|
break;
|
|
1967
2121
|
}
|
|
1968
2122
|
case 4: {
|
|
1969
|
-
|
|
2123
|
+
c.width = t.int32();
|
|
1970
2124
|
break;
|
|
1971
2125
|
}
|
|
1972
2126
|
case 5: {
|
|
1973
|
-
|
|
2127
|
+
c.height = t.int32();
|
|
1974
2128
|
break;
|
|
1975
2129
|
}
|
|
1976
2130
|
case 6: {
|
|
1977
|
-
|
|
2131
|
+
c.x = t.int32();
|
|
1978
2132
|
break;
|
|
1979
2133
|
}
|
|
1980
2134
|
case 7: {
|
|
1981
|
-
|
|
2135
|
+
c.y = t.int32();
|
|
1982
2136
|
break;
|
|
1983
2137
|
}
|
|
1984
2138
|
case 8: {
|
|
1985
|
-
|
|
2139
|
+
c.updateTime = t.int64();
|
|
1986
2140
|
break;
|
|
1987
2141
|
}
|
|
1988
2142
|
default:
|
|
1989
|
-
|
|
2143
|
+
t.skipType(d & 7);
|
|
1990
2144
|
break;
|
|
1991
2145
|
}
|
|
1992
2146
|
}
|
|
1993
|
-
return
|
|
1994
|
-
},
|
|
1995
|
-
return
|
|
1996
|
-
},
|
|
1997
|
-
if (typeof
|
|
1998
|
-
if (
|
|
1999
|
-
switch (
|
|
2147
|
+
return c;
|
|
2148
|
+
}, n.decodeDelimited = function(t) {
|
|
2149
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2150
|
+
}, n.verify = function(t) {
|
|
2151
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
2152
|
+
if (t.type != null && t.hasOwnProperty("type"))
|
|
2153
|
+
switch (t.type) {
|
|
2000
2154
|
default:
|
|
2001
2155
|
return "type: enum value expected";
|
|
2002
2156
|
case 0:
|
|
2003
2157
|
case 1:
|
|
2004
2158
|
break;
|
|
2005
2159
|
}
|
|
2006
|
-
return
|
|
2007
|
-
},
|
|
2008
|
-
if (
|
|
2009
|
-
let
|
|
2010
|
-
switch (
|
|
2160
|
+
return t.isEnable != null && t.hasOwnProperty("isEnable") && typeof t.isEnable != "boolean" ? "isEnable: boolean expected" : t.isMute != null && t.hasOwnProperty("isMute") && typeof t.isMute != "boolean" ? "isMute: boolean expected" : t.width != null && t.hasOwnProperty("width") && !$util.isInteger(t.width) ? "width: integer expected" : t.height != null && t.hasOwnProperty("height") && !$util.isInteger(t.height) ? "height: integer expected" : t.x != null && t.hasOwnProperty("x") && !$util.isInteger(t.x) ? "x: integer expected" : t.y != null && t.hasOwnProperty("y") && !$util.isInteger(t.y) ? "y: integer expected" : t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
|
|
2161
|
+
}, n.fromObject = function(t) {
|
|
2162
|
+
if (t instanceof $root.com.quick.voice.proto.VideoInfo) return t;
|
|
2163
|
+
let e = new $root.com.quick.voice.proto.VideoInfo();
|
|
2164
|
+
switch (t.type) {
|
|
2011
2165
|
default:
|
|
2012
|
-
if (typeof
|
|
2013
|
-
|
|
2166
|
+
if (typeof t.type == "number") {
|
|
2167
|
+
e.type = t.type;
|
|
2014
2168
|
break;
|
|
2015
2169
|
}
|
|
2016
2170
|
break;
|
|
2017
2171
|
case "Camera":
|
|
2018
2172
|
case 0:
|
|
2019
|
-
|
|
2173
|
+
e.type = 0;
|
|
2020
2174
|
break;
|
|
2021
2175
|
case "Screen":
|
|
2022
2176
|
case 1:
|
|
2023
|
-
|
|
2177
|
+
e.type = 1;
|
|
2024
2178
|
break;
|
|
2025
2179
|
}
|
|
2026
|
-
return
|
|
2027
|
-
},
|
|
2028
|
-
|
|
2180
|
+
return t.isEnable != null && (e.isEnable = !!t.isEnable), t.isMute != null && (e.isMute = !!t.isMute), t.width != null && (e.width = t.width | 0), t.height != null && (e.height = t.height | 0), t.x != null && (e.x = t.x | 0), t.y != null && (e.y = t.y | 0), t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
|
|
2181
|
+
}, n.toObject = function(t, e) {
|
|
2182
|
+
e || (e = {});
|
|
2029
2183
|
let s = {};
|
|
2030
|
-
return
|
|
2031
|
-
},
|
|
2184
|
+
return e.defaults && (s.type = e.enums === String ? "Camera" : 0, s.isEnable = !1, s.isMute = !1, s.width = 0, s.height = 0, s.x = 0, s.y = 0), t.type != null && t.hasOwnProperty("type") && (s.type = e.enums === String ? $root.com.quick.voice.proto.VideoType[t.type] === void 0 ? t.type : $root.com.quick.voice.proto.VideoType[t.type] : t.type), t.isEnable != null && t.hasOwnProperty("isEnable") && (s.isEnable = t.isEnable), t.isMute != null && t.hasOwnProperty("isMute") && (s.isMute = t.isMute), t.width != null && t.hasOwnProperty("width") && (s.width = t.width), t.height != null && t.hasOwnProperty("height") && (s.height = t.height), t.x != null && t.hasOwnProperty("x") && (s.x = t.x), t.y != null && t.hasOwnProperty("y") && (s.y = t.y), t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
|
|
2185
|
+
}, n.prototype.toJSON = function() {
|
|
2032
2186
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
2033
|
-
},
|
|
2034
|
-
return
|
|
2035
|
-
},
|
|
2036
|
-
}(),
|
|
2037
|
-
function
|
|
2038
|
-
if (this.customKeyMap = {}, i) for (let
|
|
2187
|
+
}, n.getTypeUrl = function(t) {
|
|
2188
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.VideoInfo";
|
|
2189
|
+
}, n;
|
|
2190
|
+
}(), u.CustomInfo = function() {
|
|
2191
|
+
function n(i) {
|
|
2192
|
+
if (this.customKeyMap = {}, i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
2039
2193
|
}
|
|
2040
|
-
|
|
2041
|
-
let
|
|
2042
|
-
return Object.defineProperty(
|
|
2043
|
-
get: $util.oneOfGetter(
|
|
2044
|
-
set: $util.oneOfSetter(
|
|
2045
|
-
}),
|
|
2046
|
-
return new
|
|
2047
|
-
},
|
|
2048
|
-
if (
|
|
2194
|
+
n.prototype.roomId = "", n.prototype.customKeyMap = $util.emptyObject, n.prototype.updateTime = null;
|
|
2195
|
+
let r;
|
|
2196
|
+
return Object.defineProperty(n.prototype, "_updateTime", {
|
|
2197
|
+
get: $util.oneOfGetter(r = ["updateTime"]),
|
|
2198
|
+
set: $util.oneOfSetter(r)
|
|
2199
|
+
}), n.create = function(t) {
|
|
2200
|
+
return new n(t);
|
|
2201
|
+
}, n.encode = function(t, e) {
|
|
2202
|
+
if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
|
|
2049
2203
|
/* id 1, wireType 2 =*/
|
|
2050
2204
|
10
|
|
2051
|
-
).string(
|
|
2205
|
+
).string(t.roomId), t.customKeyMap != null && Object.hasOwnProperty.call(t, "customKeyMap")) for (let s = Object.keys(t.customKeyMap), l = 0; l < s.length; ++l) e.uint32(
|
|
2052
2206
|
/* id 2, wireType 2 =*/
|
|
2053
2207
|
18
|
|
2054
2208
|
).fork().uint32(
|
|
@@ -2057,102 +2211,102 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2057
2211
|
).string(s[l]).uint32(
|
|
2058
2212
|
/* id 2, wireType 2 =*/
|
|
2059
2213
|
18
|
|
2060
|
-
).string(
|
|
2061
|
-
return
|
|
2214
|
+
).string(t.customKeyMap[s[l]]).ldelim();
|
|
2215
|
+
return t.updateTime != null && Object.hasOwnProperty.call(t, "updateTime") && e.uint32(
|
|
2062
2216
|
/* id 3, wireType 0 =*/
|
|
2063
2217
|
24
|
|
2064
|
-
).int64(
|
|
2065
|
-
},
|
|
2066
|
-
return this.encode(
|
|
2067
|
-
},
|
|
2068
|
-
|
|
2069
|
-
let l =
|
|
2070
|
-
for (;
|
|
2071
|
-
let p =
|
|
2218
|
+
).int64(t.updateTime), e;
|
|
2219
|
+
}, n.encodeDelimited = function(t, e) {
|
|
2220
|
+
return this.encode(t, e).ldelim();
|
|
2221
|
+
}, n.decode = function(t, e, s) {
|
|
2222
|
+
t instanceof $Reader || (t = $Reader.create(t));
|
|
2223
|
+
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.CustomInfo(), d, y;
|
|
2224
|
+
for (; t.pos < l; ) {
|
|
2225
|
+
let p = t.uint32();
|
|
2072
2226
|
if (p === s) break;
|
|
2073
2227
|
switch (p >>> 3) {
|
|
2074
2228
|
case 1: {
|
|
2075
|
-
|
|
2229
|
+
c.roomId = t.string();
|
|
2076
2230
|
break;
|
|
2077
2231
|
}
|
|
2078
2232
|
case 2: {
|
|
2079
|
-
|
|
2080
|
-
let w =
|
|
2081
|
-
for (d = "", y = "";
|
|
2082
|
-
let b =
|
|
2233
|
+
c.customKeyMap === $util.emptyObject && (c.customKeyMap = {});
|
|
2234
|
+
let w = t.uint32() + t.pos;
|
|
2235
|
+
for (d = "", y = ""; t.pos < w; ) {
|
|
2236
|
+
let b = t.uint32();
|
|
2083
2237
|
switch (b >>> 3) {
|
|
2084
2238
|
case 1:
|
|
2085
|
-
d =
|
|
2239
|
+
d = t.string();
|
|
2086
2240
|
break;
|
|
2087
2241
|
case 2:
|
|
2088
|
-
y =
|
|
2242
|
+
y = t.string();
|
|
2089
2243
|
break;
|
|
2090
2244
|
default:
|
|
2091
|
-
|
|
2245
|
+
t.skipType(b & 7);
|
|
2092
2246
|
break;
|
|
2093
2247
|
}
|
|
2094
2248
|
}
|
|
2095
|
-
|
|
2249
|
+
c.customKeyMap[d] = y;
|
|
2096
2250
|
break;
|
|
2097
2251
|
}
|
|
2098
2252
|
case 3: {
|
|
2099
|
-
|
|
2253
|
+
c.updateTime = t.int64();
|
|
2100
2254
|
break;
|
|
2101
2255
|
}
|
|
2102
2256
|
default:
|
|
2103
|
-
|
|
2257
|
+
t.skipType(p & 7);
|
|
2104
2258
|
break;
|
|
2105
2259
|
}
|
|
2106
2260
|
}
|
|
2107
|
-
return
|
|
2108
|
-
},
|
|
2109
|
-
return
|
|
2110
|
-
},
|
|
2111
|
-
if (typeof
|
|
2112
|
-
if (
|
|
2113
|
-
if (
|
|
2114
|
-
if (!$util.isObject(
|
|
2115
|
-
let
|
|
2116
|
-
for (let s = 0; s <
|
|
2261
|
+
return c;
|
|
2262
|
+
}, n.decodeDelimited = function(t) {
|
|
2263
|
+
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2264
|
+
}, n.verify = function(t) {
|
|
2265
|
+
if (typeof t != "object" || t === null) return "object expected";
|
|
2266
|
+
if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
|
|
2267
|
+
if (t.customKeyMap != null && t.hasOwnProperty("customKeyMap")) {
|
|
2268
|
+
if (!$util.isObject(t.customKeyMap)) return "customKeyMap: object expected";
|
|
2269
|
+
let e = Object.keys(t.customKeyMap);
|
|
2270
|
+
for (let s = 0; s < e.length; ++s) if (!$util.isString(t.customKeyMap[e[s]])) return "customKeyMap: string{k:string} expected";
|
|
2117
2271
|
}
|
|
2118
|
-
return
|
|
2119
|
-
},
|
|
2120
|
-
if (
|
|
2121
|
-
let
|
|
2122
|
-
if (
|
|
2123
|
-
if (typeof
|
|
2124
|
-
|
|
2125
|
-
for (let s = Object.keys(
|
|
2272
|
+
return t.updateTime != null && t.hasOwnProperty("updateTime") && !$util.isInteger(t.updateTime) && !(t.updateTime && $util.isInteger(t.updateTime.low) && $util.isInteger(t.updateTime.high)) ? "updateTime: integer|Long expected" : null;
|
|
2273
|
+
}, n.fromObject = function(t) {
|
|
2274
|
+
if (t instanceof $root.com.quick.voice.proto.CustomInfo) return t;
|
|
2275
|
+
let e = new $root.com.quick.voice.proto.CustomInfo();
|
|
2276
|
+
if (t.roomId != null && (e.roomId = String(t.roomId)), t.customKeyMap) {
|
|
2277
|
+
if (typeof t.customKeyMap != "object") throw TypeError(".com.quick.voice.proto.CustomInfo.customKeyMap: object expected");
|
|
2278
|
+
e.customKeyMap = {};
|
|
2279
|
+
for (let s = Object.keys(t.customKeyMap), l = 0; l < s.length; ++l) e.customKeyMap[s[l]] = String(t.customKeyMap[s[l]]);
|
|
2126
2280
|
}
|
|
2127
|
-
return
|
|
2128
|
-
},
|
|
2129
|
-
|
|
2281
|
+
return t.updateTime != null && ($util.Long ? (e.updateTime = $util.Long.fromValue(t.updateTime)).unsigned = !1 : typeof t.updateTime == "string" ? e.updateTime = parseInt(t.updateTime, 10) : typeof t.updateTime == "number" ? e.updateTime = t.updateTime : typeof t.updateTime == "object" && (e.updateTime = new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber())), e;
|
|
2282
|
+
}, n.toObject = function(t, e) {
|
|
2283
|
+
e || (e = {});
|
|
2130
2284
|
let s = {};
|
|
2131
|
-
(
|
|
2285
|
+
(e.objects || e.defaults) && (s.customKeyMap = {}), e.defaults && (s.roomId = ""), t.roomId != null && t.hasOwnProperty("roomId") && (s.roomId = t.roomId);
|
|
2132
2286
|
let l;
|
|
2133
|
-
if (
|
|
2287
|
+
if (t.customKeyMap && (l = Object.keys(t.customKeyMap)).length) {
|
|
2134
2288
|
s.customKeyMap = {};
|
|
2135
|
-
for (let
|
|
2289
|
+
for (let c = 0; c < l.length; ++c) s.customKeyMap[l[c]] = t.customKeyMap[l[c]];
|
|
2136
2290
|
}
|
|
2137
|
-
return
|
|
2138
|
-
},
|
|
2291
|
+
return t.updateTime != null && t.hasOwnProperty("updateTime") && (typeof t.updateTime == "number" ? s.updateTime = e.longs === String ? String(t.updateTime) : t.updateTime : s.updateTime = e.longs === String ? $util.Long.prototype.toString.call(t.updateTime) : e.longs === Number ? new $util.LongBits(t.updateTime.low >>> 0, t.updateTime.high >>> 0).toNumber() : t.updateTime, e.oneofs && (s._updateTime = "updateTime")), s;
|
|
2292
|
+
}, n.prototype.toJSON = function() {
|
|
2139
2293
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
2140
|
-
},
|
|
2141
|
-
return
|
|
2142
|
-
},
|
|
2143
|
-
}(),
|
|
2144
|
-
const
|
|
2145
|
-
return n[
|
|
2146
|
-
}(),
|
|
2147
|
-
const
|
|
2148
|
-
return n[
|
|
2149
|
-
}(),
|
|
2150
|
-
const
|
|
2151
|
-
return n[
|
|
2152
|
-
}(),
|
|
2153
|
-
}(),
|
|
2294
|
+
}, n.getTypeUrl = function(t) {
|
|
2295
|
+
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.CustomInfo";
|
|
2296
|
+
}, n;
|
|
2297
|
+
}(), u.LayoutType = function() {
|
|
2298
|
+
const n = {}, r = Object.create(n);
|
|
2299
|
+
return r[n[0] = "AudioAndVideo"] = 0, r[n[1] = "OnlyAudio"] = 1, r[n[2] = "OnlyVideo"] = 2, r;
|
|
2300
|
+
}(), u.AudioType = function() {
|
|
2301
|
+
const n = {}, r = Object.create(n);
|
|
2302
|
+
return r[n[0] = "Microphone"] = 0, r[n[1] = "SystemVoice"] = 1, r;
|
|
2303
|
+
}(), u.VideoType = function() {
|
|
2304
|
+
const n = {}, r = Object.create(n);
|
|
2305
|
+
return r[n[0] = "Camera"] = 0, r[n[1] = "Screen"] = 1, r;
|
|
2306
|
+
}(), u;
|
|
2307
|
+
}(), a;
|
|
2154
2308
|
}(), o;
|
|
2155
|
-
}(),
|
|
2309
|
+
}(), h;
|
|
2156
2310
|
})(), createAudioInfo = () => ({
|
|
2157
2311
|
remove: !1,
|
|
2158
2312
|
isEnable: !1,
|
|
@@ -2171,28 +2325,28 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2171
2325
|
});
|
|
2172
2326
|
class RoomUser {
|
|
2173
2327
|
constructor() {
|
|
2174
|
-
|
|
2175
|
-
|
|
2328
|
+
m(this, "userId", "");
|
|
2329
|
+
m(this, "mc_audio");
|
|
2176
2330
|
// 麦克风
|
|
2177
|
-
|
|
2331
|
+
m(this, "mc_video");
|
|
2178
2332
|
// 摄像头
|
|
2179
|
-
|
|
2333
|
+
m(this, "ss_audio");
|
|
2180
2334
|
// 屏幕共享视频
|
|
2181
|
-
|
|
2335
|
+
m(this, "ss_video");
|
|
2182
2336
|
// 屏幕共享音频
|
|
2183
|
-
|
|
2184
|
-
|
|
2337
|
+
m(this, "updateTime", 0);
|
|
2338
|
+
m(this, "getUpdateTimeKey", () => {
|
|
2185
2339
|
const o = [];
|
|
2186
2340
|
return this.mc_audio && o.push(this.mc_audio.updateTime), this.mc_video && o.push(this.mc_video.updateTime), this.ss_audio && o.push(this.ss_audio.updateTime), this.ss_video && o.push(this.ss_video.updateTime), o.join("_");
|
|
2187
2341
|
});
|
|
2188
|
-
|
|
2189
|
-
var
|
|
2190
|
-
const { id:
|
|
2191
|
-
this.userId =
|
|
2192
|
-
const
|
|
2342
|
+
m(this, "init", (o) => {
|
|
2343
|
+
var t, e, s, l;
|
|
2344
|
+
const { id: a, audios: u = [], videos: n = [] } = o;
|
|
2345
|
+
this.userId = a;
|
|
2346
|
+
const r = this.getUpdateTimeKey();
|
|
2193
2347
|
this.mc_audio && (this.mc_audio.remove = !0), this.mc_video && (this.mc_video.remove = !0), this.ss_audio && (this.ss_audio.remove = !0), this.ss_video && (this.ss_video.remove = !0);
|
|
2194
|
-
for (const
|
|
2195
|
-
const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } =
|
|
2348
|
+
for (const c of u) {
|
|
2349
|
+
const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } = c;
|
|
2196
2350
|
switch (d) {
|
|
2197
2351
|
case 0:
|
|
2198
2352
|
{
|
|
@@ -2208,48 +2362,48 @@ class RoomUser {
|
|
|
2208
2362
|
break;
|
|
2209
2363
|
}
|
|
2210
2364
|
}
|
|
2211
|
-
for (const
|
|
2212
|
-
const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height:
|
|
2365
|
+
for (const c of n) {
|
|
2366
|
+
const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height: g, x: k, y: _ } = c;
|
|
2213
2367
|
switch (d) {
|
|
2214
2368
|
case 0:
|
|
2215
2369
|
{
|
|
2216
2370
|
if (this.mc_video || (this.mc_video = createVideoInfo()), this.mc_video.remove = !1, this.mc_video.updateTime === w) break;
|
|
2217
|
-
this.mc_video.isEnable = !!y, this.mc_video.isMute = !!p, this.mc_video.updateTime = Number(w) || 0, this.mc_video.sx =
|
|
2371
|
+
this.mc_video.isEnable = !!y, this.mc_video.isMute = !!p, this.mc_video.updateTime = Number(w) || 0, this.mc_video.sx = k || 0, this.mc_video.sy = _ || 0, this.mc_video.sw = b || 0, this.mc_video.sh = g || 0;
|
|
2218
2372
|
}
|
|
2219
2373
|
break;
|
|
2220
2374
|
case 1:
|
|
2221
2375
|
{
|
|
2222
2376
|
if (this.ss_video || (this.ss_video = createVideoInfo()), this.ss_video.remove = !1, this.ss_video.updateTime === w) break;
|
|
2223
|
-
this.ss_video.isEnable = !!y, this.ss_video.isMute = !!p, this.ss_video.updateTime = Number(w) || 0, this.ss_video.sx =
|
|
2377
|
+
this.ss_video.isEnable = !!y, this.ss_video.isMute = !!p, this.ss_video.updateTime = Number(w) || 0, this.ss_video.sx = k || 0, this.ss_video.sy = _ || 0, this.ss_video.sw = b || 0, this.ss_video.sh = g || 0;
|
|
2224
2378
|
}
|
|
2225
2379
|
break;
|
|
2226
2380
|
}
|
|
2227
2381
|
}
|
|
2228
|
-
(
|
|
2382
|
+
(t = this.mc_audio) != null && t.remove && (this.mc_audio = void 0), (e = this.mc_video) != null && e.remove && (this.mc_video = void 0), (s = this.ss_audio) != null && s.remove && (this.ss_audio = void 0), (l = this.ss_video) != null && l.remove && (this.ss_video = void 0);
|
|
2229
2383
|
const i = this.getUpdateTimeKey();
|
|
2230
|
-
|
|
2384
|
+
r !== i && (this.updateTime = (/* @__PURE__ */ new Date()).getTime());
|
|
2231
2385
|
});
|
|
2232
|
-
|
|
2233
|
-
var o,
|
|
2234
|
-
(o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (
|
|
2386
|
+
m(this, "destroy", () => {
|
|
2387
|
+
var o, a;
|
|
2388
|
+
(o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (a = this.ss_video) != null && a.destroy && this.ss_video.destroy(), this.mc_audio = void 0, this.mc_video = void 0, this.ss_audio = void 0, this.ss_video = void 0;
|
|
2235
2389
|
});
|
|
2236
2390
|
}
|
|
2237
2391
|
}
|
|
2238
|
-
const parseSEI = (
|
|
2239
|
-
let o = 0,
|
|
2392
|
+
const parseSEI = (h) => {
|
|
2393
|
+
let o = 0, a = 0;
|
|
2240
2394
|
for (; ; ) {
|
|
2241
|
-
const
|
|
2242
|
-
if (
|
|
2395
|
+
const n = h[o];
|
|
2396
|
+
if (a = a + n, o = o + 1, n !== 255) break;
|
|
2243
2397
|
}
|
|
2244
|
-
let
|
|
2398
|
+
let u = 0;
|
|
2245
2399
|
for (; ; ) {
|
|
2246
|
-
const
|
|
2247
|
-
if (
|
|
2400
|
+
const n = h[o];
|
|
2401
|
+
if (u = u + n, o = o + 1, n !== 255) break;
|
|
2248
2402
|
}
|
|
2249
|
-
if (
|
|
2250
|
-
const
|
|
2403
|
+
if (a === 5) {
|
|
2404
|
+
const n = h.slice(o, o + 16), i = Array.from(n, (p) => p.toString(16).padStart(2, "0")).join("");
|
|
2251
2405
|
o = o + 16;
|
|
2252
|
-
const
|
|
2406
|
+
const t = u - 16, e = h.slice(o, o + t), s = com.quick.voice.proto.SeiData.decode(e), { event: l = 0 } = s, c = s.data;
|
|
2253
2407
|
let d;
|
|
2254
2408
|
switch (l) {
|
|
2255
2409
|
case 0:
|
|
@@ -2259,65 +2413,65 @@ const parseSEI = (f) => {
|
|
|
2259
2413
|
d = com.quick.voice.proto.CustomInfo.decode(s.data);
|
|
2260
2414
|
break;
|
|
2261
2415
|
}
|
|
2262
|
-
return { uuid: i, ...s, event: l, data_remote:
|
|
2416
|
+
return { uuid: i, ...s, event: l, data_remote: c, data: d };
|
|
2263
2417
|
}
|
|
2264
2418
|
};
|
|
2265
2419
|
class QuickVoPlayer {
|
|
2266
2420
|
constructor() {
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2421
|
+
m(this, "displayMode", "original");
|
|
2422
|
+
m(this, "prPlayer", new et());
|
|
2423
|
+
m(this, "dom");
|
|
2424
|
+
m(this, "room", {
|
|
2271
2425
|
roomId: "",
|
|
2272
2426
|
updateTime: "",
|
|
2273
2427
|
author: "",
|
|
2274
2428
|
version: ""
|
|
2275
2429
|
});
|
|
2276
|
-
|
|
2277
|
-
|
|
2430
|
+
m(this, "usersMap", /* @__PURE__ */ new Map());
|
|
2431
|
+
m(this, "on", {
|
|
2278
2432
|
users: (o) => {
|
|
2279
2433
|
}
|
|
2280
2434
|
});
|
|
2281
|
-
|
|
2435
|
+
m(this, "init", () => {
|
|
2282
2436
|
this.prPlayer.init();
|
|
2283
2437
|
});
|
|
2284
|
-
|
|
2285
|
-
|
|
2438
|
+
m(this, "start", async (o) => (this.stop(), this.prPlayer.start(o)));
|
|
2439
|
+
m(this, "stop", () => {
|
|
2286
2440
|
this.prPlayer.stop(), this.usersMap = /* @__PURE__ */ new Map(), this.room.roomId = "", this.room.author = "", this.room.updateTime = "", this.room.version = "";
|
|
2287
2441
|
});
|
|
2288
|
-
|
|
2442
|
+
m(this, "setMute", (o) => {
|
|
2289
2443
|
this.prPlayer.setMute(o);
|
|
2290
2444
|
});
|
|
2291
|
-
|
|
2292
|
-
|
|
2445
|
+
m(this, "getStream", () => this.prPlayer.getStream());
|
|
2446
|
+
m(this, "getAllUseUpdateKey", () => {
|
|
2293
2447
|
const o = [...this.usersMap.values()];
|
|
2294
|
-
return Array.from(o, (
|
|
2448
|
+
return Array.from(o, (u) => u.updateTime).join("_");
|
|
2295
2449
|
});
|
|
2296
|
-
|
|
2297
|
-
var
|
|
2450
|
+
m(this, "checkAndCreateUser", (o, a) => {
|
|
2451
|
+
var u, n;
|
|
2298
2452
|
if (this.usersMap.has(o)) {
|
|
2299
|
-
const
|
|
2300
|
-
if (
|
|
2301
|
-
const { sx: i, sy:
|
|
2302
|
-
(
|
|
2453
|
+
const r = this.usersMap.get(o);
|
|
2454
|
+
if (r == null || r.init(a), r != null && r.mc_video) {
|
|
2455
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.mc_video;
|
|
2456
|
+
(u = r == null ? void 0 : r.mc_video.worker) == null || u.setCut({ sx: i, sy: t, sw: e, sh: s });
|
|
2303
2457
|
}
|
|
2304
|
-
if (
|
|
2305
|
-
const { sx: i, sy:
|
|
2306
|
-
(
|
|
2458
|
+
if (r != null && r.ss_video) {
|
|
2459
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.ss_video;
|
|
2460
|
+
(n = r == null ? void 0 : r.ss_video.worker) == null || n.setCut({ sx: i, sy: t, sw: e, sh: s });
|
|
2307
2461
|
}
|
|
2308
2462
|
} else {
|
|
2309
|
-
const
|
|
2310
|
-
if (this.usersMap.set(o,
|
|
2311
|
-
if (
|
|
2312
|
-
const { sx: i, sy:
|
|
2313
|
-
|
|
2314
|
-
y(), this.prPlayer.cut.remove(l), this.usersMap.delete(
|
|
2463
|
+
const r = new RoomUser();
|
|
2464
|
+
if (this.usersMap.set(o, r), r.init(a), r) {
|
|
2465
|
+
if (r.mc_video) {
|
|
2466
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.mc_video, l = `${r.userId}_mc_video`, { worker: c, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
|
|
2467
|
+
r.mc_video.worker = c, this.displayMode === "original" && c.setPause(!0), r.mc_video.stream = d, r.mc_video.destroy = () => {
|
|
2468
|
+
y(), this.prPlayer.cut.remove(l), this.usersMap.delete(r.userId);
|
|
2315
2469
|
};
|
|
2316
2470
|
}
|
|
2317
|
-
if (
|
|
2318
|
-
const { sx: i, sy:
|
|
2319
|
-
|
|
2320
|
-
y(), this.prPlayer.cut.remove(l), this.usersMap.delete(
|
|
2471
|
+
if (r.ss_video) {
|
|
2472
|
+
const { sx: i, sy: t, sw: e, sh: s } = r.ss_video, l = `${r.userId}_ss_video`, { worker: c, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
|
|
2473
|
+
r.ss_video.worker = c, this.displayMode === "original" && c.setPause(!0), r.ss_video.stream = d, r.ss_video.destroy = () => {
|
|
2474
|
+
y(), this.prPlayer.cut.remove(l), this.usersMap.delete(r.userId);
|
|
2321
2475
|
};
|
|
2322
2476
|
}
|
|
2323
2477
|
}
|
|
@@ -2326,66 +2480,67 @@ class QuickVoPlayer {
|
|
|
2326
2480
|
/**
|
|
2327
2481
|
* 监听SEI信息
|
|
2328
2482
|
*/
|
|
2329
|
-
|
|
2483
|
+
m(this, "onSEI", (o) => {
|
|
2330
2484
|
try {
|
|
2331
|
-
const
|
|
2332
|
-
if (!
|
|
2333
|
-
const { event:
|
|
2334
|
-
switch (
|
|
2485
|
+
const a = parseSEI(o);
|
|
2486
|
+
if (!a) return;
|
|
2487
|
+
const { event: u, data: n } = a;
|
|
2488
|
+
switch (u) {
|
|
2335
2489
|
case 0:
|
|
2336
2490
|
{
|
|
2337
|
-
const { roomId:
|
|
2338
|
-
if (
|
|
2339
|
-
const
|
|
2491
|
+
const { roomId: r, userMap: i } = n;
|
|
2492
|
+
if (r !== this.room.roomId) return;
|
|
2493
|
+
const t = this.getAllUseUpdateKey(), e = Object.keys(i);
|
|
2340
2494
|
{
|
|
2341
2495
|
const l = [...this.usersMap.values()];
|
|
2342
|
-
for (const
|
|
2343
|
-
|
|
2496
|
+
for (const c of l)
|
|
2497
|
+
e.includes(c.userId) || c == null || c.destroy();
|
|
2344
2498
|
}
|
|
2345
|
-
for (const l of
|
|
2346
|
-
const
|
|
2347
|
-
this.checkAndCreateUser(l,
|
|
2499
|
+
for (const l of e) {
|
|
2500
|
+
const c = i[l];
|
|
2501
|
+
this.checkAndCreateUser(l, c);
|
|
2348
2502
|
}
|
|
2349
2503
|
const s = this.getAllUseUpdateKey();
|
|
2350
|
-
if (
|
|
2351
|
-
const l = [...this.usersMap.values()],
|
|
2352
|
-
this.on.users(
|
|
2504
|
+
if (t !== s && this.on.users) {
|
|
2505
|
+
const l = [...this.usersMap.values()], c = Array.from(l, ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: g }) => ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: g }));
|
|
2506
|
+
this.on.users(c);
|
|
2353
2507
|
}
|
|
2354
2508
|
}
|
|
2355
2509
|
break;
|
|
2356
2510
|
case 1:
|
|
2357
2511
|
{
|
|
2358
|
-
const { roomId:
|
|
2359
|
-
this.room.roomId =
|
|
2512
|
+
const { roomId: r, updateTime: i } = n, { author: t, version: e } = n.customKeyMap;
|
|
2513
|
+
this.room.roomId = r, this.room.updateTime = i, this.room.author = t, this.room.version = e;
|
|
2360
2514
|
}
|
|
2361
2515
|
break;
|
|
2362
2516
|
}
|
|
2363
|
-
} catch (
|
|
2364
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error",
|
|
2517
|
+
} catch (a) {
|
|
2518
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error", a);
|
|
2365
2519
|
}
|
|
2366
2520
|
});
|
|
2367
|
-
|
|
2368
|
-
var u,
|
|
2521
|
+
m(this, "setDisplayMode", (o) => {
|
|
2522
|
+
var a, u, n, r, i, t, e, s;
|
|
2369
2523
|
switch (this.displayMode = o, o) {
|
|
2370
2524
|
case "original":
|
|
2371
2525
|
{
|
|
2372
2526
|
this.prPlayer.setPause(!1);
|
|
2373
2527
|
const l = [...this.usersMap.values()];
|
|
2374
|
-
for (const
|
|
2375
|
-
(
|
|
2528
|
+
for (const c of l)
|
|
2529
|
+
(u = (a = c.mc_video) == null ? void 0 : a.worker) == null || u.setPause(!0), (r = (n = c.ss_video) == null ? void 0 : n.worker) == null || r.setPause(!0);
|
|
2376
2530
|
}
|
|
2377
2531
|
break;
|
|
2378
2532
|
case "cut":
|
|
2379
2533
|
{
|
|
2380
2534
|
this.prPlayer.setPause(!0);
|
|
2381
2535
|
const l = [...this.usersMap.values()];
|
|
2382
|
-
for (const
|
|
2383
|
-
(
|
|
2536
|
+
for (const c of l)
|
|
2537
|
+
(t = (i = c.mc_video) == null ? void 0 : i.worker) == null || t.setPause(!1), (s = (e = c.ss_video) == null ? void 0 : e.worker) == null || s.setPause(!1);
|
|
2384
2538
|
}
|
|
2385
2539
|
break;
|
|
2386
2540
|
}
|
|
2387
2541
|
});
|
|
2388
|
-
this.prPlayer.on.demuxer.sei = this.onSEI
|
|
2542
|
+
this.prPlayer.on.demuxer.sei = this.onSEI, this.prPlayer.on.demuxer.chunk = (o) => {
|
|
2543
|
+
};
|
|
2389
2544
|
}
|
|
2390
2545
|
}
|
|
2391
2546
|
export {
|