quickvo-player 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/QuickVoPlayer.d.ts +2 -1
- package/dist/index.js +440 -405
- package/dist/index.umd.cjs +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var U = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var D = (f) => {
|
|
3
3
|
throw TypeError(f);
|
|
4
4
|
};
|
|
5
|
-
var W = (f, o,
|
|
6
|
-
var v = (f, o,
|
|
7
|
-
var x = (f, o,
|
|
5
|
+
var W = (f, o, u) => o in f ? U(f, o, { enumerable: !0, configurable: !0, writable: !0, value: u }) : f[o] = u;
|
|
6
|
+
var v = (f, o, u) => W(f, typeof o != "symbol" ? o + "" : o, u), B = (f, o, u) => o.has(f) || D("Cannot " + u);
|
|
7
|
+
var x = (f, o, u) => (B(f, o, "read from private field"), u ? u.call(f) : o.get(f)), P = (f, o, u) => o.has(f) ? D("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(f) : o.set(f, u), C = (f, o, u, c) => (B(f, o, "write to private field"), c ? c.call(f, u) : o.set(f, u), u);
|
|
8
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
9
|
function E(f) {
|
|
10
10
|
let o;
|
|
11
11
|
try {
|
|
12
12
|
if (o = A && (self.URL || self.webkitURL).createObjectURL(A), !o) throw "";
|
|
13
|
-
const
|
|
13
|
+
const u = new Worker(o, {
|
|
14
14
|
name: f == null ? void 0 : f.name
|
|
15
15
|
});
|
|
16
|
-
return
|
|
16
|
+
return u.addEventListener("error", () => {
|
|
17
17
|
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
18
|
-
}),
|
|
18
|
+
}), u;
|
|
19
19
|
} catch {
|
|
20
20
|
return new Worker(
|
|
21
21
|
"data:text/javascript;charset=utf-8," + encodeURIComponent(L),
|
|
@@ -35,8 +35,8 @@ class _ {
|
|
|
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: u, data: c } = o.data;
|
|
39
|
+
u === "onHeader" && this.on.header && this.on.header(c), u === "onTag" && this.on.tag && this.on.tag(c);
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -46,12 +46,12 @@ function V(f) {
|
|
|
46
46
|
let o;
|
|
47
47
|
try {
|
|
48
48
|
if (o = R && (self.URL || self.webkitURL).createObjectURL(R), !o) throw "";
|
|
49
|
-
const
|
|
49
|
+
const u = new Worker(o, {
|
|
50
50
|
name: f == null ? void 0 : f.name
|
|
51
51
|
});
|
|
52
|
-
return
|
|
52
|
+
return u.addEventListener("error", () => {
|
|
53
53
|
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
54
|
-
}),
|
|
54
|
+
}), u;
|
|
55
55
|
} catch {
|
|
56
56
|
return new Worker(
|
|
57
57
|
"data:text/javascript;charset=utf-8," + encodeURIComponent(N),
|
|
@@ -85,13 +85,13 @@ class j {
|
|
|
85
85
|
this.worker.postMessage({ type: "audio", action: "destroy" }), this.worker.postMessage({ type: "video", action: "destroy", data: {} }), this.worker.terminate();
|
|
86
86
|
});
|
|
87
87
|
this.worker.onmessage = (o) => {
|
|
88
|
-
const { type:
|
|
89
|
-
switch (
|
|
88
|
+
const { type: u, action: c, data: r } = o.data;
|
|
89
|
+
switch (u) {
|
|
90
90
|
case "audio":
|
|
91
|
-
|
|
91
|
+
c === "onDecode" && this.on.audio.decode && this.on.audio.decode(r), c === "onError" && this.on.audio.error && this.on.audio.error(r);
|
|
92
92
|
break;
|
|
93
93
|
case "video":
|
|
94
|
-
|
|
94
|
+
c === "onDecode" && this.on.video.decode && this.on.video.decode(r), c === "onError" && this.on.video.error && this.on.video.error(r);
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
97
97
|
};
|
|
@@ -103,12 +103,12 @@ function H(f) {
|
|
|
103
103
|
let o;
|
|
104
104
|
try {
|
|
105
105
|
if (o = M && (self.URL || self.webkitURL).createObjectURL(M), !o) throw "";
|
|
106
|
-
const
|
|
106
|
+
const u = new Worker(o, {
|
|
107
107
|
name: f == null ? void 0 : f.name
|
|
108
108
|
});
|
|
109
|
-
return
|
|
109
|
+
return u.addEventListener("error", () => {
|
|
110
110
|
(self.URL || self.webkitURL).revokeObjectURL(o);
|
|
111
|
-
}),
|
|
111
|
+
}), u;
|
|
112
112
|
} catch {
|
|
113
113
|
return new Worker(
|
|
114
114
|
"data:text/javascript;charset=utf-8," + encodeURIComponent(F),
|
|
@@ -121,9 +121,9 @@ function H(f) {
|
|
|
121
121
|
class $ {
|
|
122
122
|
constructor() {
|
|
123
123
|
v(this, "worker", new H());
|
|
124
|
-
v(this, "init", ({ offscreenCanvas: o, baseTime:
|
|
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
125
|
v(this, "setShader", (o) => this.worker.postMessage({ action: "setShader", data: o }));
|
|
126
|
-
v(this, "setSize", ({ width: o, height:
|
|
126
|
+
v(this, "setSize", ({ width: o, height: u }) => this.worker.postMessage({ action: "setSize", data: { width: o, height: u } }));
|
|
127
127
|
v(this, "push", (o) => this.worker.postMessage({ action: "push", data: o }));
|
|
128
128
|
v(this, "setCut", async (o) => this.worker.postMessage({ action: "setCut", data: o }));
|
|
129
129
|
v(this, "setPause", (o) => this.worker.postMessage({ action: "setPause", data: o }));
|
|
@@ -132,71 +132,71 @@ class $ {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
var q = Object.defineProperty, K = (f, o,
|
|
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
136
|
class Q {
|
|
137
|
-
constructor(o,
|
|
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", (
|
|
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
139
|
{
|
|
140
|
-
const
|
|
141
|
-
for (const r of
|
|
140
|
+
const c = this.inputStream.getTracks();
|
|
141
|
+
for (const r of c)
|
|
142
142
|
r.stop(), this.inputStream.removeTrack(r);
|
|
143
143
|
}
|
|
144
|
-
}), h(this, "getStream", () => this.filterStream(this.outputStream)), h(this, "setMute", (
|
|
145
|
-
|
|
146
|
-
}), h(this, "setInputGain", (
|
|
147
|
-
this.inputGain =
|
|
148
|
-
}), h(this, "setEnhanceGain", async (
|
|
149
|
-
this.enhanceGain =
|
|
150
|
-
}), h(this, "setBgsGain", (
|
|
151
|
-
this.bgsGain =
|
|
152
|
-
}), h(this, "setBgmGain", (
|
|
153
|
-
this.bgmGain =
|
|
154
|
-
}), h(this, "setOutputGain", (
|
|
155
|
-
this.outputGain =
|
|
144
|
+
}), h(this, "getStream", () => this.filterStream(this.outputStream)), h(this, "setMute", (c = !0) => {
|
|
145
|
+
c ? this.analyserNode.disconnect(this.outputGainNode) : this.analyserNode.connect(this.outputGainNode);
|
|
146
|
+
}), h(this, "setInputGain", (c) => {
|
|
147
|
+
this.inputGain = c, this.inputGainNode.gain.setValueAtTime(c, this.audioContext.currentTime);
|
|
148
|
+
}), h(this, "setEnhanceGain", async (c) => {
|
|
149
|
+
this.enhanceGain = c + 1, this.enhanceGainNode.gain.setValueAtTime(this.enhanceGain, this.audioContext.currentTime);
|
|
150
|
+
}), h(this, "setBgsGain", (c) => {
|
|
151
|
+
this.bgsGain = c, this.bgsGainNode.gain.setValueAtTime(c, this.audioContext.currentTime);
|
|
152
|
+
}), h(this, "setBgmGain", (c) => {
|
|
153
|
+
this.bgmGain = c, this.bgmGainNode.gain.setValueAtTime(c, this.audioContext.currentTime);
|
|
154
|
+
}), h(this, "setOutputGain", (c) => {
|
|
155
|
+
this.outputGain = c, this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime);
|
|
156
156
|
}), h(this, "getVolume", () => {
|
|
157
|
-
const { analyserNode:
|
|
158
|
-
|
|
157
|
+
const { analyserNode: c, analyserArrayData: r } = this;
|
|
158
|
+
c.getByteFrequencyData(r);
|
|
159
159
|
let n = 0;
|
|
160
160
|
for (let i = 0; i < r.length; i++)
|
|
161
161
|
n += r[i];
|
|
162
162
|
return Math.ceil(n / r.length);
|
|
163
|
-
}), h(this, "mixAudio", (
|
|
163
|
+
}), h(this, "mixAudio", (c, r = "bgm") => new Promise(async (n, i) => {
|
|
164
164
|
try {
|
|
165
165
|
{
|
|
166
166
|
const s = this.mixAudioMap.get(r);
|
|
167
167
|
s && s.stop();
|
|
168
168
|
}
|
|
169
169
|
const e = r === "bgs" ? this.bgsGainNode : this.bgmGainNode, t = this.audioContext.createBufferSource();
|
|
170
|
-
this.mixAudioMap.set(r, t), t.buffer =
|
|
170
|
+
this.mixAudioMap.set(r, t), t.buffer = c, t.connect(e), t.onended = () => {
|
|
171
171
|
t.disconnect(e), this.mixAudioMap.delete(r), n(!0);
|
|
172
172
|
}, t.start(0);
|
|
173
173
|
} catch (e) {
|
|
174
174
|
i(e);
|
|
175
175
|
}
|
|
176
|
-
})), h(this, "mixAudioStop", (
|
|
177
|
-
const r = this.mixAudioMap.get(
|
|
176
|
+
})), h(this, "mixAudioStop", (c) => {
|
|
177
|
+
const r = this.mixAudioMap.get(c);
|
|
178
178
|
r == null || r.stop();
|
|
179
|
-
}), h(this, "changeMix", (
|
|
180
|
-
const n =
|
|
179
|
+
}), h(this, "changeMix", (c, r) => {
|
|
180
|
+
const n = c === "bgs" ? this.bgsGainNode : this.bgmGainNode;
|
|
181
181
|
r ? n.connect(this.destinationNode) : n.disconnect(this.destinationNode);
|
|
182
|
-
}),
|
|
182
|
+
}), u && (this.audioContext = u), 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
183
|
{
|
|
184
|
-
const { sourceNode:
|
|
185
|
-
|
|
184
|
+
const { sourceNode: c, inputGainNode: r, enhanceGainNode: n, bgsGainNode: i, bgmGainNode: e, analyserNode: t, outputGainNode: s, destinationNode: l } = this;
|
|
185
|
+
c.connect(r), r.connect(n), n.connect(t), i.connect(t), e.connect(t), n.connect(l), i.connect(l), e.connect(l), t.connect(s), s.connect(this.audioContext.destination);
|
|
186
186
|
}
|
|
187
187
|
this.setMute(!0), this.audioContext.resume();
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
const J = async (f, o) => {
|
|
191
191
|
try {
|
|
192
|
-
const { format:
|
|
193
|
-
for (let e = 0; e <
|
|
192
|
+
const { format: u, numberOfChannels: c, numberOfFrames: r, sampleRate: n } = o, i = f.createBuffer(c, r, n);
|
|
193
|
+
for (let e = 0; e < c; e++) {
|
|
194
194
|
const t = o.allocationSize({ planeIndex: e }), s = new Uint8Array(t);
|
|
195
195
|
o.copyTo(s, { planeIndex: e });
|
|
196
|
-
const l = new DataView(s.buffer),
|
|
196
|
+
const l = new DataView(s.buffer), a = i.getChannelData(e);
|
|
197
197
|
for (let d = 0; d < r; d++) {
|
|
198
198
|
let y;
|
|
199
|
-
switch (
|
|
199
|
+
switch (u) {
|
|
200
200
|
case "s16":
|
|
201
201
|
// 16-bit signed PCM (范围: -32768 ~ 32767)
|
|
202
202
|
case "s16-planar":
|
|
@@ -213,14 +213,14 @@ const J = async (f, o) => {
|
|
|
213
213
|
y = (l.getUint8(d) - 128) / 128;
|
|
214
214
|
break;
|
|
215
215
|
default:
|
|
216
|
-
throw new Error(`Unsupported audio format: ${
|
|
216
|
+
throw new Error(`Unsupported audio format: ${u}`);
|
|
217
217
|
}
|
|
218
|
-
|
|
218
|
+
a[d] = Math.max(-1, Math.min(1, y));
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
return i;
|
|
222
|
-
} catch (
|
|
223
|
-
throw console.error("Failed to convert AudioData to AudioBuffer:",
|
|
222
|
+
} catch (u) {
|
|
223
|
+
throw console.error("Failed to convert AudioData to AudioBuffer:", u), u;
|
|
224
224
|
}
|
|
225
225
|
};
|
|
226
226
|
class X {
|
|
@@ -242,36 +242,36 @@ class X {
|
|
|
242
242
|
async push(o) {
|
|
243
243
|
try {
|
|
244
244
|
if (!this.audioContext || !this.destination) return;
|
|
245
|
-
const
|
|
246
|
-
if (!
|
|
247
|
-
const
|
|
248
|
-
|
|
245
|
+
const u = await J(this.audioContext, o);
|
|
246
|
+
if (!u) return;
|
|
247
|
+
const c = this.audioContext.createBufferSource();
|
|
248
|
+
c.buffer = u, c.connect(this.destination);
|
|
249
249
|
const r = Math.max(this.nextStartTime, this.audioContext.currentTime);
|
|
250
|
-
this.nextStartTime = r +
|
|
251
|
-
this.pendingSources = this.pendingSources.filter((n) => n !==
|
|
250
|
+
this.nextStartTime = r + u.duration, c.start(r), this.pendingSources.push(c), c.onended = () => {
|
|
251
|
+
this.pendingSources = this.pendingSources.filter((n) => n !== c);
|
|
252
252
|
}, this.audioContext.state === "suspended" && await this.audioContext.resume();
|
|
253
253
|
} finally {
|
|
254
254
|
o.close();
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
destroy() {
|
|
258
|
-
var o,
|
|
259
|
-
(o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (
|
|
258
|
+
var o, u;
|
|
259
|
+
(o = this.audioContext) == null || o.close(), this.audioContext = void 0, this.destination = void 0, this.nextStartTime = 0, (u = this.prAudioStream) == null || u.stop(), this.pendingSources.forEach((c) => c.stop()), this.pendingSources = [];
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
var S, T;
|
|
263
263
|
class Y {
|
|
264
264
|
constructor(o = {}) {
|
|
265
|
-
|
|
265
|
+
P(this, S, {
|
|
266
266
|
timeout: 5 * 1e3
|
|
267
267
|
});
|
|
268
|
-
|
|
268
|
+
P(this, T);
|
|
269
269
|
/**
|
|
270
270
|
*
|
|
271
271
|
* @param input string | URL | Request
|
|
272
272
|
* @param init RequestInit
|
|
273
273
|
*/
|
|
274
|
-
v(this, "check", (o,
|
|
274
|
+
v(this, "check", (o, u) => new Promise(async (c, r) => {
|
|
275
275
|
var i;
|
|
276
276
|
this.stop(), C(this, T, new AbortController());
|
|
277
277
|
const n = window.setTimeout(() => {
|
|
@@ -279,8 +279,8 @@ class Y {
|
|
|
279
279
|
(e = x(this, T)) == null || e.abort("Timeout."), r({ status: "timeout", reason: "" });
|
|
280
280
|
}, x(this, S).timeout);
|
|
281
281
|
try {
|
|
282
|
-
const e = await fetch(o, { ...
|
|
283
|
-
e.status === 200 ?
|
|
282
|
+
const e = await fetch(o, { ...u, method: "HEAD", signal: (i = x(this, T)) == null ? void 0 : i.signal });
|
|
283
|
+
e.status === 200 ? c({ status: "successed", reason: "" }) : r({ status: "failed", reason: `${e.status}` });
|
|
284
284
|
} catch (e) {
|
|
285
285
|
r({ status: "error", reason: e.message });
|
|
286
286
|
}
|
|
@@ -291,12 +291,12 @@ class Y {
|
|
|
291
291
|
* @param input string | URL | Request
|
|
292
292
|
* @param init RequestInit
|
|
293
293
|
*/
|
|
294
|
-
v(this, "request", async (o,
|
|
294
|
+
v(this, "request", async (o, u) => new Promise(async (c, r) => {
|
|
295
295
|
var n;
|
|
296
296
|
try {
|
|
297
|
-
await this.check(o,
|
|
298
|
-
const i = await fetch(o, { ...
|
|
299
|
-
|
|
297
|
+
await this.check(o, u), C(this, T, new AbortController());
|
|
298
|
+
const i = await fetch(o, { ...u, signal: (n = x(this, T)) == null ? void 0 : n.signal });
|
|
299
|
+
c(i);
|
|
300
300
|
} catch (i) {
|
|
301
301
|
this.stop(), r(i);
|
|
302
302
|
}
|
|
@@ -314,13 +314,13 @@ class Y {
|
|
|
314
314
|
S = new WeakMap(), T = new WeakMap();
|
|
315
315
|
const O = (f) => {
|
|
316
316
|
const o = (f == null ? void 0 : f.getTracks()) || [];
|
|
317
|
-
for (const
|
|
318
|
-
|
|
317
|
+
for (const u of o)
|
|
318
|
+
u.stop();
|
|
319
319
|
}, G = (f) => {
|
|
320
|
-
const o = new $(),
|
|
320
|
+
const o = new $(), u = document.createElement("canvas"), c = u.transferControlToOffscreen(), r = new MediaStreamTrackGenerator({ kind: "video" }), n = new MediaStream([r]), i = () => {
|
|
321
321
|
o.destroy(), O(n);
|
|
322
322
|
};
|
|
323
|
-
return o.init({ offscreenCanvas:
|
|
323
|
+
return o.init({ offscreenCanvas: c, baseTime: f, writable: r.writable }), { worker: o, canvas: u, stream: n, destroy: i };
|
|
324
324
|
};
|
|
325
325
|
class be {
|
|
326
326
|
constructor() {
|
|
@@ -346,26 +346,33 @@ class be {
|
|
|
346
346
|
* 开始播放
|
|
347
347
|
* @param url : string
|
|
348
348
|
*/
|
|
349
|
-
v(this, "start", async (o) => {
|
|
350
|
-
var
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
})
|
|
349
|
+
v(this, "start", async (o) => (this.stop(), this.renderBaseTime = (/* @__PURE__ */ new Date()).getTime(), this.init(), this.prFetch.request(o).then(async (u) => {
|
|
350
|
+
var n;
|
|
351
|
+
const c = (n = u.body) == null ? void 0 : n.getReader();
|
|
352
|
+
if (!c) throw new Error("Reader is error.");
|
|
353
|
+
const r = () => {
|
|
354
|
+
c.read().then(({ done: i, value: e }) => {
|
|
355
|
+
var t;
|
|
356
|
+
e && ((t = this.demuxerWorker) == null || t.push(e)), !i && r();
|
|
357
|
+
}).catch((i) => {
|
|
358
|
+
if (i.name !== "AbortError") throw i;
|
|
359
|
+
});
|
|
360
|
+
};
|
|
361
|
+
r();
|
|
362
|
+
}).catch((u) => {
|
|
363
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: err", u);
|
|
364
|
+
})));
|
|
363
365
|
/**
|
|
364
366
|
* 停止
|
|
365
367
|
*/
|
|
366
|
-
v(this, "stop", () => {
|
|
367
|
-
var
|
|
368
|
-
|
|
368
|
+
v(this, "stop", async () => {
|
|
369
|
+
var u, c, r, n;
|
|
370
|
+
try {
|
|
371
|
+
this.prFetch.stop();
|
|
372
|
+
} catch (i) {
|
|
373
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->Breathe: error", i);
|
|
374
|
+
}
|
|
375
|
+
(u = this.demuxerWorker) == null || u.destroy(), (c = this.decoderWorker) == null || c.destroy(), (r = this.renderWorker) == null || r.destroy(), O(this.stream);
|
|
369
376
|
const o = [...this.cutRenders.keys()];
|
|
370
377
|
for (const i of o)
|
|
371
378
|
this.cut.remove(i);
|
|
@@ -377,19 +384,19 @@ class be {
|
|
|
377
384
|
v(this, "onTag", (o) => {
|
|
378
385
|
var i;
|
|
379
386
|
if (!this.decoderWorker) return;
|
|
380
|
-
const { header:
|
|
387
|
+
const { header: u, body: c } = o, { tagType: r, timestamp: n } = u;
|
|
381
388
|
switch (r) {
|
|
382
389
|
case "script":
|
|
383
390
|
{
|
|
384
|
-
const { width: e, height: t } =
|
|
391
|
+
const { width: e, height: t } = c;
|
|
385
392
|
(i = this.renderWorker) == null || i.setSize({ width: e, height: t }), this.on.demuxer.script && this.on.demuxer.script(o);
|
|
386
393
|
}
|
|
387
394
|
break;
|
|
388
395
|
case "audio":
|
|
389
396
|
{
|
|
390
|
-
const { accPacketType: e, data: t } =
|
|
397
|
+
const { accPacketType: e, data: t } = c;
|
|
391
398
|
if (e === 0) {
|
|
392
|
-
const { codec: s, sampleRate: l, channelConfiguration:
|
|
399
|
+
const { codec: s, sampleRate: l, channelConfiguration: a } = c, d = { codec: s, sampleRate: l, numberOfChannels: a, description: new Uint8Array([]) };
|
|
393
400
|
this.decoderWorker.audio.init(d);
|
|
394
401
|
} else e === 1 && this.decoderWorker.audio.decode({ type: "key", timestamp: n * 1, data: t });
|
|
395
402
|
this.on.demuxer.audio && this.on.demuxer.audio(o);
|
|
@@ -397,13 +404,13 @@ class be {
|
|
|
397
404
|
break;
|
|
398
405
|
case "video":
|
|
399
406
|
{
|
|
400
|
-
const { avcPacketType: e, frameType: t, data: s, nalus: l = [] } =
|
|
407
|
+
const { avcPacketType: e, frameType: t, data: s, nalus: l = [] } = c;
|
|
401
408
|
if (e === 0) {
|
|
402
|
-
const { codec:
|
|
403
|
-
this.decoderWorker.video.init({ codec:
|
|
409
|
+
const { codec: a, data: d } = c;
|
|
410
|
+
this.decoderWorker.video.init({ codec: a, description: d });
|
|
404
411
|
} else if (e === 1) {
|
|
405
|
-
const
|
|
406
|
-
this.decoderWorker.video.decode({ type:
|
|
412
|
+
const a = t === 1 ? "key" : "delta";
|
|
413
|
+
this.decoderWorker.video.decode({ type: a, timestamp: n * 1e3, data: s });
|
|
407
414
|
for (const d of l) {
|
|
408
415
|
const { header: y, payload: p } = d, { nal_unit_type: w } = y;
|
|
409
416
|
w === 6 && this.on.demuxer.sei && this.on.demuxer.sei(p);
|
|
@@ -425,15 +432,15 @@ class be {
|
|
|
425
432
|
*/
|
|
426
433
|
v(this, "initDecoder", () => {
|
|
427
434
|
this.decoderWorker = new j(), this.decoderWorker.on.audio.decode = (o) => {
|
|
428
|
-
var
|
|
429
|
-
(
|
|
435
|
+
var u;
|
|
436
|
+
(u = this.audioPlayer) == null || u.push(o), this.on.decoder.audio && this.on.decoder.audio(o);
|
|
430
437
|
}, this.decoderWorker.on.audio.error = (o) => {
|
|
431
438
|
this.stop(), this.on.error && this.on.error(o);
|
|
432
439
|
}, this.decoderWorker.on.video.decode = async (o) => {
|
|
433
|
-
var
|
|
434
|
-
(
|
|
435
|
-
const
|
|
436
|
-
for (const n of
|
|
440
|
+
var c, r;
|
|
441
|
+
(c = this.renderWorker) == null || c.push(o);
|
|
442
|
+
const u = [...this.cutRenders.keys()];
|
|
443
|
+
for (const n of u)
|
|
437
444
|
(r = this.cutRenders.get(n)) == null || r.worker.push(o);
|
|
438
445
|
this.on.decoder.video && this.on.decoder.video(o), o.bitmap.close();
|
|
439
446
|
}, this.decoderWorker.on.video.error = (o) => {
|
|
@@ -444,63 +451,63 @@ class be {
|
|
|
444
451
|
* 初始化渲染器
|
|
445
452
|
*/
|
|
446
453
|
v(this, "initRender", () => {
|
|
447
|
-
const { worker: o, canvas:
|
|
448
|
-
this.renderWorker = o, this.canvas =
|
|
454
|
+
const { worker: o, canvas: u, stream: c } = G(this.renderBaseTime);
|
|
455
|
+
this.renderWorker = o, this.canvas = u, this.stream = c, this.renderWorker.setPause(!1);
|
|
449
456
|
});
|
|
450
457
|
v(this, "getCanvas", () => this.canvas);
|
|
451
458
|
v(this, "getStream", () => this.stream);
|
|
452
459
|
v(this, "getCutCanvas", (o) => {
|
|
453
|
-
var
|
|
454
|
-
return (
|
|
460
|
+
var u;
|
|
461
|
+
return (u = this.cutRenders.get(o)) == null ? void 0 : u.canvas;
|
|
455
462
|
});
|
|
456
463
|
v(this, "getCutStream", (o) => {
|
|
457
|
-
var
|
|
458
|
-
return (
|
|
464
|
+
var u;
|
|
465
|
+
return (u = this.cutRenders.get(o)) == null ? void 0 : u.stream;
|
|
459
466
|
});
|
|
460
467
|
v(this, "setPause", (o) => {
|
|
461
|
-
var
|
|
462
|
-
(
|
|
468
|
+
var u;
|
|
469
|
+
(u = this.renderWorker) == null || u.setPause(o);
|
|
463
470
|
});
|
|
464
471
|
/**
|
|
465
472
|
* 设置渲染模式
|
|
466
473
|
*/
|
|
467
474
|
v(this, "setShader", (o) => {
|
|
468
|
-
var
|
|
469
|
-
(
|
|
475
|
+
var u;
|
|
476
|
+
(u = this.renderWorker) == null || u.setShader(o);
|
|
470
477
|
});
|
|
471
478
|
/**
|
|
472
479
|
* 是否静音 默认为true
|
|
473
480
|
* @param state?: boolean
|
|
474
481
|
*/
|
|
475
482
|
v(this, "setMute", (o) => {
|
|
476
|
-
var
|
|
477
|
-
return (
|
|
483
|
+
var u, c;
|
|
484
|
+
return (c = (u = this.audioPlayer) == null ? void 0 : u.prAudioStream) == null ? void 0 : c.setMute(o);
|
|
478
485
|
});
|
|
479
486
|
v(this, "cut", {
|
|
480
487
|
/**
|
|
481
488
|
* 创建剪切
|
|
482
489
|
*/
|
|
483
|
-
create: (o,
|
|
484
|
-
let
|
|
485
|
-
return
|
|
490
|
+
create: (o, u) => {
|
|
491
|
+
let c = this.cutRenders.get(o);
|
|
492
|
+
return c ? (c.worker.setCut(u), c.worker.setPause(!1), c) : (c = G(this.renderBaseTime), c.worker.setCut(u), this.cutRenders.set(o, c), c);
|
|
486
493
|
},
|
|
487
|
-
setPause: (o,
|
|
488
|
-
var
|
|
489
|
-
(
|
|
494
|
+
setPause: (o, u) => {
|
|
495
|
+
var c;
|
|
496
|
+
(c = this.cutRenders.get(o)) == null || c.worker.setPause(u);
|
|
490
497
|
},
|
|
491
498
|
/**
|
|
492
499
|
* 设置渲染模式
|
|
493
500
|
*/
|
|
494
|
-
setShader: (o,
|
|
495
|
-
var
|
|
496
|
-
(
|
|
501
|
+
setShader: (o, u) => {
|
|
502
|
+
var c;
|
|
503
|
+
(c = this.cutRenders.get(o)) == null || c.worker.setShader(u);
|
|
497
504
|
},
|
|
498
505
|
/**
|
|
499
506
|
* 移除剪切
|
|
500
507
|
*/
|
|
501
508
|
remove: (o) => {
|
|
502
|
-
var
|
|
503
|
-
(
|
|
509
|
+
var u;
|
|
510
|
+
(u = this.cutRenders.get(o)) == null || u.destroy(), this.cutRenders.delete(o);
|
|
504
511
|
}
|
|
505
512
|
});
|
|
506
513
|
}
|
|
@@ -510,14 +517,14 @@ var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u"
|
|
|
510
517
|
function requireAspromise() {
|
|
511
518
|
if (hasRequiredAspromise) return aspromise;
|
|
512
519
|
hasRequiredAspromise = 1, aspromise = f;
|
|
513
|
-
function f(o,
|
|
514
|
-
for (var
|
|
515
|
-
|
|
520
|
+
function f(o, u) {
|
|
521
|
+
for (var c = new Array(arguments.length - 1), r = 0, n = 2, i = !0; n < arguments.length; )
|
|
522
|
+
c[r++] = arguments[n++];
|
|
516
523
|
return new Promise(function(t, s) {
|
|
517
|
-
|
|
524
|
+
c[r] = function(a) {
|
|
518
525
|
if (i)
|
|
519
|
-
if (i = !1,
|
|
520
|
-
s(
|
|
526
|
+
if (i = !1, a)
|
|
527
|
+
s(a);
|
|
521
528
|
else {
|
|
522
529
|
for (var d = new Array(arguments.length - 1), y = 0; y < d.length; )
|
|
523
530
|
d[y++] = arguments[y];
|
|
@@ -525,7 +532,7 @@ function requireAspromise() {
|
|
|
525
532
|
}
|
|
526
533
|
};
|
|
527
534
|
try {
|
|
528
|
-
o.apply(
|
|
535
|
+
o.apply(u || null, c);
|
|
529
536
|
} catch (l) {
|
|
530
537
|
i && (i = !1, s(l));
|
|
531
538
|
}
|
|
@@ -545,50 +552,50 @@ function requireBase64() {
|
|
|
545
552
|
++s;
|
|
546
553
|
return Math.ceil(e.length * 3) / 4 - s;
|
|
547
554
|
};
|
|
548
|
-
for (var
|
|
549
|
-
u[
|
|
555
|
+
for (var u = new Array(64), c = new Array(123), r = 0; r < 64; )
|
|
556
|
+
c[u[r] = r < 26 ? r + 65 : r < 52 ? r + 71 : r < 62 ? r - 4 : r - 59 | 43] = r++;
|
|
550
557
|
o.encode = function(e, t, s) {
|
|
551
|
-
for (var l = null,
|
|
558
|
+
for (var l = null, a = [], d = 0, y = 0, p; t < s; ) {
|
|
552
559
|
var w = e[t++];
|
|
553
560
|
switch (y) {
|
|
554
561
|
case 0:
|
|
555
|
-
|
|
562
|
+
a[d++] = u[w >> 2], p = (w & 3) << 4, y = 1;
|
|
556
563
|
break;
|
|
557
564
|
case 1:
|
|
558
|
-
|
|
565
|
+
a[d++] = u[p | w >> 4], p = (w & 15) << 2, y = 2;
|
|
559
566
|
break;
|
|
560
567
|
case 2:
|
|
561
|
-
|
|
568
|
+
a[d++] = u[p | w >> 6], a[d++] = u[w & 63], y = 0;
|
|
562
569
|
break;
|
|
563
570
|
}
|
|
564
|
-
d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String,
|
|
571
|
+
d > 8191 && ((l || (l = [])).push(String.fromCharCode.apply(String, a)), d = 0);
|
|
565
572
|
}
|
|
566
|
-
return y && (
|
|
573
|
+
return y && (a[d++] = u[p], a[d++] = 61, y === 1 && (a[d++] = 61)), l ? (d && l.push(String.fromCharCode.apply(String, a.slice(0, d))), l.join("")) : String.fromCharCode.apply(String, a.slice(0, d));
|
|
567
574
|
};
|
|
568
575
|
var n = "invalid encoding";
|
|
569
576
|
o.decode = function(e, t, s) {
|
|
570
|
-
for (var l = s,
|
|
577
|
+
for (var l = s, a = 0, d, y = 0; y < e.length; ) {
|
|
571
578
|
var p = e.charCodeAt(y++);
|
|
572
|
-
if (p === 61 &&
|
|
579
|
+
if (p === 61 && a > 1)
|
|
573
580
|
break;
|
|
574
|
-
if ((p =
|
|
581
|
+
if ((p = c[p]) === void 0)
|
|
575
582
|
throw Error(n);
|
|
576
|
-
switch (
|
|
583
|
+
switch (a) {
|
|
577
584
|
case 0:
|
|
578
|
-
d = p,
|
|
585
|
+
d = p, a = 1;
|
|
579
586
|
break;
|
|
580
587
|
case 1:
|
|
581
|
-
t[s++] = d << 2 | (p & 48) >> 4, d = p,
|
|
588
|
+
t[s++] = d << 2 | (p & 48) >> 4, d = p, a = 2;
|
|
582
589
|
break;
|
|
583
590
|
case 2:
|
|
584
|
-
t[s++] = (d & 15) << 4 | (p & 60) >> 2, d = p,
|
|
591
|
+
t[s++] = (d & 15) << 4 | (p & 60) >> 2, d = p, a = 3;
|
|
585
592
|
break;
|
|
586
593
|
case 3:
|
|
587
|
-
t[s++] = (d & 3) << 6 | p,
|
|
594
|
+
t[s++] = (d & 3) << 6 | p, a = 0;
|
|
588
595
|
break;
|
|
589
596
|
}
|
|
590
597
|
}
|
|
591
|
-
if (
|
|
598
|
+
if (a === 1)
|
|
592
599
|
throw Error(n);
|
|
593
600
|
return s - l;
|
|
594
601
|
}, o.test = function(e) {
|
|
@@ -603,27 +610,27 @@ function requireEventemitter() {
|
|
|
603
610
|
function f() {
|
|
604
611
|
this._listeners = {};
|
|
605
612
|
}
|
|
606
|
-
return f.prototype.on = function(
|
|
607
|
-
return (this._listeners[
|
|
608
|
-
fn:
|
|
613
|
+
return f.prototype.on = function(u, c, r) {
|
|
614
|
+
return (this._listeners[u] || (this._listeners[u] = [])).push({
|
|
615
|
+
fn: c,
|
|
609
616
|
ctx: r || this
|
|
610
617
|
}), this;
|
|
611
|
-
}, f.prototype.off = function(
|
|
612
|
-
if (
|
|
618
|
+
}, f.prototype.off = function(u, c) {
|
|
619
|
+
if (u === void 0)
|
|
613
620
|
this._listeners = {};
|
|
614
|
-
else if (
|
|
615
|
-
this._listeners[
|
|
621
|
+
else if (c === void 0)
|
|
622
|
+
this._listeners[u] = [];
|
|
616
623
|
else
|
|
617
|
-
for (var r = this._listeners[
|
|
618
|
-
r[n].fn ===
|
|
624
|
+
for (var r = this._listeners[u], n = 0; n < r.length; )
|
|
625
|
+
r[n].fn === c ? r.splice(n, 1) : ++n;
|
|
619
626
|
return this;
|
|
620
|
-
}, f.prototype.emit = function(
|
|
621
|
-
var
|
|
622
|
-
if (
|
|
627
|
+
}, f.prototype.emit = function(u) {
|
|
628
|
+
var c = this._listeners[u];
|
|
629
|
+
if (c) {
|
|
623
630
|
for (var r = [], n = 1; n < arguments.length; )
|
|
624
631
|
r.push(arguments[n++]);
|
|
625
|
-
for (n = 0; n <
|
|
626
|
-
|
|
632
|
+
for (n = 0; n < c.length; )
|
|
633
|
+
c[n].fn.apply(c[n++].ctx, r);
|
|
627
634
|
}
|
|
628
635
|
return this;
|
|
629
636
|
}, eventemitter;
|
|
@@ -642,15 +649,15 @@ function requireFloat() {
|
|
|
642
649
|
i[0] = y, p[w] = e[3], p[w + 1] = e[2], p[w + 2] = e[1], p[w + 3] = e[0];
|
|
643
650
|
}
|
|
644
651
|
n.writeFloatLE = t ? s : l, n.writeFloatBE = t ? l : s;
|
|
645
|
-
function
|
|
652
|
+
function a(y, p) {
|
|
646
653
|
return e[0] = y[p], e[1] = y[p + 1], e[2] = y[p + 2], e[3] = y[p + 3], i[0];
|
|
647
654
|
}
|
|
648
655
|
function d(y, p) {
|
|
649
656
|
return e[3] = y[p], e[2] = y[p + 1], e[1] = y[p + 2], e[0] = y[p + 3], i[0];
|
|
650
657
|
}
|
|
651
|
-
n.readFloatLE = t ?
|
|
658
|
+
n.readFloatLE = t ? a : d, n.readFloatBE = t ? d : a;
|
|
652
659
|
}() : function() {
|
|
653
|
-
function i(t, s, l,
|
|
660
|
+
function i(t, s, l, a) {
|
|
654
661
|
var d = s < 0 ? 1 : 0;
|
|
655
662
|
if (d && (s = -s), s === 0)
|
|
656
663
|
t(1 / s > 0 ? (
|
|
@@ -659,24 +666,24 @@ function requireFloat() {
|
|
|
659
666
|
) : (
|
|
660
667
|
/* negative 0 */
|
|
661
668
|
2147483648
|
|
662
|
-
), l,
|
|
669
|
+
), l, a);
|
|
663
670
|
else if (isNaN(s))
|
|
664
|
-
t(2143289344, l,
|
|
671
|
+
t(2143289344, l, a);
|
|
665
672
|
else if (s > 34028234663852886e22)
|
|
666
|
-
t((d << 31 | 2139095040) >>> 0, l,
|
|
673
|
+
t((d << 31 | 2139095040) >>> 0, l, a);
|
|
667
674
|
else if (s < 11754943508222875e-54)
|
|
668
|
-
t((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l,
|
|
675
|
+
t((d << 31 | Math.round(s / 1401298464324817e-60)) >>> 0, l, a);
|
|
669
676
|
else {
|
|
670
677
|
var y = Math.floor(Math.log(s) / Math.LN2), p = Math.round(s * Math.pow(2, -y) * 8388608) & 8388607;
|
|
671
|
-
t((d << 31 | y + 127 << 23 | p) >>> 0, l,
|
|
678
|
+
t((d << 31 | y + 127 << 23 | p) >>> 0, l, a);
|
|
672
679
|
}
|
|
673
680
|
}
|
|
674
|
-
n.writeFloatLE = i.bind(null, o), n.writeFloatBE = i.bind(null,
|
|
681
|
+
n.writeFloatLE = i.bind(null, o), n.writeFloatBE = i.bind(null, u);
|
|
675
682
|
function e(t, s, l) {
|
|
676
|
-
var
|
|
683
|
+
var a = t(s, l), d = (a >> 31) * 2 + 1, y = a >>> 23 & 255, p = a & 8388607;
|
|
677
684
|
return y === 255 ? p ? NaN : d * (1 / 0) : y === 0 ? d * 1401298464324817e-60 * p : d * Math.pow(2, y - 150) * (p + 8388608);
|
|
678
685
|
}
|
|
679
|
-
n.readFloatLE = e.bind(null,
|
|
686
|
+
n.readFloatLE = e.bind(null, c), n.readFloatBE = e.bind(null, r);
|
|
680
687
|
}(), typeof Float64Array < "u" ? function() {
|
|
681
688
|
var i = new Float64Array([-0]), e = new Uint8Array(i.buffer), t = e[7] === 128;
|
|
682
689
|
function s(y, p, w) {
|
|
@@ -686,53 +693,53 @@ function requireFloat() {
|
|
|
686
693
|
i[0] = y, p[w] = e[7], p[w + 1] = e[6], p[w + 2] = e[5], p[w + 3] = e[4], p[w + 4] = e[3], p[w + 5] = e[2], p[w + 6] = e[1], p[w + 7] = e[0];
|
|
687
694
|
}
|
|
688
695
|
n.writeDoubleLE = t ? s : l, n.writeDoubleBE = t ? l : s;
|
|
689
|
-
function
|
|
696
|
+
function a(y, p) {
|
|
690
697
|
return e[0] = y[p], e[1] = y[p + 1], e[2] = y[p + 2], e[3] = y[p + 3], e[4] = y[p + 4], e[5] = y[p + 5], e[6] = y[p + 6], e[7] = y[p + 7], i[0];
|
|
691
698
|
}
|
|
692
699
|
function d(y, p) {
|
|
693
700
|
return e[7] = y[p], e[6] = y[p + 1], e[5] = y[p + 2], e[4] = y[p + 3], e[3] = y[p + 4], e[2] = y[p + 5], e[1] = y[p + 6], e[0] = y[p + 7], i[0];
|
|
694
701
|
}
|
|
695
|
-
n.readDoubleLE = t ?
|
|
702
|
+
n.readDoubleLE = t ? a : d, n.readDoubleBE = t ? d : a;
|
|
696
703
|
}() : function() {
|
|
697
|
-
function i(t, s, l,
|
|
698
|
-
var p =
|
|
699
|
-
if (p && (
|
|
700
|
-
t(0, d, y + s), t(1 /
|
|
704
|
+
function i(t, s, l, a, d, y) {
|
|
705
|
+
var p = a < 0 ? 1 : 0;
|
|
706
|
+
if (p && (a = -a), a === 0)
|
|
707
|
+
t(0, d, y + s), t(1 / a > 0 ? (
|
|
701
708
|
/* positive */
|
|
702
709
|
0
|
|
703
710
|
) : (
|
|
704
711
|
/* negative 0 */
|
|
705
712
|
2147483648
|
|
706
713
|
), d, y + l);
|
|
707
|
-
else if (isNaN(
|
|
714
|
+
else if (isNaN(a))
|
|
708
715
|
t(0, d, y + s), t(2146959360, d, y + l);
|
|
709
|
-
else if (
|
|
716
|
+
else if (a > 17976931348623157e292)
|
|
710
717
|
t(0, d, y + s), t((p << 31 | 2146435072) >>> 0, d, y + l);
|
|
711
718
|
else {
|
|
712
719
|
var w;
|
|
713
|
-
if (
|
|
714
|
-
w =
|
|
720
|
+
if (a < 22250738585072014e-324)
|
|
721
|
+
w = a / 5e-324, t(w >>> 0, d, y + s), t((p << 31 | w / 4294967296) >>> 0, d, y + l);
|
|
715
722
|
else {
|
|
716
|
-
var b = Math.floor(Math.log(
|
|
717
|
-
b === 1024 && (b = 1023), w =
|
|
723
|
+
var b = Math.floor(Math.log(a) / Math.LN2);
|
|
724
|
+
b === 1024 && (b = 1023), w = a * Math.pow(2, -b), t(w * 4503599627370496 >>> 0, d, y + s), t((p << 31 | b + 1023 << 20 | w * 1048576 & 1048575) >>> 0, d, y + l);
|
|
718
725
|
}
|
|
719
726
|
}
|
|
720
727
|
}
|
|
721
|
-
n.writeDoubleLE = i.bind(null, o, 0, 4), n.writeDoubleBE = i.bind(null,
|
|
722
|
-
function e(t, s, l,
|
|
723
|
-
var y = t(
|
|
728
|
+
n.writeDoubleLE = i.bind(null, o, 0, 4), n.writeDoubleBE = i.bind(null, u, 4, 0);
|
|
729
|
+
function e(t, s, l, a, d) {
|
|
730
|
+
var y = t(a, d + s), p = t(a, d + l), w = (p >> 31) * 2 + 1, b = p >>> 20 & 2047, m = 4294967296 * (p & 1048575) + y;
|
|
724
731
|
return b === 2047 ? m ? NaN : w * (1 / 0) : b === 0 ? w * 5e-324 * m : w * Math.pow(2, b - 1075) * (m + 4503599627370496);
|
|
725
732
|
}
|
|
726
|
-
n.readDoubleLE = e.bind(null,
|
|
733
|
+
n.readDoubleLE = e.bind(null, c, 0, 4), n.readDoubleBE = e.bind(null, r, 4, 0);
|
|
727
734
|
}(), n;
|
|
728
735
|
}
|
|
729
736
|
function o(n, i, e) {
|
|
730
737
|
i[e] = n & 255, i[e + 1] = n >>> 8 & 255, i[e + 2] = n >>> 16 & 255, i[e + 3] = n >>> 24;
|
|
731
738
|
}
|
|
732
|
-
function
|
|
739
|
+
function u(n, i, e) {
|
|
733
740
|
i[e] = n >>> 24, i[e + 1] = n >>> 16 & 255, i[e + 2] = n >>> 8 & 255, i[e + 3] = n & 255;
|
|
734
741
|
}
|
|
735
|
-
function
|
|
742
|
+
function c(n, i) {
|
|
736
743
|
return (n[i] | n[i + 1] << 8 | n[i + 2] << 16 | n[i + 3] << 24) >>> 0;
|
|
737
744
|
}
|
|
738
745
|
function r(n, i) {
|
|
@@ -759,20 +766,20 @@ var utf8 = {}, hasRequiredUtf8;
|
|
|
759
766
|
function requireUtf8() {
|
|
760
767
|
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(f) {
|
|
761
768
|
var o = f;
|
|
762
|
-
o.length = function(
|
|
763
|
-
for (var r = 0, n = 0, i = 0; i <
|
|
764
|
-
n =
|
|
769
|
+
o.length = function(c) {
|
|
770
|
+
for (var r = 0, n = 0, i = 0; i < c.length; ++i)
|
|
771
|
+
n = c.charCodeAt(i), n < 128 ? r += 1 : n < 2048 ? r += 2 : (n & 64512) === 55296 && (c.charCodeAt(i + 1) & 64512) === 56320 ? (++i, r += 4) : r += 3;
|
|
765
772
|
return r;
|
|
766
|
-
}, o.read = function(
|
|
773
|
+
}, o.read = function(c, r, n) {
|
|
767
774
|
var i = n - r;
|
|
768
775
|
if (i < 1)
|
|
769
776
|
return "";
|
|
770
777
|
for (var e = null, t = [], s = 0, l; r < n; )
|
|
771
|
-
l =
|
|
778
|
+
l = c[r++], l < 128 ? t[s++] = l : l > 191 && l < 224 ? t[s++] = (l & 31) << 6 | c[r++] & 63 : l > 239 && l < 365 ? (l = ((l & 7) << 18 | (c[r++] & 63) << 12 | (c[r++] & 63) << 6 | c[r++] & 63) - 65536, t[s++] = 55296 + (l >> 10), t[s++] = 56320 + (l & 1023)) : t[s++] = (l & 15) << 12 | (c[r++] & 63) << 6 | c[r++] & 63, s > 8191 && ((e || (e = [])).push(String.fromCharCode.apply(String, t)), s = 0);
|
|
772
779
|
return e ? (s && e.push(String.fromCharCode.apply(String, t.slice(0, s))), e.join("")) : String.fromCharCode.apply(String, t.slice(0, s));
|
|
773
|
-
}, o.write = function(
|
|
774
|
-
for (var i = n, e, t, s = 0; s <
|
|
775
|
-
e =
|
|
780
|
+
}, o.write = function(c, r, n) {
|
|
781
|
+
for (var i = n, e, t, s = 0; s < c.length; ++s)
|
|
782
|
+
e = c.charCodeAt(s), e < 128 ? r[n++] = e : e < 2048 ? (r[n++] = e >> 6 | 192, r[n++] = e & 63 | 128) : (e & 64512) === 55296 && ((t = c.charCodeAt(s + 1)) & 64512) === 56320 ? (e = 65536 + ((e & 1023) << 10) + (t & 1023), ++s, r[n++] = e >> 18 | 240, r[n++] = e >> 12 & 63 | 128, r[n++] = e >> 6 & 63 | 128, r[n++] = e & 63 | 128) : (r[n++] = e >> 12 | 224, r[n++] = e >> 6 & 63 | 128, r[n++] = e & 63 | 128);
|
|
776
783
|
return n - i;
|
|
777
784
|
};
|
|
778
785
|
}(utf8)), utf8;
|
|
@@ -781,13 +788,13 @@ var pool_1, hasRequiredPool;
|
|
|
781
788
|
function requirePool() {
|
|
782
789
|
if (hasRequiredPool) return pool_1;
|
|
783
790
|
hasRequiredPool = 1, pool_1 = f;
|
|
784
|
-
function f(o,
|
|
785
|
-
var r =
|
|
791
|
+
function f(o, u, c) {
|
|
792
|
+
var r = c || 8192, n = r >>> 1, i = null, e = r;
|
|
786
793
|
return function(s) {
|
|
787
794
|
if (s < 1 || s > n)
|
|
788
795
|
return o(s);
|
|
789
796
|
e + s > r && (i = o(r), e = 0);
|
|
790
|
-
var l =
|
|
797
|
+
var l = u.call(i, e, e += s);
|
|
791
798
|
return e & 7 && (e = (e | 7) + 1), l;
|
|
792
799
|
};
|
|
793
800
|
}
|
|
@@ -801,18 +808,18 @@ function requireLongbits() {
|
|
|
801
808
|
function o(n, i) {
|
|
802
809
|
this.lo = n >>> 0, this.hi = i >>> 0;
|
|
803
810
|
}
|
|
804
|
-
var
|
|
805
|
-
|
|
811
|
+
var u = o.zero = new o(0, 0);
|
|
812
|
+
u.toNumber = function() {
|
|
806
813
|
return 0;
|
|
807
|
-
},
|
|
814
|
+
}, u.zzEncode = u.zzDecode = function() {
|
|
808
815
|
return this;
|
|
809
|
-
},
|
|
816
|
+
}, u.length = function() {
|
|
810
817
|
return 1;
|
|
811
818
|
};
|
|
812
|
-
var
|
|
819
|
+
var c = o.zeroHash = "\0\0\0\0\0\0\0\0";
|
|
813
820
|
o.fromNumber = function(i) {
|
|
814
821
|
if (i === 0)
|
|
815
|
-
return
|
|
822
|
+
return u;
|
|
816
823
|
var e = i < 0;
|
|
817
824
|
e && (i = -i);
|
|
818
825
|
var t = i >>> 0, s = (i - t) / 4294967296 >>> 0;
|
|
@@ -825,7 +832,7 @@ function requireLongbits() {
|
|
|
825
832
|
i = f.Long.fromString(i);
|
|
826
833
|
else
|
|
827
834
|
return o.fromNumber(parseInt(i, 10));
|
|
828
|
-
return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) :
|
|
835
|
+
return i.low || i.high ? new o(i.low >>> 0, i.high >>> 0) : u;
|
|
829
836
|
}, o.prototype.toNumber = function(i) {
|
|
830
837
|
if (!i && this.hi >>> 31) {
|
|
831
838
|
var e = ~this.lo + 1 >>> 0, t = ~this.hi >>> 0;
|
|
@@ -837,7 +844,7 @@ function requireLongbits() {
|
|
|
837
844
|
};
|
|
838
845
|
var r = String.prototype.charCodeAt;
|
|
839
846
|
return o.fromHash = function(i) {
|
|
840
|
-
return i ===
|
|
847
|
+
return i === c ? u : new o(
|
|
841
848
|
(r.call(i, 0) | r.call(i, 1) << 8 | r.call(i, 2) << 16 | r.call(i, 3) << 24) >>> 0,
|
|
842
849
|
(r.call(i, 4) | r.call(i, 5) << 8 | r.call(i, 6) << 16 | r.call(i, 7) << 24) >>> 0
|
|
843
850
|
);
|
|
@@ -910,21 +917,21 @@ function requireMinimal$1() {
|
|
|
910
917
|
var e = o.LongBits.fromHash(n);
|
|
911
918
|
return o.Long ? o.Long.fromBits(e.lo, e.hi, i) : e.toNumber(!!i);
|
|
912
919
|
};
|
|
913
|
-
function
|
|
920
|
+
function u(r, n, i) {
|
|
914
921
|
for (var e = Object.keys(n), t = 0; t < e.length; ++t)
|
|
915
922
|
(r[e[t]] === void 0 || !i) && (r[e[t]] = n[e[t]]);
|
|
916
923
|
return r;
|
|
917
924
|
}
|
|
918
|
-
o.merge =
|
|
925
|
+
o.merge = u, o.lcFirst = function(n) {
|
|
919
926
|
return n.charAt(0).toLowerCase() + n.substring(1);
|
|
920
927
|
};
|
|
921
|
-
function
|
|
928
|
+
function c(r) {
|
|
922
929
|
function n(i, e) {
|
|
923
930
|
if (!(this instanceof n))
|
|
924
931
|
return new n(i, e);
|
|
925
932
|
Object.defineProperty(this, "message", { get: function() {
|
|
926
933
|
return i;
|
|
927
|
-
} }), Error.captureStackTrace ? Error.captureStackTrace(this, n) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), e &&
|
|
934
|
+
} }), Error.captureStackTrace ? Error.captureStackTrace(this, n) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), e && u(this, e);
|
|
928
935
|
}
|
|
929
936
|
return n.prototype = Object.create(Error.prototype, {
|
|
930
937
|
constructor: {
|
|
@@ -955,7 +962,7 @@ function requireMinimal$1() {
|
|
|
955
962
|
}
|
|
956
963
|
}), n;
|
|
957
964
|
}
|
|
958
|
-
o.newError =
|
|
965
|
+
o.newError = c, o.ProtocolError = c("ProtocolError"), o.oneOfGetter = function(n) {
|
|
959
966
|
for (var i = {}, e = 0; e < n.length; ++e)
|
|
960
967
|
i[n[e]] = 1;
|
|
961
968
|
return function() {
|
|
@@ -993,7 +1000,7 @@ var writer, hasRequiredWriter;
|
|
|
993
1000
|
function requireWriter() {
|
|
994
1001
|
if (hasRequiredWriter) return writer;
|
|
995
1002
|
hasRequiredWriter = 1, writer = t;
|
|
996
|
-
var f = requireMinimal$1(), o,
|
|
1003
|
+
var f = requireMinimal$1(), o, u = f.LongBits, c = f.base64, r = f.utf8;
|
|
997
1004
|
function n(b, m, g) {
|
|
998
1005
|
this.fn = b, this.len = m, this.next = void 0, this.val = g;
|
|
999
1006
|
}
|
|
@@ -1022,7 +1029,7 @@ function requireWriter() {
|
|
|
1022
1029
|
function l(b, m, g) {
|
|
1023
1030
|
m[g] = b & 255;
|
|
1024
1031
|
}
|
|
1025
|
-
function
|
|
1032
|
+
function a(b, m, g) {
|
|
1026
1033
|
for (; b > 127; )
|
|
1027
1034
|
m[g++] = b & 127 | 128, b >>>= 7;
|
|
1028
1035
|
m[g] = b;
|
|
@@ -1030,13 +1037,13 @@ function requireWriter() {
|
|
|
1030
1037
|
function d(b, m) {
|
|
1031
1038
|
this.len = b, this.next = void 0, this.val = m;
|
|
1032
1039
|
}
|
|
1033
|
-
d.prototype = Object.create(n.prototype), d.prototype.fn =
|
|
1040
|
+
d.prototype = Object.create(n.prototype), d.prototype.fn = a, t.prototype.uint32 = function(m) {
|
|
1034
1041
|
return this.len += (this.tail = this.tail.next = new d(
|
|
1035
1042
|
(m = m >>> 0) < 128 ? 1 : m < 16384 ? 2 : m < 2097152 ? 3 : m < 268435456 ? 4 : 5,
|
|
1036
1043
|
m
|
|
1037
1044
|
)).len, this;
|
|
1038
1045
|
}, t.prototype.int32 = function(m) {
|
|
1039
|
-
return m < 0 ? this._push(y, 10,
|
|
1046
|
+
return m < 0 ? this._push(y, 10, u.fromNumber(m)) : this.uint32(m);
|
|
1040
1047
|
}, t.prototype.sint32 = function(m) {
|
|
1041
1048
|
return this.uint32((m << 1 ^ m >> 31) >>> 0);
|
|
1042
1049
|
};
|
|
@@ -1048,10 +1055,10 @@ function requireWriter() {
|
|
|
1048
1055
|
m[g++] = b.lo;
|
|
1049
1056
|
}
|
|
1050
1057
|
t.prototype.uint64 = function(m) {
|
|
1051
|
-
var g =
|
|
1058
|
+
var g = u.from(m);
|
|
1052
1059
|
return this._push(y, g.length(), g);
|
|
1053
1060
|
}, t.prototype.int64 = t.prototype.uint64, t.prototype.sint64 = function(m) {
|
|
1054
|
-
var g =
|
|
1061
|
+
var g = u.from(m).zzEncode();
|
|
1055
1062
|
return this._push(y, g.length(), g);
|
|
1056
1063
|
}, t.prototype.bool = function(m) {
|
|
1057
1064
|
return this._push(l, 1, m ? 1 : 0);
|
|
@@ -1062,7 +1069,7 @@ function requireWriter() {
|
|
|
1062
1069
|
t.prototype.fixed32 = function(m) {
|
|
1063
1070
|
return this._push(p, 4, m >>> 0);
|
|
1064
1071
|
}, t.prototype.sfixed32 = t.prototype.fixed32, t.prototype.fixed64 = function(m) {
|
|
1065
|
-
var g =
|
|
1072
|
+
var g = u.from(m);
|
|
1066
1073
|
return this._push(p, 4, g.lo)._push(p, 4, g.hi);
|
|
1067
1074
|
}, t.prototype.sfixed64 = t.prototype.fixed64, t.prototype.float = function(m) {
|
|
1068
1075
|
return this._push(f.float.writeFloatLE, 4, m);
|
|
@@ -1080,8 +1087,8 @@ function requireWriter() {
|
|
|
1080
1087
|
if (!g)
|
|
1081
1088
|
return this._push(l, 1, 0);
|
|
1082
1089
|
if (f.isString(m)) {
|
|
1083
|
-
var k = t.alloc(g =
|
|
1084
|
-
|
|
1090
|
+
var k = t.alloc(g = c.length(m));
|
|
1091
|
+
c.decode(m, k, 0), m = k;
|
|
1085
1092
|
}
|
|
1086
1093
|
return this.uint32(g)._push(w, g, m);
|
|
1087
1094
|
}, t.prototype.string = function(m) {
|
|
@@ -1105,15 +1112,15 @@ function requireWriter() {
|
|
|
1105
1112
|
var writer_buffer, hasRequiredWriter_buffer;
|
|
1106
1113
|
function requireWriter_buffer() {
|
|
1107
1114
|
if (hasRequiredWriter_buffer) return writer_buffer;
|
|
1108
|
-
hasRequiredWriter_buffer = 1, writer_buffer =
|
|
1115
|
+
hasRequiredWriter_buffer = 1, writer_buffer = u;
|
|
1109
1116
|
var f = requireWriter();
|
|
1110
|
-
(
|
|
1117
|
+
(u.prototype = Object.create(f.prototype)).constructor = u;
|
|
1111
1118
|
var o = requireMinimal$1();
|
|
1112
|
-
function
|
|
1119
|
+
function u() {
|
|
1113
1120
|
f.call(this);
|
|
1114
1121
|
}
|
|
1115
|
-
|
|
1116
|
-
|
|
1122
|
+
u._configure = function() {
|
|
1123
|
+
u.alloc = o._Buffer_allocUnsafe, u.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(n, i, e) {
|
|
1117
1124
|
i.set(n, e);
|
|
1118
1125
|
} : function(n, i, e) {
|
|
1119
1126
|
if (n.copy)
|
|
@@ -1121,29 +1128,29 @@ function requireWriter_buffer() {
|
|
|
1121
1128
|
else for (var t = 0; t < n.length; )
|
|
1122
1129
|
i[e++] = n[t++];
|
|
1123
1130
|
};
|
|
1124
|
-
},
|
|
1131
|
+
}, u.prototype.bytes = function(n) {
|
|
1125
1132
|
o.isString(n) && (n = o._Buffer_from(n, "base64"));
|
|
1126
1133
|
var i = n.length >>> 0;
|
|
1127
|
-
return this.uint32(i), i && this._push(
|
|
1134
|
+
return this.uint32(i), i && this._push(u.writeBytesBuffer, i, n), this;
|
|
1128
1135
|
};
|
|
1129
|
-
function
|
|
1136
|
+
function c(r, n, i) {
|
|
1130
1137
|
r.length < 40 ? o.utf8.write(r, n, i) : n.utf8Write ? n.utf8Write(r, i) : n.write(r, i);
|
|
1131
1138
|
}
|
|
1132
|
-
return
|
|
1139
|
+
return u.prototype.string = function(n) {
|
|
1133
1140
|
var i = o.Buffer.byteLength(n);
|
|
1134
|
-
return this.uint32(i), i && this._push(
|
|
1135
|
-
},
|
|
1141
|
+
return this.uint32(i), i && this._push(c, i, n), this;
|
|
1142
|
+
}, u._configure(), writer_buffer;
|
|
1136
1143
|
}
|
|
1137
1144
|
var reader, hasRequiredReader;
|
|
1138
1145
|
function requireReader() {
|
|
1139
1146
|
if (hasRequiredReader) return reader;
|
|
1140
1147
|
hasRequiredReader = 1, reader = n;
|
|
1141
|
-
var f = requireMinimal$1(), o,
|
|
1142
|
-
function r(
|
|
1143
|
-
return RangeError("index out of range: " +
|
|
1148
|
+
var f = requireMinimal$1(), o, u = f.LongBits, c = f.utf8;
|
|
1149
|
+
function r(a, d) {
|
|
1150
|
+
return RangeError("index out of range: " + a.pos + " + " + (d || 1) + " > " + a.len);
|
|
1144
1151
|
}
|
|
1145
|
-
function n(
|
|
1146
|
-
this.buf =
|
|
1152
|
+
function n(a) {
|
|
1153
|
+
this.buf = a, this.pos = 0, this.len = a.length;
|
|
1147
1154
|
}
|
|
1148
1155
|
var i = typeof Uint8Array < "u" ? function(d) {
|
|
1149
1156
|
if (d instanceof Uint8Array || Array.isArray(d))
|
|
@@ -1176,41 +1183,41 @@ function requireReader() {
|
|
|
1176
1183
|
return d >>> 1 ^ -(d & 1) | 0;
|
|
1177
1184
|
};
|
|
1178
1185
|
function t() {
|
|
1179
|
-
var
|
|
1186
|
+
var a = new u(0, 0), d = 0;
|
|
1180
1187
|
if (this.len - this.pos > 4) {
|
|
1181
1188
|
for (; d < 4; ++d)
|
|
1182
|
-
if (
|
|
1183
|
-
return
|
|
1184
|
-
if (
|
|
1185
|
-
return
|
|
1189
|
+
if (a.lo = (a.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
1190
|
+
return a;
|
|
1191
|
+
if (a.lo = (a.lo | (this.buf[this.pos] & 127) << 28) >>> 0, a.hi = (a.hi | (this.buf[this.pos] & 127) >> 4) >>> 0, this.buf[this.pos++] < 128)
|
|
1192
|
+
return a;
|
|
1186
1193
|
d = 0;
|
|
1187
1194
|
} else {
|
|
1188
1195
|
for (; d < 3; ++d) {
|
|
1189
1196
|
if (this.pos >= this.len)
|
|
1190
1197
|
throw r(this);
|
|
1191
|
-
if (
|
|
1192
|
-
return
|
|
1198
|
+
if (a.lo = (a.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
1199
|
+
return a;
|
|
1193
1200
|
}
|
|
1194
|
-
return
|
|
1201
|
+
return a.lo = (a.lo | (this.buf[this.pos++] & 127) << d * 7) >>> 0, a;
|
|
1195
1202
|
}
|
|
1196
1203
|
if (this.len - this.pos > 4) {
|
|
1197
1204
|
for (; d < 5; ++d)
|
|
1198
|
-
if (
|
|
1199
|
-
return
|
|
1205
|
+
if (a.hi = (a.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
1206
|
+
return a;
|
|
1200
1207
|
} else
|
|
1201
1208
|
for (; d < 5; ++d) {
|
|
1202
1209
|
if (this.pos >= this.len)
|
|
1203
1210
|
throw r(this);
|
|
1204
|
-
if (
|
|
1205
|
-
return
|
|
1211
|
+
if (a.hi = (a.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
1212
|
+
return a;
|
|
1206
1213
|
}
|
|
1207
1214
|
throw Error("invalid varint encoding");
|
|
1208
1215
|
}
|
|
1209
1216
|
n.prototype.bool = function() {
|
|
1210
1217
|
return this.uint32() !== 0;
|
|
1211
1218
|
};
|
|
1212
|
-
function s(
|
|
1213
|
-
return (
|
|
1219
|
+
function s(a, d) {
|
|
1220
|
+
return (a[d - 4] | a[d - 3] << 8 | a[d - 2] << 16 | a[d - 1] << 24) >>> 0;
|
|
1214
1221
|
}
|
|
1215
1222
|
n.prototype.fixed32 = function() {
|
|
1216
1223
|
if (this.pos + 4 > this.len)
|
|
@@ -1224,7 +1231,7 @@ function requireReader() {
|
|
|
1224
1231
|
function l() {
|
|
1225
1232
|
if (this.pos + 8 > this.len)
|
|
1226
1233
|
throw r(this, 8);
|
|
1227
|
-
return new
|
|
1234
|
+
return new u(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
|
|
1228
1235
|
}
|
|
1229
1236
|
return n.prototype.float = function() {
|
|
1230
1237
|
if (this.pos + 4 > this.len)
|
|
@@ -1249,7 +1256,7 @@ function requireReader() {
|
|
|
1249
1256
|
return this._slice.call(this.buf, y, p);
|
|
1250
1257
|
}, n.prototype.string = function() {
|
|
1251
1258
|
var d = this.bytes();
|
|
1252
|
-
return
|
|
1259
|
+
return c.read(d, 0, d.length);
|
|
1253
1260
|
}, n.prototype.skip = function(d) {
|
|
1254
1261
|
if (typeof d == "number") {
|
|
1255
1262
|
if (this.pos + d > this.len)
|
|
@@ -1261,8 +1268,8 @@ function requireReader() {
|
|
|
1261
1268
|
throw r(this);
|
|
1262
1269
|
while (this.buf[this.pos++] & 128);
|
|
1263
1270
|
return this;
|
|
1264
|
-
}, n.prototype.skipType = function(
|
|
1265
|
-
switch (
|
|
1271
|
+
}, n.prototype.skipType = function(a) {
|
|
1272
|
+
switch (a) {
|
|
1266
1273
|
case 0:
|
|
1267
1274
|
this.skip();
|
|
1268
1275
|
break;
|
|
@@ -1273,19 +1280,19 @@ function requireReader() {
|
|
|
1273
1280
|
this.skip(this.uint32());
|
|
1274
1281
|
break;
|
|
1275
1282
|
case 3:
|
|
1276
|
-
for (; (
|
|
1277
|
-
this.skipType(
|
|
1283
|
+
for (; (a = this.uint32() & 7) !== 4; )
|
|
1284
|
+
this.skipType(a);
|
|
1278
1285
|
break;
|
|
1279
1286
|
case 5:
|
|
1280
1287
|
this.skip(4);
|
|
1281
1288
|
break;
|
|
1282
1289
|
/* istanbul ignore next */
|
|
1283
1290
|
default:
|
|
1284
|
-
throw Error("invalid wire type " +
|
|
1291
|
+
throw Error("invalid wire type " + a + " at offset " + this.pos);
|
|
1285
1292
|
}
|
|
1286
1293
|
return this;
|
|
1287
|
-
}, n._configure = function(
|
|
1288
|
-
o =
|
|
1294
|
+
}, n._configure = function(a) {
|
|
1295
|
+
o = a, n.create = e(), o._configure();
|
|
1289
1296
|
var d = f.Long ? "toLong" : (
|
|
1290
1297
|
/* istanbul ignore next */
|
|
1291
1298
|
"toNumber"
|
|
@@ -1312,19 +1319,19 @@ function requireReader() {
|
|
|
1312
1319
|
var reader_buffer, hasRequiredReader_buffer;
|
|
1313
1320
|
function requireReader_buffer() {
|
|
1314
1321
|
if (hasRequiredReader_buffer) return reader_buffer;
|
|
1315
|
-
hasRequiredReader_buffer = 1, reader_buffer =
|
|
1322
|
+
hasRequiredReader_buffer = 1, reader_buffer = u;
|
|
1316
1323
|
var f = requireReader();
|
|
1317
|
-
(
|
|
1324
|
+
(u.prototype = Object.create(f.prototype)).constructor = u;
|
|
1318
1325
|
var o = requireMinimal$1();
|
|
1319
|
-
function
|
|
1320
|
-
f.call(this,
|
|
1326
|
+
function u(c) {
|
|
1327
|
+
f.call(this, c);
|
|
1321
1328
|
}
|
|
1322
|
-
return
|
|
1323
|
-
o.Buffer && (
|
|
1324
|
-
},
|
|
1329
|
+
return u._configure = function() {
|
|
1330
|
+
o.Buffer && (u.prototype._slice = o.Buffer.prototype.slice);
|
|
1331
|
+
}, u.prototype.string = function() {
|
|
1325
1332
|
var r = this.uint32();
|
|
1326
1333
|
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + r, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + r, this.len));
|
|
1327
|
-
},
|
|
1334
|
+
}, u._configure(), reader_buffer;
|
|
1328
1335
|
}
|
|
1329
1336
|
var rpc = {}, service, hasRequiredService;
|
|
1330
1337
|
function requireService() {
|
|
@@ -1332,17 +1339,17 @@ function requireService() {
|
|
|
1332
1339
|
hasRequiredService = 1, service = o;
|
|
1333
1340
|
var f = requireMinimal$1();
|
|
1334
1341
|
(o.prototype = Object.create(f.EventEmitter.prototype)).constructor = o;
|
|
1335
|
-
function o(
|
|
1336
|
-
if (typeof
|
|
1342
|
+
function o(u, c, r) {
|
|
1343
|
+
if (typeof u != "function")
|
|
1337
1344
|
throw TypeError("rpcImpl must be a function");
|
|
1338
|
-
f.EventEmitter.call(this), this.rpcImpl =
|
|
1345
|
+
f.EventEmitter.call(this), this.rpcImpl = u, this.requestDelimited = !!c, this.responseDelimited = !!r;
|
|
1339
1346
|
}
|
|
1340
|
-
return o.prototype.rpcCall = function
|
|
1347
|
+
return o.prototype.rpcCall = function u(c, r, n, i, e) {
|
|
1341
1348
|
if (!i)
|
|
1342
1349
|
throw TypeError("request must be specified");
|
|
1343
1350
|
var t = this;
|
|
1344
1351
|
if (!e)
|
|
1345
|
-
return f.asPromise(
|
|
1352
|
+
return f.asPromise(u, t, c, r, n, i);
|
|
1346
1353
|
if (!t.rpcImpl) {
|
|
1347
1354
|
setTimeout(function() {
|
|
1348
1355
|
e(Error("already ended"));
|
|
@@ -1351,35 +1358,35 @@ function requireService() {
|
|
|
1351
1358
|
}
|
|
1352
1359
|
try {
|
|
1353
1360
|
return t.rpcImpl(
|
|
1354
|
-
|
|
1361
|
+
c,
|
|
1355
1362
|
r[t.requestDelimited ? "encodeDelimited" : "encode"](i).finish(),
|
|
1356
|
-
function(l,
|
|
1363
|
+
function(l, a) {
|
|
1357
1364
|
if (l)
|
|
1358
|
-
return t.emit("error", l,
|
|
1359
|
-
if (
|
|
1365
|
+
return t.emit("error", l, c), e(l);
|
|
1366
|
+
if (a === null) {
|
|
1360
1367
|
t.end(
|
|
1361
1368
|
/* endedByRPC */
|
|
1362
1369
|
!0
|
|
1363
1370
|
);
|
|
1364
1371
|
return;
|
|
1365
1372
|
}
|
|
1366
|
-
if (!(
|
|
1373
|
+
if (!(a instanceof n))
|
|
1367
1374
|
try {
|
|
1368
|
-
|
|
1375
|
+
a = n[t.responseDelimited ? "decodeDelimited" : "decode"](a);
|
|
1369
1376
|
} catch (d) {
|
|
1370
|
-
return t.emit("error", d,
|
|
1377
|
+
return t.emit("error", d, c), e(d);
|
|
1371
1378
|
}
|
|
1372
|
-
return t.emit("data",
|
|
1379
|
+
return t.emit("data", a, c), e(null, a);
|
|
1373
1380
|
}
|
|
1374
1381
|
);
|
|
1375
1382
|
} catch (s) {
|
|
1376
|
-
t.emit("error", s,
|
|
1383
|
+
t.emit("error", s, c), setTimeout(function() {
|
|
1377
1384
|
e(s);
|
|
1378
1385
|
}, 0);
|
|
1379
1386
|
return;
|
|
1380
1387
|
}
|
|
1381
|
-
}, o.prototype.end = function(
|
|
1382
|
-
return this.rpcImpl && (
|
|
1388
|
+
}, o.prototype.end = function(c) {
|
|
1389
|
+
return this.rpcImpl && (c || this.rpcImpl(null, null, null), this.rpcImpl = null, this.emit("end").off()), this;
|
|
1383
1390
|
}, service;
|
|
1384
1391
|
}
|
|
1385
1392
|
var hasRequiredRpc;
|
|
@@ -1397,11 +1404,11 @@ var hasRequiredIndexMinimal;
|
|
|
1397
1404
|
function requireIndexMinimal() {
|
|
1398
1405
|
return hasRequiredIndexMinimal || (hasRequiredIndexMinimal = 1, function(f) {
|
|
1399
1406
|
var o = f;
|
|
1400
|
-
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 =
|
|
1401
|
-
function
|
|
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 = u;
|
|
1408
|
+
function u() {
|
|
1402
1409
|
o.util._configure(), o.Writer._configure(o.BufferWriter), o.Reader._configure(o.BufferReader);
|
|
1403
1410
|
}
|
|
1404
|
-
|
|
1411
|
+
u();
|
|
1405
1412
|
}(indexMinimal)), indexMinimal;
|
|
1406
1413
|
}
|
|
1407
1414
|
var minimal, hasRequiredMinimal;
|
|
@@ -1414,10 +1421,10 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1414
1421
|
return f.quick = function() {
|
|
1415
1422
|
const o = {};
|
|
1416
1423
|
return o.voice = function() {
|
|
1417
|
-
const
|
|
1418
|
-
return
|
|
1419
|
-
const
|
|
1420
|
-
return
|
|
1424
|
+
const u = {};
|
|
1425
|
+
return u.proto = function() {
|
|
1426
|
+
const c = {};
|
|
1427
|
+
return c.SeiData = function() {
|
|
1421
1428
|
function r(n) {
|
|
1422
1429
|
if (n) for (let i = Object.keys(n), e = 0; e < i.length; ++e) n[i[e]] != null && (this[i[e]] = n[i[e]]);
|
|
1423
1430
|
}
|
|
@@ -1443,9 +1450,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1443
1450
|
i instanceof $Reader || (i = $Reader.create(i));
|
|
1444
1451
|
let s = e === void 0 ? i.len : i.pos + e, l = new $root.com.quick.voice.proto.SeiData();
|
|
1445
1452
|
for (; i.pos < s; ) {
|
|
1446
|
-
let
|
|
1447
|
-
if (
|
|
1448
|
-
switch (
|
|
1453
|
+
let a = i.uint32();
|
|
1454
|
+
if (a === t) break;
|
|
1455
|
+
switch (a >>> 3) {
|
|
1449
1456
|
case 1: {
|
|
1450
1457
|
l.event = i.int32();
|
|
1451
1458
|
break;
|
|
@@ -1463,7 +1470,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1463
1470
|
break;
|
|
1464
1471
|
}
|
|
1465
1472
|
default:
|
|
1466
|
-
i.skipType(
|
|
1473
|
+
i.skipType(a & 7);
|
|
1467
1474
|
break;
|
|
1468
1475
|
}
|
|
1469
1476
|
}
|
|
@@ -1510,10 +1517,10 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1510
1517
|
}, r.getTypeUrl = function(i) {
|
|
1511
1518
|
return i === void 0 && (i = "type.googleapis.com"), i + "/com.quick.voice.proto.SeiData";
|
|
1512
1519
|
}, r;
|
|
1513
|
-
}(),
|
|
1520
|
+
}(), c.EventType = function() {
|
|
1514
1521
|
const r = {}, n = Object.create(r);
|
|
1515
1522
|
return n[r[0] = "Layout"] = 0, n[r[1] = "Custom"] = 1, n;
|
|
1516
|
-
}(),
|
|
1523
|
+
}(), c.LayoutData = function() {
|
|
1517
1524
|
function r(i) {
|
|
1518
1525
|
if (this.userMap = {}, i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
|
|
1519
1526
|
}
|
|
@@ -1551,21 +1558,21 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1551
1558
|
return this.encode(e, t).ldelim();
|
|
1552
1559
|
}, r.decode = function(e, t, s) {
|
|
1553
1560
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
1554
|
-
let l = t === void 0 ? e.len : e.pos + t,
|
|
1561
|
+
let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.LayoutData(), d, y;
|
|
1555
1562
|
for (; e.pos < l; ) {
|
|
1556
1563
|
let p = e.uint32();
|
|
1557
1564
|
if (p === s) break;
|
|
1558
1565
|
switch (p >>> 3) {
|
|
1559
1566
|
case 1: {
|
|
1560
|
-
|
|
1567
|
+
a.roomId = e.string();
|
|
1561
1568
|
break;
|
|
1562
1569
|
}
|
|
1563
1570
|
case 2: {
|
|
1564
|
-
|
|
1571
|
+
a.type = e.int32();
|
|
1565
1572
|
break;
|
|
1566
1573
|
}
|
|
1567
1574
|
case 3: {
|
|
1568
|
-
|
|
1575
|
+
a.userMap === $util.emptyObject && (a.userMap = {});
|
|
1569
1576
|
let w = e.uint32() + e.pos;
|
|
1570
1577
|
for (d = "", y = null; e.pos < w; ) {
|
|
1571
1578
|
let b = e.uint32();
|
|
@@ -1581,11 +1588,11 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1581
1588
|
break;
|
|
1582
1589
|
}
|
|
1583
1590
|
}
|
|
1584
|
-
|
|
1591
|
+
a.userMap[d] = y;
|
|
1585
1592
|
break;
|
|
1586
1593
|
}
|
|
1587
1594
|
case 4: {
|
|
1588
|
-
|
|
1595
|
+
a.globalCustom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
|
|
1589
1596
|
break;
|
|
1590
1597
|
}
|
|
1591
1598
|
default:
|
|
@@ -1593,7 +1600,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1593
1600
|
break;
|
|
1594
1601
|
}
|
|
1595
1602
|
}
|
|
1596
|
-
return
|
|
1603
|
+
return a;
|
|
1597
1604
|
}, r.decodeDelimited = function(e) {
|
|
1598
1605
|
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
1599
1606
|
}, r.verify = function(e) {
|
|
@@ -1664,7 +1671,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1664
1671
|
let l;
|
|
1665
1672
|
if (e.userMap && (l = Object.keys(e.userMap)).length) {
|
|
1666
1673
|
s.userMap = {};
|
|
1667
|
-
for (let
|
|
1674
|
+
for (let a = 0; a < l.length; ++a) s.userMap[l[a]] = $root.com.quick.voice.proto.UserInfo.toObject(e.userMap[l[a]], t);
|
|
1668
1675
|
}
|
|
1669
1676
|
return e.globalCustom != null && e.hasOwnProperty("globalCustom") && (s.globalCustom = $root.com.quick.voice.proto.CustomInfo.toObject(e.globalCustom, t), t.oneofs && (s._globalCustom = "globalCustom")), s;
|
|
1670
1677
|
}, r.prototype.toJSON = function() {
|
|
@@ -1672,7 +1679,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1672
1679
|
}, r.getTypeUrl = function(e) {
|
|
1673
1680
|
return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.LayoutData";
|
|
1674
1681
|
}, r;
|
|
1675
|
-
}(),
|
|
1682
|
+
}(), c.UserInfo = function() {
|
|
1676
1683
|
function r(i) {
|
|
1677
1684
|
if (this.audios = [], this.videos = [], i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
|
|
1678
1685
|
}
|
|
@@ -1703,25 +1710,25 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1703
1710
|
return this.encode(e, t).ldelim();
|
|
1704
1711
|
}, r.decode = function(e, t, s) {
|
|
1705
1712
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
1706
|
-
let l = t === void 0 ? e.len : e.pos + t,
|
|
1713
|
+
let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.UserInfo();
|
|
1707
1714
|
for (; e.pos < l; ) {
|
|
1708
1715
|
let d = e.uint32();
|
|
1709
1716
|
if (d === s) break;
|
|
1710
1717
|
switch (d >>> 3) {
|
|
1711
1718
|
case 1: {
|
|
1712
|
-
|
|
1719
|
+
a.id = e.string();
|
|
1713
1720
|
break;
|
|
1714
1721
|
}
|
|
1715
1722
|
case 2: {
|
|
1716
|
-
|
|
1723
|
+
a.audios && a.audios.length || (a.audios = []), a.audios.push($root.com.quick.voice.proto.AudioInfo.decode(e, e.uint32()));
|
|
1717
1724
|
break;
|
|
1718
1725
|
}
|
|
1719
1726
|
case 3: {
|
|
1720
|
-
|
|
1727
|
+
a.videos && a.videos.length || (a.videos = []), a.videos.push($root.com.quick.voice.proto.VideoInfo.decode(e, e.uint32()));
|
|
1721
1728
|
break;
|
|
1722
1729
|
}
|
|
1723
1730
|
case 4: {
|
|
1724
|
-
|
|
1731
|
+
a.custom = $root.com.quick.voice.proto.CustomInfo.decode(e, e.uint32());
|
|
1725
1732
|
break;
|
|
1726
1733
|
}
|
|
1727
1734
|
default:
|
|
@@ -1729,7 +1736,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1729
1736
|
break;
|
|
1730
1737
|
}
|
|
1731
1738
|
}
|
|
1732
|
-
return
|
|
1739
|
+
return a;
|
|
1733
1740
|
}, r.decodeDelimited = function(e) {
|
|
1734
1741
|
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
1735
1742
|
}, r.verify = function(e) {
|
|
@@ -1795,7 +1802,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1795
1802
|
}, r.getTypeUrl = function(e) {
|
|
1796
1803
|
return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.UserInfo";
|
|
1797
1804
|
}, r;
|
|
1798
|
-
}(),
|
|
1805
|
+
}(), c.AudioInfo = function() {
|
|
1799
1806
|
function r(i) {
|
|
1800
1807
|
if (i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
|
|
1801
1808
|
}
|
|
@@ -1827,29 +1834,29 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1827
1834
|
return this.encode(e, t).ldelim();
|
|
1828
1835
|
}, r.decode = function(e, t, s) {
|
|
1829
1836
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
1830
|
-
let l = t === void 0 ? e.len : e.pos + t,
|
|
1837
|
+
let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.AudioInfo();
|
|
1831
1838
|
for (; e.pos < l; ) {
|
|
1832
1839
|
let d = e.uint32();
|
|
1833
1840
|
if (d === s) break;
|
|
1834
1841
|
switch (d >>> 3) {
|
|
1835
1842
|
case 1: {
|
|
1836
|
-
|
|
1843
|
+
a.type = e.int32();
|
|
1837
1844
|
break;
|
|
1838
1845
|
}
|
|
1839
1846
|
case 2: {
|
|
1840
|
-
|
|
1847
|
+
a.isEnable = e.bool();
|
|
1841
1848
|
break;
|
|
1842
1849
|
}
|
|
1843
1850
|
case 3: {
|
|
1844
|
-
|
|
1851
|
+
a.isMute = e.bool();
|
|
1845
1852
|
break;
|
|
1846
1853
|
}
|
|
1847
1854
|
case 4: {
|
|
1848
|
-
|
|
1855
|
+
a.volume = e.double();
|
|
1849
1856
|
break;
|
|
1850
1857
|
}
|
|
1851
1858
|
case 5: {
|
|
1852
|
-
|
|
1859
|
+
a.updateTime = e.int64();
|
|
1853
1860
|
break;
|
|
1854
1861
|
}
|
|
1855
1862
|
default:
|
|
@@ -1857,7 +1864,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1857
1864
|
break;
|
|
1858
1865
|
}
|
|
1859
1866
|
}
|
|
1860
|
-
return
|
|
1867
|
+
return a;
|
|
1861
1868
|
}, r.decodeDelimited = function(e) {
|
|
1862
1869
|
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
1863
1870
|
}, r.verify = function(e) {
|
|
@@ -1900,7 +1907,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1900
1907
|
}, r.getTypeUrl = function(e) {
|
|
1901
1908
|
return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.AudioInfo";
|
|
1902
1909
|
}, r;
|
|
1903
|
-
}(),
|
|
1910
|
+
}(), c.VideoInfo = function() {
|
|
1904
1911
|
function r(i) {
|
|
1905
1912
|
if (i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
|
|
1906
1913
|
}
|
|
@@ -1941,41 +1948,41 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1941
1948
|
return this.encode(e, t).ldelim();
|
|
1942
1949
|
}, r.decode = function(e, t, s) {
|
|
1943
1950
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
1944
|
-
let l = t === void 0 ? e.len : e.pos + t,
|
|
1951
|
+
let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.VideoInfo();
|
|
1945
1952
|
for (; e.pos < l; ) {
|
|
1946
1953
|
let d = e.uint32();
|
|
1947
1954
|
if (d === s) break;
|
|
1948
1955
|
switch (d >>> 3) {
|
|
1949
1956
|
case 1: {
|
|
1950
|
-
|
|
1957
|
+
a.type = e.int32();
|
|
1951
1958
|
break;
|
|
1952
1959
|
}
|
|
1953
1960
|
case 2: {
|
|
1954
|
-
|
|
1961
|
+
a.isEnable = e.bool();
|
|
1955
1962
|
break;
|
|
1956
1963
|
}
|
|
1957
1964
|
case 3: {
|
|
1958
|
-
|
|
1965
|
+
a.isMute = e.bool();
|
|
1959
1966
|
break;
|
|
1960
1967
|
}
|
|
1961
1968
|
case 4: {
|
|
1962
|
-
|
|
1969
|
+
a.width = e.int32();
|
|
1963
1970
|
break;
|
|
1964
1971
|
}
|
|
1965
1972
|
case 5: {
|
|
1966
|
-
|
|
1973
|
+
a.height = e.int32();
|
|
1967
1974
|
break;
|
|
1968
1975
|
}
|
|
1969
1976
|
case 6: {
|
|
1970
|
-
|
|
1977
|
+
a.x = e.int32();
|
|
1971
1978
|
break;
|
|
1972
1979
|
}
|
|
1973
1980
|
case 7: {
|
|
1974
|
-
|
|
1981
|
+
a.y = e.int32();
|
|
1975
1982
|
break;
|
|
1976
1983
|
}
|
|
1977
1984
|
case 8: {
|
|
1978
|
-
|
|
1985
|
+
a.updateTime = e.int64();
|
|
1979
1986
|
break;
|
|
1980
1987
|
}
|
|
1981
1988
|
default:
|
|
@@ -1983,7 +1990,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1983
1990
|
break;
|
|
1984
1991
|
}
|
|
1985
1992
|
}
|
|
1986
|
-
return
|
|
1993
|
+
return a;
|
|
1987
1994
|
}, r.decodeDelimited = function(e) {
|
|
1988
1995
|
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
1989
1996
|
}, r.verify = function(e) {
|
|
@@ -2026,7 +2033,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2026
2033
|
}, r.getTypeUrl = function(e) {
|
|
2027
2034
|
return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.VideoInfo";
|
|
2028
2035
|
}, r;
|
|
2029
|
-
}(),
|
|
2036
|
+
}(), c.CustomInfo = function() {
|
|
2030
2037
|
function r(i) {
|
|
2031
2038
|
if (this.customKeyMap = {}, i) for (let e = Object.keys(i), t = 0; t < e.length; ++t) i[e[t]] != null && (this[e[t]] = i[e[t]]);
|
|
2032
2039
|
}
|
|
@@ -2059,17 +2066,17 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2059
2066
|
return this.encode(e, t).ldelim();
|
|
2060
2067
|
}, r.decode = function(e, t, s) {
|
|
2061
2068
|
e instanceof $Reader || (e = $Reader.create(e));
|
|
2062
|
-
let l = t === void 0 ? e.len : e.pos + t,
|
|
2069
|
+
let l = t === void 0 ? e.len : e.pos + t, a = new $root.com.quick.voice.proto.CustomInfo(), d, y;
|
|
2063
2070
|
for (; e.pos < l; ) {
|
|
2064
2071
|
let p = e.uint32();
|
|
2065
2072
|
if (p === s) break;
|
|
2066
2073
|
switch (p >>> 3) {
|
|
2067
2074
|
case 1: {
|
|
2068
|
-
|
|
2075
|
+
a.roomId = e.string();
|
|
2069
2076
|
break;
|
|
2070
2077
|
}
|
|
2071
2078
|
case 2: {
|
|
2072
|
-
|
|
2079
|
+
a.customKeyMap === $util.emptyObject && (a.customKeyMap = {});
|
|
2073
2080
|
let w = e.uint32() + e.pos;
|
|
2074
2081
|
for (d = "", y = ""; e.pos < w; ) {
|
|
2075
2082
|
let b = e.uint32();
|
|
@@ -2085,11 +2092,11 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2085
2092
|
break;
|
|
2086
2093
|
}
|
|
2087
2094
|
}
|
|
2088
|
-
|
|
2095
|
+
a.customKeyMap[d] = y;
|
|
2089
2096
|
break;
|
|
2090
2097
|
}
|
|
2091
2098
|
case 3: {
|
|
2092
|
-
|
|
2099
|
+
a.updateTime = e.int64();
|
|
2093
2100
|
break;
|
|
2094
2101
|
}
|
|
2095
2102
|
default:
|
|
@@ -2097,7 +2104,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2097
2104
|
break;
|
|
2098
2105
|
}
|
|
2099
2106
|
}
|
|
2100
|
-
return
|
|
2107
|
+
return a;
|
|
2101
2108
|
}, r.decodeDelimited = function(e) {
|
|
2102
2109
|
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
2103
2110
|
}, r.verify = function(e) {
|
|
@@ -2125,7 +2132,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2125
2132
|
let l;
|
|
2126
2133
|
if (e.customKeyMap && (l = Object.keys(e.customKeyMap)).length) {
|
|
2127
2134
|
s.customKeyMap = {};
|
|
2128
|
-
for (let
|
|
2135
|
+
for (let a = 0; a < l.length; ++a) s.customKeyMap[l[a]] = e.customKeyMap[l[a]];
|
|
2129
2136
|
}
|
|
2130
2137
|
return e.updateTime != null && e.hasOwnProperty("updateTime") && (typeof e.updateTime == "number" ? s.updateTime = t.longs === String ? String(e.updateTime) : e.updateTime : s.updateTime = t.longs === String ? $util.Long.prototype.toString.call(e.updateTime) : t.longs === Number ? new $util.LongBits(e.updateTime.low >>> 0, e.updateTime.high >>> 0).toNumber() : e.updateTime, t.oneofs && (s._updateTime = "updateTime")), s;
|
|
2131
2138
|
}, r.prototype.toJSON = function() {
|
|
@@ -2133,17 +2140,17 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2133
2140
|
}, r.getTypeUrl = function(e) {
|
|
2134
2141
|
return e === void 0 && (e = "type.googleapis.com"), e + "/com.quick.voice.proto.CustomInfo";
|
|
2135
2142
|
}, r;
|
|
2136
|
-
}(),
|
|
2143
|
+
}(), c.LayoutType = function() {
|
|
2137
2144
|
const r = {}, n = Object.create(r);
|
|
2138
2145
|
return n[r[0] = "AudioAndVideo"] = 0, n[r[1] = "OnlyAudio"] = 1, n[r[2] = "OnlyVideo"] = 2, n;
|
|
2139
|
-
}(),
|
|
2146
|
+
}(), c.AudioType = function() {
|
|
2140
2147
|
const r = {}, n = Object.create(r);
|
|
2141
2148
|
return n[r[0] = "Microphone"] = 0, n[r[1] = "SystemVoice"] = 1, n;
|
|
2142
|
-
}(),
|
|
2149
|
+
}(), c.VideoType = function() {
|
|
2143
2150
|
const r = {}, n = Object.create(r);
|
|
2144
2151
|
return n[r[0] = "Camera"] = 0, n[r[1] = "Screen"] = 1, n;
|
|
2145
|
-
}(),
|
|
2146
|
-
}(),
|
|
2152
|
+
}(), c;
|
|
2153
|
+
}(), u;
|
|
2147
2154
|
}(), o;
|
|
2148
2155
|
}(), f;
|
|
2149
2156
|
})(), createAudioInfo = () => ({
|
|
@@ -2180,12 +2187,12 @@ class RoomUser {
|
|
|
2180
2187
|
});
|
|
2181
2188
|
v(this, "init", (o) => {
|
|
2182
2189
|
var e, t, s, l;
|
|
2183
|
-
const { id:
|
|
2184
|
-
this.userId =
|
|
2190
|
+
const { id: u, audios: c = [], videos: r = [] } = o;
|
|
2191
|
+
this.userId = u;
|
|
2185
2192
|
const n = this.getUpdateTimeKey();
|
|
2186
2193
|
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);
|
|
2187
|
-
for (const
|
|
2188
|
-
const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } =
|
|
2194
|
+
for (const a of c) {
|
|
2195
|
+
const { type: d = 0, isEnable: y = !1, isMute: p = !1, updateTime: w, volume: b = 0 } = a;
|
|
2189
2196
|
switch (d) {
|
|
2190
2197
|
case 0:
|
|
2191
2198
|
{
|
|
@@ -2201,8 +2208,8 @@ class RoomUser {
|
|
|
2201
2208
|
break;
|
|
2202
2209
|
}
|
|
2203
2210
|
}
|
|
2204
|
-
for (const
|
|
2205
|
-
const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height: m, x: g, y: k } =
|
|
2211
|
+
for (const a of r) {
|
|
2212
|
+
const { type: d = 0, isEnable: y, isMute: p, updateTime: w, width: b, height: m, x: g, y: k } = a;
|
|
2206
2213
|
switch (d) {
|
|
2207
2214
|
case 0:
|
|
2208
2215
|
{
|
|
@@ -2223,26 +2230,26 @@ class RoomUser {
|
|
|
2223
2230
|
n !== i && (this.updateTime = (/* @__PURE__ */ new Date()).getTime());
|
|
2224
2231
|
});
|
|
2225
2232
|
v(this, "destroy", () => {
|
|
2226
|
-
var o,
|
|
2227
|
-
(o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (
|
|
2233
|
+
var o, u;
|
|
2234
|
+
(o = this.mc_video) != null && o.destroy && this.mc_video.destroy(), (u = this.ss_video) != null && u.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;
|
|
2228
2235
|
});
|
|
2229
2236
|
}
|
|
2230
2237
|
}
|
|
2231
2238
|
const parseSEI = (f) => {
|
|
2232
|
-
let o = 0,
|
|
2239
|
+
let o = 0, u = 0;
|
|
2233
2240
|
for (; ; ) {
|
|
2234
2241
|
const r = f[o];
|
|
2235
|
-
if (
|
|
2242
|
+
if (u = u + r, o = o + 1, r !== 255) break;
|
|
2236
2243
|
}
|
|
2237
|
-
let
|
|
2244
|
+
let c = 0;
|
|
2238
2245
|
for (; ; ) {
|
|
2239
2246
|
const r = f[o];
|
|
2240
|
-
if (
|
|
2247
|
+
if (c = c + r, o = o + 1, r !== 255) break;
|
|
2241
2248
|
}
|
|
2242
|
-
if (
|
|
2249
|
+
if (u === 5) {
|
|
2243
2250
|
const r = f.slice(o, o + 16), i = Array.from(r, (p) => p.toString(16).padStart(2, "0")).join("");
|
|
2244
2251
|
o = o + 16;
|
|
2245
|
-
const e =
|
|
2252
|
+
const e = c - 16, t = f.slice(o, o + e), s = com.quick.voice.proto.SeiData.decode(t), { event: l = 0 } = s, a = s.data;
|
|
2246
2253
|
let d;
|
|
2247
2254
|
switch (l) {
|
|
2248
2255
|
case 0:
|
|
@@ -2252,7 +2259,7 @@ const parseSEI = (f) => {
|
|
|
2252
2259
|
d = com.quick.voice.proto.CustomInfo.decode(s.data);
|
|
2253
2260
|
break;
|
|
2254
2261
|
}
|
|
2255
|
-
return { uuid: i, ...s, event: l, data_remote:
|
|
2262
|
+
return { uuid: i, ...s, event: l, data_remote: a, data: d };
|
|
2256
2263
|
}
|
|
2257
2264
|
};
|
|
2258
2265
|
class QuickVoPlayer {
|
|
@@ -2274,11 +2281,9 @@ class QuickVoPlayer {
|
|
|
2274
2281
|
v(this, "init", () => {
|
|
2275
2282
|
this.prPlayer.init();
|
|
2276
2283
|
});
|
|
2277
|
-
v(this, "start", (o) =>
|
|
2278
|
-
this.prPlayer.start(o);
|
|
2279
|
-
});
|
|
2284
|
+
v(this, "start", async (o) => (this.stop(), this.prPlayer.start(o)));
|
|
2280
2285
|
v(this, "stop", () => {
|
|
2281
|
-
this.prPlayer.stop();
|
|
2286
|
+
this.prPlayer.stop(), this.usersMap = /* @__PURE__ */ new Map(), this.room.roomId = "", this.room.author = "", this.room.updateTime = "", this.room.version = "";
|
|
2282
2287
|
});
|
|
2283
2288
|
v(this, "setMute", (o) => {
|
|
2284
2289
|
this.prPlayer.setMute(o);
|
|
@@ -2286,26 +2291,35 @@ class QuickVoPlayer {
|
|
|
2286
2291
|
v(this, "getStream", () => this.prPlayer.getStream());
|
|
2287
2292
|
v(this, "getAllUseUpdateKey", () => {
|
|
2288
2293
|
const o = [...this.usersMap.values()];
|
|
2289
|
-
return Array.from(o, (
|
|
2294
|
+
return Array.from(o, (c) => c.updateTime).join("_");
|
|
2290
2295
|
});
|
|
2291
|
-
v(this, "checkAndCreateUser", (o,
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
this.usersMap.
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
if (u.init(a), u.mc_video) {
|
|
2299
|
-
const { sx: r, sy: n, sw: i, sh: e } = u.mc_video, t = `${u.userId}_mc_video`, { stream: s, destroy: l } = this.prPlayer.cut.create(t, { sx: r, sy: n, sw: i, sh: e });
|
|
2300
|
-
u.mc_video.stream = s, u.mc_video.destroy = () => {
|
|
2301
|
-
l(), this.prPlayer.cut.remove(t), this.usersMap.delete(u.userId);
|
|
2302
|
-
};
|
|
2296
|
+
v(this, "checkAndCreateUser", (o, u) => {
|
|
2297
|
+
var c, r;
|
|
2298
|
+
if (this.usersMap.has(o)) {
|
|
2299
|
+
const n = this.usersMap.get(o);
|
|
2300
|
+
if (n == null || n.init(u), n != null && n.mc_video) {
|
|
2301
|
+
const { sx: i, sy: e, sw: t, sh: s } = n.mc_video;
|
|
2302
|
+
(c = n == null ? void 0 : n.mc_video.worker) == null || c.setCut({ sx: i, sy: e, sw: t, sh: s });
|
|
2303
2303
|
}
|
|
2304
|
-
if (
|
|
2305
|
-
const { sx:
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2304
|
+
if (n != null && n.ss_video) {
|
|
2305
|
+
const { sx: i, sy: e, sw: t, sh: s } = n.ss_video;
|
|
2306
|
+
(r = n == null ? void 0 : n.ss_video.worker) == null || r.setCut({ sx: i, sy: e, sw: t, sh: s });
|
|
2307
|
+
}
|
|
2308
|
+
} else {
|
|
2309
|
+
const n = new RoomUser();
|
|
2310
|
+
if (this.usersMap.set(o, n), n.init(u), n) {
|
|
2311
|
+
if (n.mc_video) {
|
|
2312
|
+
const { sx: i, sy: e, sw: t, sh: s } = n.mc_video, l = `${n.userId}_mc_video`, { worker: a, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: e, sw: t, sh: s });
|
|
2313
|
+
n.mc_video.worker = a, this.displayMode === "original" && a.setPause(!0), n.mc_video.stream = d, n.mc_video.destroy = () => {
|
|
2314
|
+
y(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
if (n.ss_video) {
|
|
2318
|
+
const { sx: i, sy: e, sw: t, sh: s } = n.ss_video, l = `${n.userId}_ss_video`, { worker: a, stream: d, destroy: y } = this.prPlayer.cut.create(l, { sx: i, sy: e, sw: t, sh: s });
|
|
2319
|
+
n.ss_video.worker = a, this.displayMode === "original" && a.setPause(!0), n.ss_video.stream = d, n.ss_video.destroy = () => {
|
|
2320
|
+
y(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
2309
2323
|
}
|
|
2310
2324
|
}
|
|
2311
2325
|
});
|
|
@@ -2314,10 +2328,10 @@ class QuickVoPlayer {
|
|
|
2314
2328
|
*/
|
|
2315
2329
|
v(this, "onSEI", (o) => {
|
|
2316
2330
|
try {
|
|
2317
|
-
const
|
|
2318
|
-
if (!
|
|
2319
|
-
const { event:
|
|
2320
|
-
switch (
|
|
2331
|
+
const u = parseSEI(o);
|
|
2332
|
+
if (!u) return;
|
|
2333
|
+
const { event: c, data: r } = u;
|
|
2334
|
+
switch (c) {
|
|
2321
2335
|
case 0:
|
|
2322
2336
|
{
|
|
2323
2337
|
const { roomId: n, userMap: i } = r;
|
|
@@ -2325,17 +2339,17 @@ class QuickVoPlayer {
|
|
|
2325
2339
|
const e = this.getAllUseUpdateKey(), t = Object.keys(i);
|
|
2326
2340
|
{
|
|
2327
2341
|
const l = [...this.usersMap.values()];
|
|
2328
|
-
for (const
|
|
2329
|
-
t.includes(
|
|
2342
|
+
for (const a of l)
|
|
2343
|
+
t.includes(a.userId) || a == null || a.destroy();
|
|
2330
2344
|
}
|
|
2331
2345
|
for (const l of t) {
|
|
2332
|
-
const
|
|
2333
|
-
this.checkAndCreateUser(l,
|
|
2346
|
+
const a = i[l];
|
|
2347
|
+
this.checkAndCreateUser(l, a);
|
|
2334
2348
|
}
|
|
2335
2349
|
const s = this.getAllUseUpdateKey();
|
|
2336
2350
|
if (e !== s && this.on.users) {
|
|
2337
|
-
const l = [...this.usersMap.values()],
|
|
2338
|
-
this.on.users(
|
|
2351
|
+
const l = [...this.usersMap.values()], a = Array.from(l, ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: m }) => ({ userId: d, mc_audio: y, mc_video: p, ss_audio: w, ss_video: b, updateTime: m }));
|
|
2352
|
+
this.on.users(a);
|
|
2339
2353
|
}
|
|
2340
2354
|
}
|
|
2341
2355
|
break;
|
|
@@ -2346,8 +2360,29 @@ class QuickVoPlayer {
|
|
|
2346
2360
|
}
|
|
2347
2361
|
break;
|
|
2348
2362
|
}
|
|
2349
|
-
} catch (
|
|
2350
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error",
|
|
2363
|
+
} catch (u) {
|
|
2364
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->onSEI: error", u);
|
|
2365
|
+
}
|
|
2366
|
+
});
|
|
2367
|
+
v(this, "setDisplayMode", (o) => {
|
|
2368
|
+
var u, c, r, n, i, e, t, s;
|
|
2369
|
+
switch (this.displayMode = o, o) {
|
|
2370
|
+
case "original":
|
|
2371
|
+
{
|
|
2372
|
+
this.prPlayer.setPause(!1);
|
|
2373
|
+
const l = [...this.usersMap.values()];
|
|
2374
|
+
for (const a of l)
|
|
2375
|
+
(c = (u = a.mc_video) == null ? void 0 : u.worker) == null || c.setPause(!0), (n = (r = a.ss_video) == null ? void 0 : r.worker) == null || n.setPause(!0);
|
|
2376
|
+
}
|
|
2377
|
+
break;
|
|
2378
|
+
case "cut":
|
|
2379
|
+
{
|
|
2380
|
+
this.prPlayer.setPause(!0);
|
|
2381
|
+
const l = [...this.usersMap.values()];
|
|
2382
|
+
for (const a of l)
|
|
2383
|
+
(e = (i = a.mc_video) == null ? void 0 : i.worker) == null || e.setPause(!1), (s = (t = a.ss_video) == null ? void 0 : t.worker) == null || s.setPause(!1);
|
|
2384
|
+
}
|
|
2385
|
+
break;
|
|
2351
2386
|
}
|
|
2352
2387
|
});
|
|
2353
2388
|
this.prPlayer.on.demuxer.sei = this.onSEI;
|