quickvo-player 0.1.2 → 0.1.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/index.js +411 -406
- package/dist/index.umd.cjs +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ class N {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
const S = `(function(){"use strict";class n{audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;baseTime=0;pendingChunks=[];isProcessing=!1;decodeTimer=0;frameTrack=!1;minFrameTrackCacheNum=20;decodingSpeed=40;decodingSpeedRatio=1;maxDecodingSpeedRatio=2;nextRenderTime;on={audio:{},video:{}};constructor(){this.baseTime=new Date().getTime()-performance.now(),this.initDecodeInterval()}init=e=>{const{decodingSpeed:i,frameTrack:d,minFrameTrackCacheNum:o}=e;i!==void 0&&(this.decodingSpeed=i),d!==void 0&&(this.frameTrack=d),o!==void 0&&(this.minFrameTrackCacheNum=o)};setFrameTrack=e=>{this.frameTrack=e,this.frameTrack===!1&&(this.decodingSpeedRatio=1)};initDecodeInterval=()=>{let e=this.decodingSpeed/this.decodingSpeedRatio;const i=this.baseTime+performance.now();if(this.nextRenderTime){const d=i-this.nextRenderTime;e-=d}this.nextRenderTime=i+e,this.decodeTimer=setTimeout(()=>{this.decode(),this.initDecodeInterval()},e)};decode=()=>{if(this.isProcessing!==!0){for(this.isProcessing=!0;;){const e=this.pendingChunks.shift();if(this.frameTrack){const o=this.pendingChunks.length;if(o>=this.minFrameTrackCacheNum){const r=Math.min(1+(o-this.minFrameTrackCacheNum)/100,this.maxDecodingSpeedRatio);this.decodingSpeedRatio=Number(r.toFixed(1))}else this.decodingSpeedRatio=1}if(!e)break;const{type:i,init:d}=e;switch(i){case"audio":this.decodeAudio(d);break;case"video":this.decodeVideo(d);break}if(i==="video")break}this.isProcessing=!1}};decodeAudio=e=>{if(!this.audioDecoder)return;const i=new EncodedAudioChunk(e);this.audioDecoder.decode(i)};decodeVideo=e=>{if(this.videoDecoder&&(e.type==="key"&&(this.hasKeyFrame=!0),this.hasKeyFrame)){const i=new EncodedVideoChunk(e);this.videoDecoder.decode(i)}};destroy=()=>{this.audio.destroy(),this.video.destroy(),clearInterval(this.decodeTimer)};audio={init:e=>{this.audio.destroy(),this.audioDecoderConfig={...e},this.audioDecoder=new AudioDecoder({output:i=>{this.on.audio.decode&&this.on.audio.decode(i)},error:i=>{this.on.audio.error&&this.on.audio.error(i)}}),this.audioDecoder.configure(this.audioDecoderConfig)},push:e=>{this.pendingChunks.push({type:"audio",init:e})},flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={init:e=>{this.video.destroy(),this.videoDecoderConfig={...e},this.videoDecoder=new VideoDecoder({output:async i=>{const d=i.timestamp+this.baseTime*1e3,o=await createImageBitmap(i);i.close(),o.width>0&&o.height>0?this.on.video.decode&&this.on.video.decode({timestamp:d,bitmap:o}):o.close()},error:i=>{this.on.video.error&&this.on.video.error(i)}}),this.videoDecoder.configure(this.videoDecoderConfig)},push:e=>{this.pendingChunks.push({type:"video",init:e})},flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}}const s=new n;s.on.audio.decode=t=>postMessage({type:"audio",action:"onDecode",data:t}),s.on.audio.error=t=>postMessage({type:"audio",action:"onError",data:t}),s.on.video.decode=t=>postMessage({type:"video",action:"onDecode",data:t}),s.on.video.error=t=>postMessage({type:"video",action:"onError",data:t}),onmessage=t=>{const{type:e,action:i,data:d}=t.data;if(e){const o=s[e][i];o&&o(d)}else{const o=s[i];o&&o(d)}}})();
|
|
56
|
+
const S = `(function(){"use strict";class n{audioDecoderConfig;audioDecoder;videoDecoderConfig;videoDecoder;hasKeyFrame=!1;baseTime=0;pendingChunks=[];isProcessing=!1;decodeTimer=0;frameTrack=!1;minFrameTrackCacheNum=20;decodingSpeed=40;decodingSpeedRatio=1;maxDecodingSpeedRatio=2;nextRenderTime;on={audio:{},video:{}};constructor(){this.baseTime=new Date().getTime()-performance.now(),this.initDecodeInterval()}init=e=>{const{decodingSpeed:i,frameTrack:d,minFrameTrackCacheNum:o}=e;i!==void 0&&(this.decodingSpeed=i),d!==void 0&&(this.frameTrack=d),o!==void 0&&(this.minFrameTrackCacheNum=o)};setFrameTrack=e=>{this.frameTrack=e,this.frameTrack===!1&&(this.decodingSpeedRatio=1)};initDecodeInterval=()=>{let e=this.decodingSpeed/this.decodingSpeedRatio;const i=this.baseTime+performance.now();if(this.nextRenderTime){const d=i-this.nextRenderTime;e-=d}this.nextRenderTime=i+e,this.decodeTimer=setTimeout(()=>{this.decode(),this.initDecodeInterval()},e)};decode=()=>{if(this.isProcessing!==!0){for(this.isProcessing=!0;;){const e=this.pendingChunks.shift();if(this.frameTrack){const o=this.pendingChunks.length;if(o>=this.minFrameTrackCacheNum){const r=Math.min(1+(o-this.minFrameTrackCacheNum)/100,this.maxDecodingSpeedRatio);this.decodingSpeedRatio=Number(r.toFixed(1))}else this.decodingSpeedRatio=1}if(!e)break;const{type:i,init:d}=e;switch(i){case"audio":this.decodeAudio(d);break;case"video":this.decodeVideo(d);break}if(i==="video")break}this.isProcessing=!1}};decodeAudio=e=>{if(!this.audioDecoder)return;const i=new EncodedAudioChunk(e);this.audioDecoder.decode(i)};decodeVideo=e=>{if(this.videoDecoder&&(e.type==="key"&&(this.hasKeyFrame=!0),this.hasKeyFrame)){const i=new EncodedVideoChunk(e);this.videoDecoder.decode(i)}};destroy=()=>{this.audio.destroy(),this.video.destroy(),clearInterval(this.decodeTimer)};audio={init:e=>{this.audio.destroy(),this.audioDecoderConfig={...e},this.audioDecoder=new AudioDecoder({output:i=>{const d=this.decodingSpeedRatio;this.on.audio.decode&&this.on.audio.decode({audioData:i,playbackRate:d})},error:i=>{this.on.audio.error&&this.on.audio.error(i)}}),this.audioDecoder.configure(this.audioDecoderConfig)},push:e=>{this.pendingChunks.push({type:"audio",init:e})},flush:()=>{this.audioDecoder?.flush()},destroy:()=>{this.audioDecoderConfig=void 0,this.audioDecoder?.close(),this.audioDecoder=void 0}};video={init:e=>{this.video.destroy(),this.videoDecoderConfig={...e},this.videoDecoder=new VideoDecoder({output:async i=>{const d=i.timestamp+this.baseTime*1e3,o=await createImageBitmap(i);i.close(),o.width>0&&o.height>0?this.on.video.decode&&this.on.video.decode({timestamp:d,bitmap:o}):o.close()},error:i=>{this.on.video.error&&this.on.video.error(i)}}),this.videoDecoder.configure(this.videoDecoderConfig)},push:e=>{this.pendingChunks.push({type:"video",init:e})},flush:()=>{this.videoDecoder?.flush()},destroy:()=>{this.videoDecoderConfig=void 0,this.videoDecoder?.close(),this.videoDecoder=void 0,this.hasKeyFrame=!1}}}const s=new n;s.on.audio.decode=t=>postMessage({type:"audio",action:"onDecode",data:t}),s.on.audio.error=t=>postMessage({type:"audio",action:"onError",data:t}),s.on.video.decode=t=>postMessage({type:"video",action:"onDecode",data:t}),s.on.video.error=t=>postMessage({type:"video",action:"onError",data:t}),onmessage=t=>{const{type:e,action:i,data:d}=t.data;if(e){const o=s[e][i];o&&o(d)}else{const o=s[i];o&&o(d)}}})();
|
|
57
57
|
`, v = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", S], { type: "text/javascript;charset=utf-8" });
|
|
58
58
|
function F(h) {
|
|
59
59
|
let o;
|
|
@@ -100,13 +100,13 @@ class B {
|
|
|
100
100
|
this.worker.postMessage({ action: "destroy" }), this.worker.terminate();
|
|
101
101
|
});
|
|
102
102
|
this.worker.onmessage = (o) => {
|
|
103
|
-
const { type: a, action: u, data:
|
|
103
|
+
const { type: a, action: u, data: r } = o.data;
|
|
104
104
|
switch (a) {
|
|
105
105
|
case "audio":
|
|
106
|
-
u === "onDecode" && this.on.audio.decode && this.on.audio.decode(
|
|
106
|
+
u === "onDecode" && this.on.audio.decode && this.on.audio.decode(r), u === "onError" && this.on.audio.error && this.on.audio.error(r);
|
|
107
107
|
break;
|
|
108
108
|
case "video":
|
|
109
|
-
u === "onDecode" && this.on.video.decode && this.on.video.decode(
|
|
109
|
+
u === "onDecode" && this.on.video.decode && this.on.video.decode(r), u === "onError" && this.on.video.error && this.on.video.error(r);
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
};
|
|
@@ -118,8 +118,8 @@ class O {
|
|
|
118
118
|
y(this, "inputStream", new MediaStream()), y(this, "outputStream", new MediaStream()), y(this, "inputGain", 1), y(this, "enhanceGain", 1), y(this, "bgsGain", 1), y(this, "bgmGain", 1), y(this, "outputGain", 1), y(this, "mixAudioMap", /* @__PURE__ */ new Map()), y(this, "audioContext", new AudioContext()), y(this, "sourceNode"), y(this, "inputGainNode"), y(this, "enhanceGainNode"), y(this, "bgsGainNode"), y(this, "bgmGainNode"), y(this, "analyserNode"), y(this, "analyserArrayData"), y(this, "outputGainNode"), y(this, "destinationNode"), y(this, "filterStream", (u) => u), y(this, "stop", () => {
|
|
119
119
|
{
|
|
120
120
|
const u = this.inputStream.getTracks();
|
|
121
|
-
for (const
|
|
122
|
-
|
|
121
|
+
for (const r of u)
|
|
122
|
+
r.stop(), this.inputStream.removeTrack(r);
|
|
123
123
|
}
|
|
124
124
|
}), y(this, "getStream", () => this.filterStream(this.outputStream)), y(this, "setMute", (u = !0) => {
|
|
125
125
|
u ? this.analyserNode.disconnect(this.outputGainNode) : this.analyserNode.connect(this.outputGainNode);
|
|
@@ -134,47 +134,47 @@ class O {
|
|
|
134
134
|
}), y(this, "setOutputGain", (u) => {
|
|
135
135
|
this.outputGain = u, this.outputGainNode.gain.setValueAtTime(this.outputGain, this.audioContext.currentTime);
|
|
136
136
|
}), y(this, "getVolume", () => {
|
|
137
|
-
const { analyserNode: u, analyserArrayData:
|
|
138
|
-
u.getByteFrequencyData(
|
|
139
|
-
let
|
|
140
|
-
for (let i = 0; i <
|
|
141
|
-
|
|
142
|
-
return Math.ceil(
|
|
143
|
-
}), y(this, "mixAudio", (u,
|
|
137
|
+
const { analyserNode: u, analyserArrayData: r } = this;
|
|
138
|
+
u.getByteFrequencyData(r);
|
|
139
|
+
let n = 0;
|
|
140
|
+
for (let i = 0; i < r.length; i++)
|
|
141
|
+
n += r[i];
|
|
142
|
+
return Math.ceil(n / r.length);
|
|
143
|
+
}), y(this, "mixAudio", (u, r = "bgm") => new Promise(async (n, i) => {
|
|
144
144
|
try {
|
|
145
145
|
{
|
|
146
|
-
const s = this.mixAudioMap.get(
|
|
146
|
+
const s = this.mixAudioMap.get(r);
|
|
147
147
|
s && s.stop();
|
|
148
148
|
}
|
|
149
|
-
const t =
|
|
150
|
-
this.mixAudioMap.set(
|
|
151
|
-
e.disconnect(t), this.mixAudioMap.delete(
|
|
149
|
+
const t = r === "bgs" ? this.bgsGainNode : this.bgmGainNode, e = this.audioContext.createBufferSource();
|
|
150
|
+
this.mixAudioMap.set(r, e), e.buffer = u, e.connect(t), e.onended = () => {
|
|
151
|
+
e.disconnect(t), this.mixAudioMap.delete(r), n(!0);
|
|
152
152
|
}, e.start(0);
|
|
153
153
|
} catch (t) {
|
|
154
154
|
i(t);
|
|
155
155
|
}
|
|
156
156
|
})), y(this, "mixAudioStop", (u) => {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
}), y(this, "changeMix", (u,
|
|
160
|
-
const
|
|
161
|
-
|
|
157
|
+
const r = this.mixAudioMap.get(u);
|
|
158
|
+
r == null || r.stop();
|
|
159
|
+
}), y(this, "changeMix", (u, r) => {
|
|
160
|
+
const n = u === "bgs" ? this.bgsGainNode : this.bgmGainNode;
|
|
161
|
+
r ? n.connect(this.destinationNode) : n.disconnect(this.destinationNode);
|
|
162
162
|
}), 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;
|
|
163
163
|
{
|
|
164
|
-
const { sourceNode: u, inputGainNode:
|
|
165
|
-
u.connect(
|
|
164
|
+
const { sourceNode: u, inputGainNode: r, enhanceGainNode: n, bgsGainNode: i, bgmGainNode: t, analyserNode: e, outputGainNode: s, destinationNode: l } = this;
|
|
165
|
+
u.connect(r), r.connect(n), n.connect(e), i.connect(e), t.connect(e), n.connect(l), i.connect(l), t.connect(l), e.connect(s), s.connect(this.audioContext.destination);
|
|
166
166
|
}
|
|
167
167
|
this.setMute(!0), this.audioContext.resume();
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
const V = async (h, o) => {
|
|
171
171
|
try {
|
|
172
|
-
const { format: a, numberOfChannels: u, numberOfFrames:
|
|
172
|
+
const { format: a, numberOfChannels: u, numberOfFrames: r, sampleRate: n } = o, i = h.createBuffer(u, r, n);
|
|
173
173
|
for (let t = 0; t < u; t++) {
|
|
174
174
|
const e = o.allocationSize({ planeIndex: t }), s = new Uint8Array(e);
|
|
175
175
|
o.copyTo(s, { planeIndex: t });
|
|
176
176
|
const l = new DataView(s.buffer), c = i.getChannelData(t);
|
|
177
|
-
for (let d = 0; d <
|
|
177
|
+
for (let d = 0; d < r; d++) {
|
|
178
178
|
let p;
|
|
179
179
|
switch (a) {
|
|
180
180
|
case "s16":
|
|
@@ -220,18 +220,19 @@ class W {
|
|
|
220
220
|
});
|
|
221
221
|
}
|
|
222
222
|
async push(o) {
|
|
223
|
+
const { audioData: a, playbackRate: u = 1 } = o;
|
|
223
224
|
try {
|
|
224
225
|
if (!this.audioContext || !this.destination) return;
|
|
225
|
-
const
|
|
226
|
-
if (!
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
this.nextStartTime =
|
|
231
|
-
this.pendingSources = this.pendingSources.filter((
|
|
226
|
+
const r = await V(this.audioContext, a);
|
|
227
|
+
if (!r) return;
|
|
228
|
+
const n = this.audioContext.createBufferSource();
|
|
229
|
+
n.buffer = r, n.playbackRate.value = u, n.connect(this.destination);
|
|
230
|
+
const i = Math.max(this.nextStartTime, this.audioContext.currentTime), t = r.duration / u;
|
|
231
|
+
this.nextStartTime = i + t, n.start(i), this.pendingSources.push(n), n.onended = () => {
|
|
232
|
+
this.pendingSources = this.pendingSources.filter((e) => e !== n);
|
|
232
233
|
}, this.audioContext.state === "suspended" && await this.audioContext.resume();
|
|
233
234
|
} finally {
|
|
234
|
-
|
|
235
|
+
a.close();
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
destroy() {
|
|
@@ -296,44 +297,44 @@ class $ {
|
|
|
296
297
|
* @param timeout 超时时间 ms
|
|
297
298
|
* @returns
|
|
298
299
|
*/
|
|
299
|
-
m(this, "add", (o, a = () => !1, u = 0) => new Promise((
|
|
300
|
+
m(this, "add", (o, a = () => !1, u = 0) => new Promise((r) => {
|
|
300
301
|
var t, e;
|
|
301
|
-
if (a()) return
|
|
302
|
+
if (a()) return r(!0);
|
|
302
303
|
this.resolvesMap.has(o) || this.resolvesMap.set(o, /* @__PURE__ */ new Map()), this.index++;
|
|
303
|
-
const
|
|
304
|
+
const n = `${this.index}`;
|
|
304
305
|
if (u = Math.max(0, u), u === 0) {
|
|
305
|
-
(t = this.resolvesMap.get(o)) == null || t.set(
|
|
306
|
+
(t = this.resolvesMap.get(o)) == null || t.set(n, { resolve: r, timer: 0 });
|
|
306
307
|
return;
|
|
307
308
|
}
|
|
308
309
|
const i = window.setTimeout(() => {
|
|
309
310
|
this.emit(o);
|
|
310
311
|
}, u);
|
|
311
|
-
(e = this.resolvesMap.get(o)) == null || e.set(
|
|
312
|
+
(e = this.resolvesMap.get(o)) == null || e.set(n, { resolve: r, timer: i });
|
|
312
313
|
}));
|
|
313
314
|
m(this, "emit", async (o) => {
|
|
314
315
|
const a = this.resolvesMap.get(o);
|
|
315
316
|
if (!a) return;
|
|
316
317
|
const u = [...a.keys()];
|
|
317
|
-
for (const
|
|
318
|
-
const
|
|
319
|
-
|
|
318
|
+
for (const r of u) {
|
|
319
|
+
const n = a.get(r);
|
|
320
|
+
n && (clearTimeout(n.timer), n.resolve(), a.delete(r));
|
|
320
321
|
}
|
|
321
322
|
});
|
|
322
323
|
}
|
|
323
324
|
}
|
|
324
325
|
const Y = (h) => {
|
|
325
326
|
const o = new DataView(h.buffer);
|
|
326
|
-
let a = 0, u,
|
|
327
|
+
let a = 0, u, r, n;
|
|
327
328
|
u = o.getUint32(a, !1), a += 4;
|
|
328
329
|
{
|
|
329
330
|
const i = o.getUint8(a), t = i >> 7 & 1, e = i >> 5 & 3, s = i & 31;
|
|
330
|
-
|
|
331
|
+
r = { forbidden_zero_bit: t, nal_ref_idc: e, nal_unit_type: s }, a += 1;
|
|
331
332
|
}
|
|
332
333
|
{
|
|
333
334
|
const i = u - 1;
|
|
334
|
-
|
|
335
|
+
n = new Uint8Array(o.buffer.slice(a, a + i));
|
|
335
336
|
}
|
|
336
|
-
return { size: u, header:
|
|
337
|
+
return { size: u, header: r, data: n };
|
|
337
338
|
};
|
|
338
339
|
var R, U;
|
|
339
340
|
class C {
|
|
@@ -348,34 +349,34 @@ class C {
|
|
|
348
349
|
* @param input string | URL | Request
|
|
349
350
|
* @param init RequestInit
|
|
350
351
|
*/
|
|
351
|
-
m(this, "check", (o, a) => new Promise(async (u,
|
|
352
|
+
m(this, "check", (o, a) => new Promise(async (u, r) => {
|
|
352
353
|
var i;
|
|
353
354
|
this.stop(), H(this, U, new AbortController());
|
|
354
|
-
const
|
|
355
|
+
const n = window.setTimeout(() => {
|
|
355
356
|
var t;
|
|
356
|
-
(t = I(this, U)) == null || t.abort("Timeout."),
|
|
357
|
+
(t = I(this, U)) == null || t.abort("Timeout."), r({ status: "timeout", reason: "" });
|
|
357
358
|
}, I(this, R).timeout);
|
|
358
359
|
try {
|
|
359
360
|
const t = await fetch(o, { ...a, method: "HEAD", signal: (i = I(this, U)) == null ? void 0 : i.signal });
|
|
360
|
-
t.status === 200 ? u({ status: "successed", reason: "" }) :
|
|
361
|
+
t.status === 200 ? u({ status: "successed", reason: "" }) : r({ status: "failed", reason: `${t.status}` });
|
|
361
362
|
} catch (t) {
|
|
362
|
-
|
|
363
|
+
r({ status: "error", reason: t.message });
|
|
363
364
|
}
|
|
364
|
-
clearTimeout(
|
|
365
|
+
clearTimeout(n);
|
|
365
366
|
}));
|
|
366
367
|
/**
|
|
367
368
|
*
|
|
368
369
|
* @param input string | URL | Request
|
|
369
370
|
* @param init RequestInit
|
|
370
371
|
*/
|
|
371
|
-
m(this, "request", async (o, a) => new Promise(async (u,
|
|
372
|
-
var
|
|
372
|
+
m(this, "request", async (o, a) => new Promise(async (u, r) => {
|
|
373
|
+
var n;
|
|
373
374
|
try {
|
|
374
375
|
I(this, R).check && await this.check(o, a), H(this, U, new AbortController());
|
|
375
|
-
const i = await fetch(o, { ...a, signal: (
|
|
376
|
+
const i = await fetch(o, { ...a, signal: (n = I(this, U)) == null ? void 0 : n.signal });
|
|
376
377
|
u(i);
|
|
377
378
|
} catch (i) {
|
|
378
|
-
this.stop(),
|
|
379
|
+
this.stop(), r(i);
|
|
379
380
|
}
|
|
380
381
|
}));
|
|
381
382
|
/**
|
|
@@ -434,13 +435,17 @@ class et {
|
|
|
434
435
|
* 停止
|
|
435
436
|
*/
|
|
436
437
|
m(this, "stop", async () => {
|
|
437
|
-
var
|
|
438
|
+
var a, u, r, n, i;
|
|
438
439
|
try {
|
|
439
440
|
clearInterval(this.hls.getSegmentsTimer), this.prFetch.stop();
|
|
440
|
-
} catch (
|
|
441
|
-
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: error",
|
|
441
|
+
} catch (t) {
|
|
442
|
+
console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: error", t);
|
|
442
443
|
}
|
|
443
|
-
(
|
|
444
|
+
(a = this.demuxerWorker) == null || a.destroy(), (u = this.decoderWorker) == null || u.destroy(), (r = this.renderWorker) == null || r.destroy();
|
|
445
|
+
const o = [...this.cutRenders.keys()];
|
|
446
|
+
for (const t of o)
|
|
447
|
+
(n = this.cutRenders.get(t)) == null || n.worker.destroy(), this.cutRenders.delete(t);
|
|
448
|
+
P(this.stream), (i = this.audioPlayer) == null || i.destroy();
|
|
444
449
|
});
|
|
445
450
|
/**
|
|
446
451
|
* 获取媒体流
|
|
@@ -487,25 +492,25 @@ class et {
|
|
|
487
492
|
this.demuxerWorker = new N(), this.demuxerWorker.init(o), this.demuxerWorker.on.debug = (a) => {
|
|
488
493
|
this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: debug", a);
|
|
489
494
|
}, this.demuxerWorker.on.info = (a) => {
|
|
490
|
-
var
|
|
495
|
+
var n;
|
|
491
496
|
this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: info", a);
|
|
492
|
-
const { framerate: u = 25 } = a,
|
|
493
|
-
(
|
|
497
|
+
const { framerate: u = 25 } = a, r = 1e3 / u;
|
|
498
|
+
(n = this.decoderWorker) == null || n.init({ decodingSpeed: r }), this.on.demuxer.info && this.on.demuxer.info(a);
|
|
494
499
|
}, this.demuxerWorker.on.config = (a) => {
|
|
495
|
-
var
|
|
500
|
+
var r, n;
|
|
496
501
|
this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: config", a), this.on.demuxer.config && this.on.demuxer.config(a);
|
|
497
502
|
const { kind: u } = a;
|
|
498
503
|
switch (u) {
|
|
499
504
|
case "audio":
|
|
500
505
|
{
|
|
501
506
|
const { codec: i, sampleRate: t, numberOfChannels: e } = a;
|
|
502
|
-
(
|
|
507
|
+
(r = this.decoderWorker) == null || r.audio.init({ codec: i, sampleRate: t, numberOfChannels: e });
|
|
503
508
|
}
|
|
504
509
|
break;
|
|
505
510
|
case "video":
|
|
506
511
|
{
|
|
507
512
|
const { codec: i, description: t } = a;
|
|
508
|
-
(
|
|
513
|
+
(n = this.decoderWorker) == null || n.video.init({ codec: i, description: t });
|
|
509
514
|
}
|
|
510
515
|
break;
|
|
511
516
|
}
|
|
@@ -515,14 +520,14 @@ class et {
|
|
|
515
520
|
switch (u) {
|
|
516
521
|
case "audio":
|
|
517
522
|
{
|
|
518
|
-
const { type:
|
|
519
|
-
this.decoderWorker.audio.push({ type:
|
|
523
|
+
const { type: r, dts: n, data: i } = a, t = n * 1;
|
|
524
|
+
this.decoderWorker.audio.push({ type: r, timestamp: t, data: i });
|
|
520
525
|
}
|
|
521
526
|
break;
|
|
522
527
|
case "video":
|
|
523
528
|
{
|
|
524
|
-
const { type:
|
|
525
|
-
this.decoderWorker.video.push({ type:
|
|
529
|
+
const { type: r, dts: n, data: i, nalus: t = [] } = a, e = n * 1e3;
|
|
530
|
+
this.decoderWorker.video.push({ type: r, timestamp: e, data: i });
|
|
526
531
|
for (const s of t) {
|
|
527
532
|
if (s.byteLength <= 4) continue;
|
|
528
533
|
const { header: l, data: c } = Y(s), { nal_unit_type: d } = l;
|
|
@@ -543,11 +548,11 @@ class et {
|
|
|
543
548
|
}, this.decoderWorker.on.audio.error = (o) => {
|
|
544
549
|
this.option.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->pr-player: audio.error ", o), this.on.error && this.on.error(o);
|
|
545
550
|
}, this.decoderWorker.on.video.decode = async (o) => {
|
|
546
|
-
var u,
|
|
551
|
+
var u, r;
|
|
547
552
|
(u = this.renderWorker) == null || u.push(o);
|
|
548
553
|
const a = [...this.cutRenders.keys()];
|
|
549
|
-
for (const
|
|
550
|
-
(
|
|
554
|
+
for (const n of a)
|
|
555
|
+
(r = this.cutRenders.get(n)) == null || r.worker.push(o);
|
|
551
556
|
this.on.decoder.video && this.on.decoder.video(o), o.bitmap.close();
|
|
552
557
|
}, this.decoderWorker.on.video.error = (o) => {
|
|
553
558
|
this.stop(), this.on.error && this.on.error(o);
|
|
@@ -596,12 +601,12 @@ class et {
|
|
|
596
601
|
var o, a;
|
|
597
602
|
try {
|
|
598
603
|
let u = await this.prFetch.request(this.url);
|
|
599
|
-
if (u.status !== 200 && (await new Promise((
|
|
600
|
-
const
|
|
601
|
-
if (!
|
|
604
|
+
if (u.status !== 200 && (await new Promise((n) => setTimeout(() => n(!0), 500)), u = await this.prFetch.request(this.url)), u.status !== 200 && (await new Promise((n) => setTimeout(() => n(!0), 500)), u = await this.prFetch.request(this.url)), u.status !== 200) throw new Error("request is error.");
|
|
605
|
+
const r = (o = u.body) == null ? void 0 : o.getReader();
|
|
606
|
+
if (!r) throw new Error("reader is error.");
|
|
602
607
|
for (; ; ) {
|
|
603
|
-
const { done:
|
|
604
|
-
if (i && ((a = this.demuxerWorker) == null || a.push(i)),
|
|
608
|
+
const { done: n, value: i } = await r.read();
|
|
609
|
+
if (i && ((a = this.demuxerWorker) == null || a.push(i)), n) break;
|
|
605
610
|
}
|
|
606
611
|
} catch (u) {
|
|
607
612
|
if ((u == null ? void 0 : u.name) !== "AbortError") throw Error(u);
|
|
@@ -617,26 +622,26 @@ class et {
|
|
|
617
622
|
parse: async (o) => {
|
|
618
623
|
const a = new TextDecoder("utf-8").decode(o).split(`
|
|
619
624
|
`).map((e) => e.replace("\r", "")), u = this.url.substring(0, this.url.lastIndexOf("/") + 1);
|
|
620
|
-
let
|
|
625
|
+
let r = 4, n = 0, i = !1;
|
|
621
626
|
const t = [];
|
|
622
627
|
for (const e of a)
|
|
623
|
-
e.startsWith("#EXTINF:") ?
|
|
628
|
+
e.startsWith("#EXTINF:") ? r = parseFloat(e.split(":")[1].split(",")[0]) : e.startsWith("#EXT-X-TARGETDURATION:") ? n = 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({
|
|
624
629
|
url: e.startsWith("http") ? e : u + e,
|
|
625
|
-
duration:
|
|
630
|
+
duration: r,
|
|
626
631
|
isLive: i
|
|
627
632
|
});
|
|
628
|
-
return { baseUrl: u, targetDuration:
|
|
633
|
+
return { baseUrl: u, targetDuration: n, isLive: i, segments: t };
|
|
629
634
|
},
|
|
630
635
|
getSegments: async () => {
|
|
631
636
|
var o;
|
|
632
637
|
try {
|
|
633
638
|
const a = new C();
|
|
634
639
|
let u = await a.request(this.url);
|
|
635
|
-
if (u.status !== 200 && (await new Promise((
|
|
636
|
-
const
|
|
637
|
-
if (!
|
|
640
|
+
if (u.status !== 200 && (await new Promise((n) => setTimeout(() => n(!0), 500)), u = await a.request(this.url)), u.status !== 200 && (await new Promise((n) => setTimeout(() => n(!0), 500)), u = await a.request(this.url)), u.status !== 200) throw new Error("request is error.");
|
|
641
|
+
const r = (o = u.body) == null ? void 0 : o.getReader();
|
|
642
|
+
if (!r) throw new Error("reader is error.");
|
|
638
643
|
for (; ; ) {
|
|
639
|
-
const { done:
|
|
644
|
+
const { done: n, value: i } = await r.read();
|
|
640
645
|
if (i) {
|
|
641
646
|
const t = await this.hls.parse(i), { segments: e = [], isLive: s = !1 } = t;
|
|
642
647
|
this.hls.isLive = s, s === !1 && (this.option.frameTrack = !1);
|
|
@@ -644,7 +649,7 @@ class et {
|
|
|
644
649
|
const c = l.findIndex((d) => d === this.hls.url);
|
|
645
650
|
c !== -1 && (l = l.slice(c + 1)), this.hls.urls = l;
|
|
646
651
|
}
|
|
647
|
-
if (
|
|
652
|
+
if (n) break;
|
|
648
653
|
}
|
|
649
654
|
} catch (a) {
|
|
650
655
|
this.on.error && this.on.error(a);
|
|
@@ -654,20 +659,20 @@ class et {
|
|
|
654
659
|
var o, a, u;
|
|
655
660
|
try {
|
|
656
661
|
for (await this.hls.getSegments(), this.hls.getSegmentsTimer = window.setInterval(this.hls.getSegments, 500), this.hls.isLive === !1 && (clearInterval(this.hls.getSegmentsTimer), (o = this.decoderWorker) == null ? void 0 : o.setFrameTrack(!1)); ; ) {
|
|
657
|
-
const
|
|
658
|
-
if (
|
|
659
|
-
this.hls.url =
|
|
660
|
-
const
|
|
661
|
-
if (!
|
|
662
|
+
const r = this.hls.urls.shift();
|
|
663
|
+
if (r) {
|
|
664
|
+
this.hls.url = r;
|
|
665
|
+
const n = (a = (await this.prFetch.request(r)).body) == null ? void 0 : a.getReader();
|
|
666
|
+
if (!n) throw new Error("segment reader is error.");
|
|
662
667
|
for (; ; ) {
|
|
663
|
-
const { done: i, value: t } = await
|
|
668
|
+
const { done: i, value: t } = await n.read();
|
|
664
669
|
if (t && ((u = this.demuxerWorker) == null || u.push(t)), i) break;
|
|
665
670
|
}
|
|
666
671
|
} else
|
|
667
|
-
await new Promise((
|
|
672
|
+
await new Promise((n) => setTimeout(() => n(!0), 300));
|
|
668
673
|
}
|
|
669
|
-
} catch (
|
|
670
|
-
if ((
|
|
674
|
+
} catch (r) {
|
|
675
|
+
if ((r == null ? void 0 : r.name) !== "AbortError") throw Error(r);
|
|
671
676
|
}
|
|
672
677
|
}
|
|
673
678
|
});
|
|
@@ -680,10 +685,10 @@ function requireAspromise() {
|
|
|
680
685
|
if (hasRequiredAspromise) return aspromise;
|
|
681
686
|
hasRequiredAspromise = 1, aspromise = h;
|
|
682
687
|
function h(o, a) {
|
|
683
|
-
for (var u = new Array(arguments.length - 1),
|
|
684
|
-
u[
|
|
688
|
+
for (var u = new Array(arguments.length - 1), r = 0, n = 2, i = !0; n < arguments.length; )
|
|
689
|
+
u[r++] = arguments[n++];
|
|
685
690
|
return new Promise(function(e, s) {
|
|
686
|
-
u[
|
|
691
|
+
u[r] = function(c) {
|
|
687
692
|
if (i)
|
|
688
693
|
if (i = !1, c)
|
|
689
694
|
s(c);
|
|
@@ -714,8 +719,8 @@ function requireBase64() {
|
|
|
714
719
|
++s;
|
|
715
720
|
return Math.ceil(t.length * 3) / 4 - s;
|
|
716
721
|
};
|
|
717
|
-
for (var a = new Array(64), u = new Array(123),
|
|
718
|
-
u[a[
|
|
722
|
+
for (var a = new Array(64), u = new Array(123), r = 0; r < 64; )
|
|
723
|
+
u[a[r] = r < 26 ? r + 65 : r < 52 ? r + 71 : r < 62 ? r - 4 : r - 59 | 43] = r++;
|
|
719
724
|
o.encode = function(t, e, s) {
|
|
720
725
|
for (var l = null, c = [], d = 0, p = 0, f; e < s; ) {
|
|
721
726
|
var w = t[e++];
|
|
@@ -734,14 +739,14 @@ function requireBase64() {
|
|
|
734
739
|
}
|
|
735
740
|
return p && (c[d++] = a[f], c[d++] = 61, p === 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));
|
|
736
741
|
};
|
|
737
|
-
var
|
|
742
|
+
var n = "invalid encoding";
|
|
738
743
|
o.decode = function(t, e, s) {
|
|
739
744
|
for (var l = s, c = 0, d, p = 0; p < t.length; ) {
|
|
740
745
|
var f = t.charCodeAt(p++);
|
|
741
746
|
if (f === 61 && c > 1)
|
|
742
747
|
break;
|
|
743
748
|
if ((f = u[f]) === void 0)
|
|
744
|
-
throw Error(
|
|
749
|
+
throw Error(n);
|
|
745
750
|
switch (c) {
|
|
746
751
|
case 0:
|
|
747
752
|
d = f, c = 1;
|
|
@@ -758,7 +763,7 @@ function requireBase64() {
|
|
|
758
763
|
}
|
|
759
764
|
}
|
|
760
765
|
if (c === 1)
|
|
761
|
-
throw Error(
|
|
766
|
+
throw Error(n);
|
|
762
767
|
return s - l;
|
|
763
768
|
}, o.test = function(t) {
|
|
764
769
|
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t);
|
|
@@ -772,10 +777,10 @@ function requireEventemitter() {
|
|
|
772
777
|
function h() {
|
|
773
778
|
this._listeners = {};
|
|
774
779
|
}
|
|
775
|
-
return h.prototype.on = function(a, u,
|
|
780
|
+
return h.prototype.on = function(a, u, r) {
|
|
776
781
|
return (this._listeners[a] || (this._listeners[a] = [])).push({
|
|
777
782
|
fn: u,
|
|
778
|
-
ctx:
|
|
783
|
+
ctx: r || this
|
|
779
784
|
}), this;
|
|
780
785
|
}, h.prototype.off = function(a, u) {
|
|
781
786
|
if (a === void 0)
|
|
@@ -783,16 +788,16 @@ function requireEventemitter() {
|
|
|
783
788
|
else if (u === void 0)
|
|
784
789
|
this._listeners[a] = [];
|
|
785
790
|
else
|
|
786
|
-
for (var
|
|
787
|
-
n
|
|
791
|
+
for (var r = this._listeners[a], n = 0; n < r.length; )
|
|
792
|
+
r[n].fn === u ? r.splice(n, 1) : ++n;
|
|
788
793
|
return this;
|
|
789
794
|
}, h.prototype.emit = function(a) {
|
|
790
795
|
var u = this._listeners[a];
|
|
791
796
|
if (u) {
|
|
792
|
-
for (var
|
|
793
|
-
|
|
794
|
-
for (
|
|
795
|
-
u[
|
|
797
|
+
for (var r = [], n = 1; n < arguments.length; )
|
|
798
|
+
r.push(arguments[n++]);
|
|
799
|
+
for (n = 0; n < u.length; )
|
|
800
|
+
u[n].fn.apply(u[n++].ctx, r);
|
|
796
801
|
}
|
|
797
802
|
return this;
|
|
798
803
|
}, eventemitter;
|
|
@@ -801,7 +806,7 @@ var float, hasRequiredFloat;
|
|
|
801
806
|
function requireFloat() {
|
|
802
807
|
if (hasRequiredFloat) return float;
|
|
803
808
|
hasRequiredFloat = 1, float = h(h);
|
|
804
|
-
function h(
|
|
809
|
+
function h(n) {
|
|
805
810
|
return typeof Float32Array < "u" ? function() {
|
|
806
811
|
var i = new Float32Array([-0]), t = new Uint8Array(i.buffer), e = t[3] === 128;
|
|
807
812
|
function s(p, f, w) {
|
|
@@ -810,14 +815,14 @@ function requireFloat() {
|
|
|
810
815
|
function l(p, f, w) {
|
|
811
816
|
i[0] = p, f[w] = t[3], f[w + 1] = t[2], f[w + 2] = t[1], f[w + 3] = t[0];
|
|
812
817
|
}
|
|
813
|
-
|
|
818
|
+
n.writeFloatLE = e ? s : l, n.writeFloatBE = e ? l : s;
|
|
814
819
|
function c(p, f) {
|
|
815
820
|
return t[0] = p[f], t[1] = p[f + 1], t[2] = p[f + 2], t[3] = p[f + 3], i[0];
|
|
816
821
|
}
|
|
817
822
|
function d(p, f) {
|
|
818
823
|
return t[3] = p[f], t[2] = p[f + 1], t[1] = p[f + 2], t[0] = p[f + 3], i[0];
|
|
819
824
|
}
|
|
820
|
-
|
|
825
|
+
n.readFloatLE = e ? c : d, n.readFloatBE = e ? d : c;
|
|
821
826
|
}() : function() {
|
|
822
827
|
function i(e, s, l, c) {
|
|
823
828
|
var d = s < 0 ? 1 : 0;
|
|
@@ -840,12 +845,12 @@ function requireFloat() {
|
|
|
840
845
|
e((d << 31 | p + 127 << 23 | f) >>> 0, l, c);
|
|
841
846
|
}
|
|
842
847
|
}
|
|
843
|
-
|
|
848
|
+
n.writeFloatLE = i.bind(null, o), n.writeFloatBE = i.bind(null, a);
|
|
844
849
|
function t(e, s, l) {
|
|
845
850
|
var c = e(s, l), d = (c >> 31) * 2 + 1, p = c >>> 23 & 255, f = c & 8388607;
|
|
846
851
|
return p === 255 ? f ? NaN : d * (1 / 0) : p === 0 ? d * 1401298464324817e-60 * f : d * Math.pow(2, p - 150) * (f + 8388608);
|
|
847
852
|
}
|
|
848
|
-
|
|
853
|
+
n.readFloatLE = t.bind(null, u), n.readFloatBE = t.bind(null, r);
|
|
849
854
|
}(), typeof Float64Array < "u" ? function() {
|
|
850
855
|
var i = new Float64Array([-0]), t = new Uint8Array(i.buffer), e = t[7] === 128;
|
|
851
856
|
function s(p, f, w) {
|
|
@@ -854,14 +859,14 @@ function requireFloat() {
|
|
|
854
859
|
function l(p, f, w) {
|
|
855
860
|
i[0] = p, f[w] = t[7], f[w + 1] = t[6], f[w + 2] = t[5], f[w + 3] = t[4], f[w + 4] = t[3], f[w + 5] = t[2], f[w + 6] = t[1], f[w + 7] = t[0];
|
|
856
861
|
}
|
|
857
|
-
|
|
862
|
+
n.writeDoubleLE = e ? s : l, n.writeDoubleBE = e ? l : s;
|
|
858
863
|
function c(p, f) {
|
|
859
864
|
return t[0] = p[f], t[1] = p[f + 1], t[2] = p[f + 2], t[3] = p[f + 3], t[4] = p[f + 4], t[5] = p[f + 5], t[6] = p[f + 6], t[7] = p[f + 7], i[0];
|
|
860
865
|
}
|
|
861
866
|
function d(p, f) {
|
|
862
867
|
return t[7] = p[f], t[6] = p[f + 1], t[5] = p[f + 2], t[4] = p[f + 3], t[3] = p[f + 4], t[2] = p[f + 5], t[1] = p[f + 6], t[0] = p[f + 7], i[0];
|
|
863
868
|
}
|
|
864
|
-
|
|
869
|
+
n.readDoubleLE = e ? c : d, n.readDoubleBE = e ? d : c;
|
|
865
870
|
}() : function() {
|
|
866
871
|
function i(e, s, l, c, d, p) {
|
|
867
872
|
var f = c < 0 ? 1 : 0;
|
|
@@ -887,25 +892,25 @@ function requireFloat() {
|
|
|
887
892
|
}
|
|
888
893
|
}
|
|
889
894
|
}
|
|
890
|
-
|
|
895
|
+
n.writeDoubleLE = i.bind(null, o, 0, 4), n.writeDoubleBE = i.bind(null, a, 4, 0);
|
|
891
896
|
function t(e, s, l, c, d) {
|
|
892
897
|
var p = e(c, d + s), f = e(c, d + l), w = (f >> 31) * 2 + 1, b = f >>> 20 & 2047, g = 4294967296 * (f & 1048575) + p;
|
|
893
898
|
return b === 2047 ? g ? NaN : w * (1 / 0) : b === 0 ? w * 5e-324 * g : w * Math.pow(2, b - 1075) * (g + 4503599627370496);
|
|
894
899
|
}
|
|
895
|
-
|
|
896
|
-
}(),
|
|
900
|
+
n.readDoubleLE = t.bind(null, u, 0, 4), n.readDoubleBE = t.bind(null, r, 4, 0);
|
|
901
|
+
}(), n;
|
|
897
902
|
}
|
|
898
|
-
function o(
|
|
899
|
-
i[t] =
|
|
903
|
+
function o(n, i, t) {
|
|
904
|
+
i[t] = n & 255, i[t + 1] = n >>> 8 & 255, i[t + 2] = n >>> 16 & 255, i[t + 3] = n >>> 24;
|
|
900
905
|
}
|
|
901
|
-
function a(
|
|
902
|
-
i[t] =
|
|
906
|
+
function a(n, i, t) {
|
|
907
|
+
i[t] = n >>> 24, i[t + 1] = n >>> 16 & 255, i[t + 2] = n >>> 8 & 255, i[t + 3] = n & 255;
|
|
903
908
|
}
|
|
904
|
-
function u(
|
|
905
|
-
return (
|
|
909
|
+
function u(n, i) {
|
|
910
|
+
return (n[i] | n[i + 1] << 8 | n[i + 2] << 16 | n[i + 3] << 24) >>> 0;
|
|
906
911
|
}
|
|
907
|
-
function n
|
|
908
|
-
return (
|
|
912
|
+
function r(n, i) {
|
|
913
|
+
return (n[i] << 24 | n[i + 1] << 16 | n[i + 2] << 8 | n[i + 3]) >>> 0;
|
|
909
914
|
}
|
|
910
915
|
return float;
|
|
911
916
|
}
|
|
@@ -929,20 +934,20 @@ function requireUtf8() {
|
|
|
929
934
|
return hasRequiredUtf8 || (hasRequiredUtf8 = 1, function(h) {
|
|
930
935
|
var o = h;
|
|
931
936
|
o.length = function(u) {
|
|
932
|
-
for (var
|
|
933
|
-
|
|
934
|
-
return
|
|
935
|
-
}, o.read = function(u,
|
|
936
|
-
var i =
|
|
937
|
+
for (var r = 0, n = 0, i = 0; i < u.length; ++i)
|
|
938
|
+
n = u.charCodeAt(i), n < 128 ? r += 1 : n < 2048 ? r += 2 : (n & 64512) === 55296 && (u.charCodeAt(i + 1) & 64512) === 56320 ? (++i, r += 4) : r += 3;
|
|
939
|
+
return r;
|
|
940
|
+
}, o.read = function(u, r, n) {
|
|
941
|
+
var i = n - r;
|
|
937
942
|
if (i < 1)
|
|
938
943
|
return "";
|
|
939
|
-
for (var t = null, e = [], s = 0, l;
|
|
940
|
-
l = u[
|
|
944
|
+
for (var t = null, e = [], s = 0, l; r < n; )
|
|
945
|
+
l = u[r++], l < 128 ? e[s++] = l : l > 191 && l < 224 ? e[s++] = (l & 31) << 6 | u[r++] & 63 : l > 239 && l < 365 ? (l = ((l & 7) << 18 | (u[r++] & 63) << 12 | (u[r++] & 63) << 6 | u[r++] & 63) - 65536, e[s++] = 55296 + (l >> 10), e[s++] = 56320 + (l & 1023)) : e[s++] = (l & 15) << 12 | (u[r++] & 63) << 6 | u[r++] & 63, s > 8191 && ((t || (t = [])).push(String.fromCharCode.apply(String, e)), s = 0);
|
|
941
946
|
return t ? (s && t.push(String.fromCharCode.apply(String, e.slice(0, s))), t.join("")) : String.fromCharCode.apply(String, e.slice(0, s));
|
|
942
|
-
}, o.write = function(u,
|
|
943
|
-
for (var i =
|
|
944
|
-
t = u.charCodeAt(s), t < 128 ? n
|
|
945
|
-
return
|
|
947
|
+
}, o.write = function(u, r, n) {
|
|
948
|
+
for (var i = n, t, e, s = 0; s < u.length; ++s)
|
|
949
|
+
t = u.charCodeAt(s), t < 128 ? r[n++] = t : t < 2048 ? (r[n++] = t >> 6 | 192, r[n++] = t & 63 | 128) : (t & 64512) === 55296 && ((e = u.charCodeAt(s + 1)) & 64512) === 56320 ? (t = 65536 + ((t & 1023) << 10) + (e & 1023), ++s, r[n++] = t >> 18 | 240, r[n++] = t >> 12 & 63 | 128, r[n++] = t >> 6 & 63 | 128, r[n++] = t & 63 | 128) : (r[n++] = t >> 12 | 224, r[n++] = t >> 6 & 63 | 128, r[n++] = t & 63 | 128);
|
|
950
|
+
return n - i;
|
|
946
951
|
};
|
|
947
952
|
}(utf8)), utf8;
|
|
948
953
|
}
|
|
@@ -951,11 +956,11 @@ function requirePool() {
|
|
|
951
956
|
if (hasRequiredPool) return pool_1;
|
|
952
957
|
hasRequiredPool = 1, pool_1 = h;
|
|
953
958
|
function h(o, a, u) {
|
|
954
|
-
var
|
|
959
|
+
var r = u || 8192, n = r >>> 1, i = null, t = r;
|
|
955
960
|
return function(s) {
|
|
956
|
-
if (s < 1 || s >
|
|
961
|
+
if (s < 1 || s > n)
|
|
957
962
|
return o(s);
|
|
958
|
-
t + s >
|
|
963
|
+
t + s > r && (i = o(r), t = 0);
|
|
959
964
|
var l = a.call(i, t, t += s);
|
|
960
965
|
return t & 7 && (t = (t | 7) + 1), l;
|
|
961
966
|
};
|
|
@@ -967,8 +972,8 @@ function requireLongbits() {
|
|
|
967
972
|
if (hasRequiredLongbits) return longbits;
|
|
968
973
|
hasRequiredLongbits = 1, longbits = o;
|
|
969
974
|
var h = requireMinimal$1();
|
|
970
|
-
function o(
|
|
971
|
-
this.lo =
|
|
975
|
+
function o(n, i) {
|
|
976
|
+
this.lo = n >>> 0, this.hi = i >>> 0;
|
|
972
977
|
}
|
|
973
978
|
var a = o.zero = new o(0, 0);
|
|
974
979
|
a.toNumber = function() {
|
|
@@ -1004,11 +1009,11 @@ function requireLongbits() {
|
|
|
1004
1009
|
}, o.prototype.toLong = function(i) {
|
|
1005
1010
|
return h.Long ? new h.Long(this.lo | 0, this.hi | 0, !!i) : { low: this.lo | 0, high: this.hi | 0, unsigned: !!i };
|
|
1006
1011
|
};
|
|
1007
|
-
var
|
|
1012
|
+
var r = String.prototype.charCodeAt;
|
|
1008
1013
|
return o.fromHash = function(i) {
|
|
1009
1014
|
return i === u ? a : new o(
|
|
1010
|
-
(
|
|
1011
|
-
(
|
|
1015
|
+
(r.call(i, 0) | r.call(i, 1) << 8 | r.call(i, 2) << 16 | r.call(i, 3) << 24) >>> 0,
|
|
1016
|
+
(r.call(i, 4) | r.call(i, 5) << 8 | r.call(i, 6) << 16 | r.call(i, 7) << 24) >>> 0
|
|
1012
1017
|
);
|
|
1013
1018
|
}, o.prototype.toHash = function() {
|
|
1014
1019
|
return String.fromCharCode(
|
|
@@ -1043,68 +1048,68 @@ function requireMinimal$1() {
|
|
|
1043
1048
|
/* istanbul ignore next */
|
|
1044
1049
|
{}
|
|
1045
1050
|
), o.isInteger = Number.isInteger || /* istanbul ignore next */
|
|
1046
|
-
function(
|
|
1047
|
-
return typeof
|
|
1048
|
-
}, o.isString = function(
|
|
1049
|
-
return typeof
|
|
1050
|
-
}, o.isObject = function(
|
|
1051
|
-
return
|
|
1051
|
+
function(n) {
|
|
1052
|
+
return typeof n == "number" && isFinite(n) && Math.floor(n) === n;
|
|
1053
|
+
}, o.isString = function(n) {
|
|
1054
|
+
return typeof n == "string" || n instanceof String;
|
|
1055
|
+
}, o.isObject = function(n) {
|
|
1056
|
+
return n && typeof n == "object";
|
|
1052
1057
|
}, o.isset = /**
|
|
1053
1058
|
* Checks if a property on a message is considered to be present.
|
|
1054
1059
|
* @param {Object} obj Plain object or message instance
|
|
1055
1060
|
* @param {string} prop Property name
|
|
1056
1061
|
* @returns {boolean} `true` if considered to be present, otherwise `false`
|
|
1057
1062
|
*/
|
|
1058
|
-
o.isSet = function(
|
|
1059
|
-
var t =
|
|
1060
|
-
return t != null &&
|
|
1063
|
+
o.isSet = function(n, i) {
|
|
1064
|
+
var t = n[i];
|
|
1065
|
+
return t != null && n.hasOwnProperty(i) ? typeof t != "object" || (Array.isArray(t) ? t.length : Object.keys(t).length) > 0 : !1;
|
|
1061
1066
|
}, o.Buffer = function() {
|
|
1062
1067
|
try {
|
|
1063
|
-
var
|
|
1064
|
-
return
|
|
1068
|
+
var r = o.inquire("buffer").Buffer;
|
|
1069
|
+
return r.prototype.utf8Write ? r : (
|
|
1065
1070
|
/* istanbul ignore next */
|
|
1066
1071
|
null
|
|
1067
1072
|
);
|
|
1068
1073
|
} catch {
|
|
1069
1074
|
return null;
|
|
1070
1075
|
}
|
|
1071
|
-
}(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(
|
|
1072
|
-
return typeof
|
|
1076
|
+
}(), o._Buffer_from = null, o._Buffer_allocUnsafe = null, o.newBuffer = function(n) {
|
|
1077
|
+
return typeof n == "number" ? o.Buffer ? o._Buffer_allocUnsafe(n) : new o.Array(n) : o.Buffer ? o._Buffer_from(n) : typeof Uint8Array > "u" ? n : new Uint8Array(n);
|
|
1073
1078
|
}, o.Array = typeof Uint8Array < "u" ? Uint8Array : Array, o.Long = /* istanbul ignore next */
|
|
1074
1079
|
o.global.dcodeIO && /* istanbul ignore next */
|
|
1075
1080
|
o.global.dcodeIO.Long || /* istanbul ignore next */
|
|
1076
|
-
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(
|
|
1077
|
-
return
|
|
1078
|
-
}, o.longFromHash = function(
|
|
1079
|
-
var t = o.LongBits.fromHash(
|
|
1081
|
+
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(n) {
|
|
1082
|
+
return n ? o.LongBits.from(n).toHash() : o.LongBits.zeroHash;
|
|
1083
|
+
}, o.longFromHash = function(n, i) {
|
|
1084
|
+
var t = o.LongBits.fromHash(n);
|
|
1080
1085
|
return o.Long ? o.Long.fromBits(t.lo, t.hi, i) : t.toNumber(!!i);
|
|
1081
1086
|
};
|
|
1082
|
-
function a(
|
|
1083
|
-
for (var t = Object.keys(
|
|
1084
|
-
(
|
|
1085
|
-
return
|
|
1087
|
+
function a(r, n, i) {
|
|
1088
|
+
for (var t = Object.keys(n), e = 0; e < t.length; ++e)
|
|
1089
|
+
(r[t[e]] === void 0 || !i) && (r[t[e]] = n[t[e]]);
|
|
1090
|
+
return r;
|
|
1086
1091
|
}
|
|
1087
|
-
o.merge = a, o.lcFirst = function(
|
|
1088
|
-
return
|
|
1092
|
+
o.merge = a, o.lcFirst = function(n) {
|
|
1093
|
+
return n.charAt(0).toLowerCase() + n.substring(1);
|
|
1089
1094
|
};
|
|
1090
|
-
function u(
|
|
1091
|
-
function
|
|
1092
|
-
if (!(this instanceof
|
|
1093
|
-
return new
|
|
1095
|
+
function u(r) {
|
|
1096
|
+
function n(i, t) {
|
|
1097
|
+
if (!(this instanceof n))
|
|
1098
|
+
return new n(i, t);
|
|
1094
1099
|
Object.defineProperty(this, "message", { get: function() {
|
|
1095
1100
|
return i;
|
|
1096
|
-
} }), Error.captureStackTrace ? Error.captureStackTrace(this,
|
|
1101
|
+
} }), Error.captureStackTrace ? Error.captureStackTrace(this, n) : Object.defineProperty(this, "stack", { value: new Error().stack || "" }), t && a(this, t);
|
|
1097
1102
|
}
|
|
1098
|
-
return
|
|
1103
|
+
return n.prototype = Object.create(Error.prototype, {
|
|
1099
1104
|
constructor: {
|
|
1100
|
-
value:
|
|
1105
|
+
value: n,
|
|
1101
1106
|
writable: !0,
|
|
1102
1107
|
enumerable: !1,
|
|
1103
1108
|
configurable: !0
|
|
1104
1109
|
},
|
|
1105
1110
|
name: {
|
|
1106
1111
|
get: function() {
|
|
1107
|
-
return
|
|
1112
|
+
return r;
|
|
1108
1113
|
},
|
|
1109
1114
|
set: void 0,
|
|
1110
1115
|
enumerable: !1,
|
|
@@ -1122,20 +1127,20 @@ function requireMinimal$1() {
|
|
|
1122
1127
|
enumerable: !1,
|
|
1123
1128
|
configurable: !0
|
|
1124
1129
|
}
|
|
1125
|
-
}),
|
|
1130
|
+
}), n;
|
|
1126
1131
|
}
|
|
1127
|
-
o.newError = u, o.ProtocolError = u("ProtocolError"), o.oneOfGetter = function(
|
|
1128
|
-
for (var i = {}, t = 0; t <
|
|
1129
|
-
i[
|
|
1132
|
+
o.newError = u, o.ProtocolError = u("ProtocolError"), o.oneOfGetter = function(n) {
|
|
1133
|
+
for (var i = {}, t = 0; t < n.length; ++t)
|
|
1134
|
+
i[n[t]] = 1;
|
|
1130
1135
|
return function() {
|
|
1131
1136
|
for (var e = Object.keys(this), s = e.length - 1; s > -1; --s)
|
|
1132
1137
|
if (i[e[s]] === 1 && this[e[s]] !== void 0 && this[e[s]] !== null)
|
|
1133
1138
|
return e[s];
|
|
1134
1139
|
};
|
|
1135
|
-
}, o.oneOfSetter = function(
|
|
1140
|
+
}, o.oneOfSetter = function(n) {
|
|
1136
1141
|
return function(i) {
|
|
1137
|
-
for (var t = 0; t <
|
|
1138
|
-
|
|
1142
|
+
for (var t = 0; t < n.length; ++t)
|
|
1143
|
+
n[t] !== i && delete this[n[t]];
|
|
1139
1144
|
};
|
|
1140
1145
|
}, o.toJSONOptions = {
|
|
1141
1146
|
longs: String,
|
|
@@ -1143,17 +1148,17 @@ function requireMinimal$1() {
|
|
|
1143
1148
|
bytes: String,
|
|
1144
1149
|
json: !0
|
|
1145
1150
|
}, o._configure = function() {
|
|
1146
|
-
var
|
|
1147
|
-
if (!
|
|
1151
|
+
var r = o.Buffer;
|
|
1152
|
+
if (!r) {
|
|
1148
1153
|
o._Buffer_from = o._Buffer_allocUnsafe = null;
|
|
1149
1154
|
return;
|
|
1150
1155
|
}
|
|
1151
|
-
o._Buffer_from =
|
|
1156
|
+
o._Buffer_from = r.from !== Uint8Array.from && r.from || /* istanbul ignore next */
|
|
1152
1157
|
function(i, t) {
|
|
1153
|
-
return new
|
|
1154
|
-
}, o._Buffer_allocUnsafe =
|
|
1158
|
+
return new r(i, t);
|
|
1159
|
+
}, o._Buffer_allocUnsafe = r.allocUnsafe || /* istanbul ignore next */
|
|
1155
1160
|
function(i) {
|
|
1156
|
-
return new
|
|
1161
|
+
return new r(i);
|
|
1157
1162
|
};
|
|
1158
1163
|
};
|
|
1159
1164
|
}(minimal$1)), minimal$1;
|
|
@@ -1162,8 +1167,8 @@ var writer, hasRequiredWriter;
|
|
|
1162
1167
|
function requireWriter() {
|
|
1163
1168
|
if (hasRequiredWriter) return writer;
|
|
1164
1169
|
hasRequiredWriter = 1, writer = e;
|
|
1165
|
-
var h = requireMinimal$1(), o, a = h.LongBits, u = h.base64,
|
|
1166
|
-
function
|
|
1170
|
+
var h = requireMinimal$1(), o, a = h.LongBits, u = h.base64, r = h.utf8;
|
|
1171
|
+
function n(b, g, k) {
|
|
1167
1172
|
this.fn = b, this.len = g, this.next = void 0, this.val = k;
|
|
1168
1173
|
}
|
|
1169
1174
|
function i() {
|
|
@@ -1172,7 +1177,7 @@ function requireWriter() {
|
|
|
1172
1177
|
this.head = b.head, this.tail = b.tail, this.len = b.len, this.next = b.states;
|
|
1173
1178
|
}
|
|
1174
1179
|
function e() {
|
|
1175
|
-
this.len = 0, this.head = new
|
|
1180
|
+
this.len = 0, this.head = new n(i, 0, 0), this.tail = this.head, this.states = null;
|
|
1176
1181
|
}
|
|
1177
1182
|
var s = function() {
|
|
1178
1183
|
return h.Buffer ? function() {
|
|
@@ -1186,7 +1191,7 @@ function requireWriter() {
|
|
|
1186
1191
|
e.create = s(), e.alloc = function(g) {
|
|
1187
1192
|
return new h.Array(g);
|
|
1188
1193
|
}, h.Array !== Array && (e.alloc = h.pool(e.alloc, h.Array.prototype.subarray)), e.prototype._push = function(g, k, _) {
|
|
1189
|
-
return this.tail = this.tail.next = new
|
|
1194
|
+
return this.tail = this.tail.next = new n(g, k, _), this.len += k, this;
|
|
1190
1195
|
};
|
|
1191
1196
|
function l(b, g, k) {
|
|
1192
1197
|
g[k] = b & 255;
|
|
@@ -1199,7 +1204,7 @@ function requireWriter() {
|
|
|
1199
1204
|
function d(b, g) {
|
|
1200
1205
|
this.len = b, this.next = void 0, this.val = g;
|
|
1201
1206
|
}
|
|
1202
|
-
d.prototype = Object.create(
|
|
1207
|
+
d.prototype = Object.create(n.prototype), d.prototype.fn = c, e.prototype.uint32 = function(g) {
|
|
1203
1208
|
return this.len += (this.tail = this.tail.next = new d(
|
|
1204
1209
|
(g = g >>> 0) < 128 ? 1 : g < 16384 ? 2 : g < 2097152 ? 3 : g < 268435456 ? 4 : 5,
|
|
1205
1210
|
g
|
|
@@ -1254,12 +1259,12 @@ function requireWriter() {
|
|
|
1254
1259
|
}
|
|
1255
1260
|
return this.uint32(k)._push(w, k, g);
|
|
1256
1261
|
}, e.prototype.string = function(g) {
|
|
1257
|
-
var k =
|
|
1258
|
-
return k ? this.uint32(k)._push(
|
|
1262
|
+
var k = r.length(g);
|
|
1263
|
+
return k ? this.uint32(k)._push(r.write, k, g) : this._push(l, 1, 0);
|
|
1259
1264
|
}, e.prototype.fork = function() {
|
|
1260
|
-
return this.states = new t(this), this.head = this.tail = new
|
|
1265
|
+
return this.states = new t(this), this.head = this.tail = new n(i, 0, 0), this.len = 0, this;
|
|
1261
1266
|
}, e.prototype.reset = function() {
|
|
1262
|
-
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
|
|
1267
|
+
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 n(i, 0, 0), this.len = 0), this;
|
|
1263
1268
|
}, e.prototype.ldelim = function() {
|
|
1264
1269
|
var g = this.head, k = this.tail, _ = this.len;
|
|
1265
1270
|
return this.reset().uint32(_), _ && (this.tail.next = g.next, this.tail = k, this.len += _), this;
|
|
@@ -1282,65 +1287,65 @@ function requireWriter_buffer() {
|
|
|
1282
1287
|
h.call(this);
|
|
1283
1288
|
}
|
|
1284
1289
|
a._configure = function() {
|
|
1285
|
-
a.alloc = o._Buffer_allocUnsafe, a.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(
|
|
1286
|
-
i.set(
|
|
1287
|
-
} : function(
|
|
1288
|
-
if (
|
|
1289
|
-
|
|
1290
|
-
else for (var e = 0; e <
|
|
1291
|
-
i[t++] =
|
|
1290
|
+
a.alloc = o._Buffer_allocUnsafe, a.writeBytesBuffer = o.Buffer && o.Buffer.prototype instanceof Uint8Array && o.Buffer.prototype.set.name === "set" ? function(n, i, t) {
|
|
1291
|
+
i.set(n, t);
|
|
1292
|
+
} : function(n, i, t) {
|
|
1293
|
+
if (n.copy)
|
|
1294
|
+
n.copy(i, t, 0, n.length);
|
|
1295
|
+
else for (var e = 0; e < n.length; )
|
|
1296
|
+
i[t++] = n[e++];
|
|
1292
1297
|
};
|
|
1293
|
-
}, a.prototype.bytes = function(
|
|
1294
|
-
o.isString(
|
|
1295
|
-
var i =
|
|
1296
|
-
return this.uint32(i), i && this._push(a.writeBytesBuffer, i,
|
|
1298
|
+
}, a.prototype.bytes = function(n) {
|
|
1299
|
+
o.isString(n) && (n = o._Buffer_from(n, "base64"));
|
|
1300
|
+
var i = n.length >>> 0;
|
|
1301
|
+
return this.uint32(i), i && this._push(a.writeBytesBuffer, i, n), this;
|
|
1297
1302
|
};
|
|
1298
|
-
function u(
|
|
1299
|
-
|
|
1303
|
+
function u(r, n, i) {
|
|
1304
|
+
r.length < 40 ? o.utf8.write(r, n, i) : n.utf8Write ? n.utf8Write(r, i) : n.write(r, i);
|
|
1300
1305
|
}
|
|
1301
|
-
return a.prototype.string = function(
|
|
1302
|
-
var i = o.Buffer.byteLength(
|
|
1303
|
-
return this.uint32(i), i && this._push(u, i,
|
|
1306
|
+
return a.prototype.string = function(n) {
|
|
1307
|
+
var i = o.Buffer.byteLength(n);
|
|
1308
|
+
return this.uint32(i), i && this._push(u, i, n), this;
|
|
1304
1309
|
}, a._configure(), writer_buffer;
|
|
1305
1310
|
}
|
|
1306
1311
|
var reader, hasRequiredReader;
|
|
1307
1312
|
function requireReader() {
|
|
1308
1313
|
if (hasRequiredReader) return reader;
|
|
1309
|
-
hasRequiredReader = 1, reader =
|
|
1314
|
+
hasRequiredReader = 1, reader = n;
|
|
1310
1315
|
var h = requireMinimal$1(), o, a = h.LongBits, u = h.utf8;
|
|
1311
|
-
function
|
|
1316
|
+
function r(c, d) {
|
|
1312
1317
|
return RangeError("index out of range: " + c.pos + " + " + (d || 1) + " > " + c.len);
|
|
1313
1318
|
}
|
|
1314
|
-
function
|
|
1319
|
+
function n(c) {
|
|
1315
1320
|
this.buf = c, this.pos = 0, this.len = c.length;
|
|
1316
1321
|
}
|
|
1317
1322
|
var i = typeof Uint8Array < "u" ? function(d) {
|
|
1318
1323
|
if (d instanceof Uint8Array || Array.isArray(d))
|
|
1319
|
-
return new
|
|
1324
|
+
return new n(d);
|
|
1320
1325
|
throw Error("illegal buffer");
|
|
1321
1326
|
} : function(d) {
|
|
1322
1327
|
if (Array.isArray(d))
|
|
1323
|
-
return new
|
|
1328
|
+
return new n(d);
|
|
1324
1329
|
throw Error("illegal buffer");
|
|
1325
1330
|
}, t = function() {
|
|
1326
1331
|
return h.Buffer ? function(p) {
|
|
1327
|
-
return (
|
|
1332
|
+
return (n.create = function(w) {
|
|
1328
1333
|
return h.Buffer.isBuffer(w) ? new o(w) : i(w);
|
|
1329
1334
|
})(p);
|
|
1330
1335
|
} : i;
|
|
1331
1336
|
};
|
|
1332
|
-
|
|
1333
|
-
h.Array.prototype.slice,
|
|
1337
|
+
n.create = t(), n.prototype._slice = h.Array.prototype.subarray || /* istanbul ignore next */
|
|
1338
|
+
h.Array.prototype.slice, n.prototype.uint32 = /* @__PURE__ */ function() {
|
|
1334
1339
|
var d = 4294967295;
|
|
1335
1340
|
return function() {
|
|
1336
1341
|
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;
|
|
1337
1342
|
if ((this.pos += 5) > this.len)
|
|
1338
|
-
throw this.pos = this.len,
|
|
1343
|
+
throw this.pos = this.len, r(this, 10);
|
|
1339
1344
|
return d;
|
|
1340
1345
|
};
|
|
1341
|
-
}(),
|
|
1346
|
+
}(), n.prototype.int32 = function() {
|
|
1342
1347
|
return this.uint32() | 0;
|
|
1343
|
-
},
|
|
1348
|
+
}, n.prototype.sint32 = function() {
|
|
1344
1349
|
var d = this.uint32();
|
|
1345
1350
|
return d >>> 1 ^ -(d & 1) | 0;
|
|
1346
1351
|
};
|
|
@@ -1356,7 +1361,7 @@ function requireReader() {
|
|
|
1356
1361
|
} else {
|
|
1357
1362
|
for (; d < 3; ++d) {
|
|
1358
1363
|
if (this.pos >= this.len)
|
|
1359
|
-
throw
|
|
1364
|
+
throw r(this);
|
|
1360
1365
|
if (c.lo = (c.lo | (this.buf[this.pos] & 127) << d * 7) >>> 0, this.buf[this.pos++] < 128)
|
|
1361
1366
|
return c;
|
|
1362
1367
|
}
|
|
@@ -1369,46 +1374,46 @@ function requireReader() {
|
|
|
1369
1374
|
} else
|
|
1370
1375
|
for (; d < 5; ++d) {
|
|
1371
1376
|
if (this.pos >= this.len)
|
|
1372
|
-
throw
|
|
1377
|
+
throw r(this);
|
|
1373
1378
|
if (c.hi = (c.hi | (this.buf[this.pos] & 127) << d * 7 + 3) >>> 0, this.buf[this.pos++] < 128)
|
|
1374
1379
|
return c;
|
|
1375
1380
|
}
|
|
1376
1381
|
throw Error("invalid varint encoding");
|
|
1377
1382
|
}
|
|
1378
|
-
|
|
1383
|
+
n.prototype.bool = function() {
|
|
1379
1384
|
return this.uint32() !== 0;
|
|
1380
1385
|
};
|
|
1381
1386
|
function s(c, d) {
|
|
1382
1387
|
return (c[d - 4] | c[d - 3] << 8 | c[d - 2] << 16 | c[d - 1] << 24) >>> 0;
|
|
1383
1388
|
}
|
|
1384
|
-
|
|
1389
|
+
n.prototype.fixed32 = function() {
|
|
1385
1390
|
if (this.pos + 4 > this.len)
|
|
1386
|
-
throw
|
|
1391
|
+
throw r(this, 4);
|
|
1387
1392
|
return s(this.buf, this.pos += 4);
|
|
1388
|
-
},
|
|
1393
|
+
}, n.prototype.sfixed32 = function() {
|
|
1389
1394
|
if (this.pos + 4 > this.len)
|
|
1390
|
-
throw
|
|
1395
|
+
throw r(this, 4);
|
|
1391
1396
|
return s(this.buf, this.pos += 4) | 0;
|
|
1392
1397
|
};
|
|
1393
1398
|
function l() {
|
|
1394
1399
|
if (this.pos + 8 > this.len)
|
|
1395
|
-
throw
|
|
1400
|
+
throw r(this, 8);
|
|
1396
1401
|
return new a(s(this.buf, this.pos += 4), s(this.buf, this.pos += 4));
|
|
1397
1402
|
}
|
|
1398
|
-
return
|
|
1403
|
+
return n.prototype.float = function() {
|
|
1399
1404
|
if (this.pos + 4 > this.len)
|
|
1400
|
-
throw
|
|
1405
|
+
throw r(this, 4);
|
|
1401
1406
|
var d = h.float.readFloatLE(this.buf, this.pos);
|
|
1402
1407
|
return this.pos += 4, d;
|
|
1403
|
-
},
|
|
1408
|
+
}, n.prototype.double = function() {
|
|
1404
1409
|
if (this.pos + 8 > this.len)
|
|
1405
|
-
throw
|
|
1410
|
+
throw r(this, 4);
|
|
1406
1411
|
var d = h.float.readDoubleLE(this.buf, this.pos);
|
|
1407
1412
|
return this.pos += 8, d;
|
|
1408
|
-
},
|
|
1413
|
+
}, n.prototype.bytes = function() {
|
|
1409
1414
|
var d = this.uint32(), p = this.pos, f = this.pos + d;
|
|
1410
1415
|
if (f > this.len)
|
|
1411
|
-
throw
|
|
1416
|
+
throw r(this, d);
|
|
1412
1417
|
if (this.pos += d, Array.isArray(this.buf))
|
|
1413
1418
|
return this.buf.slice(p, f);
|
|
1414
1419
|
if (p === f) {
|
|
@@ -1416,21 +1421,21 @@ function requireReader() {
|
|
|
1416
1421
|
return w ? w.alloc(0) : new this.buf.constructor(0);
|
|
1417
1422
|
}
|
|
1418
1423
|
return this._slice.call(this.buf, p, f);
|
|
1419
|
-
},
|
|
1424
|
+
}, n.prototype.string = function() {
|
|
1420
1425
|
var d = this.bytes();
|
|
1421
1426
|
return u.read(d, 0, d.length);
|
|
1422
|
-
},
|
|
1427
|
+
}, n.prototype.skip = function(d) {
|
|
1423
1428
|
if (typeof d == "number") {
|
|
1424
1429
|
if (this.pos + d > this.len)
|
|
1425
|
-
throw
|
|
1430
|
+
throw r(this, d);
|
|
1426
1431
|
this.pos += d;
|
|
1427
1432
|
} else
|
|
1428
1433
|
do
|
|
1429
1434
|
if (this.pos >= this.len)
|
|
1430
|
-
throw
|
|
1435
|
+
throw r(this);
|
|
1431
1436
|
while (this.buf[this.pos++] & 128);
|
|
1432
1437
|
return this;
|
|
1433
|
-
},
|
|
1438
|
+
}, n.prototype.skipType = function(c) {
|
|
1434
1439
|
switch (c) {
|
|
1435
1440
|
case 0:
|
|
1436
1441
|
this.skip();
|
|
@@ -1453,13 +1458,13 @@ function requireReader() {
|
|
|
1453
1458
|
throw Error("invalid wire type " + c + " at offset " + this.pos);
|
|
1454
1459
|
}
|
|
1455
1460
|
return this;
|
|
1456
|
-
},
|
|
1457
|
-
o = c,
|
|
1461
|
+
}, n._configure = function(c) {
|
|
1462
|
+
o = c, n.create = t(), o._configure();
|
|
1458
1463
|
var d = h.Long ? "toLong" : (
|
|
1459
1464
|
/* istanbul ignore next */
|
|
1460
1465
|
"toNumber"
|
|
1461
1466
|
);
|
|
1462
|
-
h.merge(
|
|
1467
|
+
h.merge(n.prototype, {
|
|
1463
1468
|
int64: function() {
|
|
1464
1469
|
return e.call(this)[d](!1);
|
|
1465
1470
|
},
|
|
@@ -1491,8 +1496,8 @@ function requireReader_buffer() {
|
|
|
1491
1496
|
return a._configure = function() {
|
|
1492
1497
|
o.Buffer && (a.prototype._slice = o.Buffer.prototype.slice);
|
|
1493
1498
|
}, a.prototype.string = function() {
|
|
1494
|
-
var
|
|
1495
|
-
return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos +
|
|
1499
|
+
var r = this.uint32();
|
|
1500
|
+
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));
|
|
1496
1501
|
}, a._configure(), reader_buffer;
|
|
1497
1502
|
}
|
|
1498
1503
|
var rpc = {}, service, hasRequiredService;
|
|
@@ -1501,17 +1506,17 @@ function requireService() {
|
|
|
1501
1506
|
hasRequiredService = 1, service = o;
|
|
1502
1507
|
var h = requireMinimal$1();
|
|
1503
1508
|
(o.prototype = Object.create(h.EventEmitter.prototype)).constructor = o;
|
|
1504
|
-
function o(a, u,
|
|
1509
|
+
function o(a, u, r) {
|
|
1505
1510
|
if (typeof a != "function")
|
|
1506
1511
|
throw TypeError("rpcImpl must be a function");
|
|
1507
|
-
h.EventEmitter.call(this), this.rpcImpl = a, this.requestDelimited = !!u, this.responseDelimited = !!
|
|
1512
|
+
h.EventEmitter.call(this), this.rpcImpl = a, this.requestDelimited = !!u, this.responseDelimited = !!r;
|
|
1508
1513
|
}
|
|
1509
|
-
return o.prototype.rpcCall = function a(u,
|
|
1514
|
+
return o.prototype.rpcCall = function a(u, r, n, i, t) {
|
|
1510
1515
|
if (!i)
|
|
1511
1516
|
throw TypeError("request must be specified");
|
|
1512
1517
|
var e = this;
|
|
1513
1518
|
if (!t)
|
|
1514
|
-
return h.asPromise(a, e, u,
|
|
1519
|
+
return h.asPromise(a, e, u, r, n, i);
|
|
1515
1520
|
if (!e.rpcImpl) {
|
|
1516
1521
|
setTimeout(function() {
|
|
1517
1522
|
t(Error("already ended"));
|
|
@@ -1521,7 +1526,7 @@ function requireService() {
|
|
|
1521
1526
|
try {
|
|
1522
1527
|
return e.rpcImpl(
|
|
1523
1528
|
u,
|
|
1524
|
-
|
|
1529
|
+
r[e.requestDelimited ? "encodeDelimited" : "encode"](i).finish(),
|
|
1525
1530
|
function(l, c) {
|
|
1526
1531
|
if (l)
|
|
1527
1532
|
return e.emit("error", l, u), t(l);
|
|
@@ -1532,9 +1537,9 @@ function requireService() {
|
|
|
1532
1537
|
);
|
|
1533
1538
|
return;
|
|
1534
1539
|
}
|
|
1535
|
-
if (!(c instanceof
|
|
1540
|
+
if (!(c instanceof n))
|
|
1536
1541
|
try {
|
|
1537
|
-
c =
|
|
1542
|
+
c = n[e.responseDelimited ? "decodeDelimited" : "decode"](c);
|
|
1538
1543
|
} catch (d) {
|
|
1539
1544
|
return e.emit("error", d, u), t(d);
|
|
1540
1545
|
}
|
|
@@ -1587,12 +1592,12 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1587
1592
|
return a.proto = function() {
|
|
1588
1593
|
const u = {};
|
|
1589
1594
|
return u.SeiData = function() {
|
|
1590
|
-
function n
|
|
1591
|
-
if (
|
|
1595
|
+
function r(n) {
|
|
1596
|
+
if (n) for (let i = Object.keys(n), t = 0; t < i.length; ++t) n[i[t]] != null && (this[i[t]] = n[i[t]]);
|
|
1592
1597
|
}
|
|
1593
|
-
return
|
|
1594
|
-
return new
|
|
1595
|
-
},
|
|
1598
|
+
return r.prototype.event = 0, r.prototype.data = $util.newBuffer([]), r.prototype.compress = !1, r.prototype.version = 0, r.create = function(i) {
|
|
1599
|
+
return new r(i);
|
|
1600
|
+
}, r.encode = function(i, t) {
|
|
1596
1601
|
return t || (t = $Writer.create()), i.event != null && Object.hasOwnProperty.call(i, "event") && t.uint32(
|
|
1597
1602
|
/* id 1, wireType 0 =*/
|
|
1598
1603
|
8
|
|
@@ -1606,9 +1611,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1606
1611
|
/* id 4, wireType 0 =*/
|
|
1607
1612
|
32
|
|
1608
1613
|
).int32(i.version), t;
|
|
1609
|
-
},
|
|
1614
|
+
}, r.encodeDelimited = function(i, t) {
|
|
1610
1615
|
return this.encode(i, t).ldelim();
|
|
1611
|
-
},
|
|
1616
|
+
}, r.decode = function(i, t, e) {
|
|
1612
1617
|
i instanceof $Reader || (i = $Reader.create(i));
|
|
1613
1618
|
let s = t === void 0 ? i.len : i.pos + t, l = new $root.com.quick.voice.proto.SeiData();
|
|
1614
1619
|
for (; i.pos < s; ) {
|
|
@@ -1637,9 +1642,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1637
1642
|
}
|
|
1638
1643
|
}
|
|
1639
1644
|
return l;
|
|
1640
|
-
},
|
|
1645
|
+
}, r.decodeDelimited = function(i) {
|
|
1641
1646
|
return i instanceof $Reader || (i = new $Reader(i)), this.decode(i, i.uint32());
|
|
1642
|
-
},
|
|
1647
|
+
}, r.verify = function(i) {
|
|
1643
1648
|
if (typeof i != "object" || i === null) return "object expected";
|
|
1644
1649
|
if (i.event != null && i.hasOwnProperty("event"))
|
|
1645
1650
|
switch (i.event) {
|
|
@@ -1650,7 +1655,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1650
1655
|
break;
|
|
1651
1656
|
}
|
|
1652
1657
|
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;
|
|
1653
|
-
},
|
|
1658
|
+
}, r.fromObject = function(i) {
|
|
1654
1659
|
if (i instanceof $root.com.quick.voice.proto.SeiData) return i;
|
|
1655
1660
|
let t = new $root.com.quick.voice.proto.SeiData();
|
|
1656
1661
|
switch (i.event) {
|
|
@@ -1670,30 +1675,30 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1670
1675
|
break;
|
|
1671
1676
|
}
|
|
1672
1677
|
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;
|
|
1673
|
-
},
|
|
1678
|
+
}, r.toObject = function(i, t) {
|
|
1674
1679
|
t || (t = {});
|
|
1675
1680
|
let e = {};
|
|
1676
1681
|
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;
|
|
1677
|
-
},
|
|
1682
|
+
}, r.prototype.toJSON = function() {
|
|
1678
1683
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1679
|
-
},
|
|
1684
|
+
}, r.getTypeUrl = function(i) {
|
|
1680
1685
|
return i === void 0 && (i = "type.googleapis.com"), i + "/com.quick.voice.proto.SeiData";
|
|
1681
|
-
},
|
|
1686
|
+
}, r;
|
|
1682
1687
|
}(), u.EventType = function() {
|
|
1683
|
-
const
|
|
1684
|
-
return r[
|
|
1688
|
+
const r = {}, n = Object.create(r);
|
|
1689
|
+
return n[r[0] = "Layout"] = 0, n[r[1] = "Custom"] = 1, n;
|
|
1685
1690
|
}(), u.LayoutData = function() {
|
|
1686
|
-
function
|
|
1691
|
+
function r(i) {
|
|
1687
1692
|
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]]);
|
|
1688
1693
|
}
|
|
1689
|
-
|
|
1690
|
-
let
|
|
1691
|
-
return Object.defineProperty(
|
|
1692
|
-
get: $util.oneOfGetter(
|
|
1693
|
-
set: $util.oneOfSetter(
|
|
1694
|
-
}),
|
|
1695
|
-
return new
|
|
1696
|
-
},
|
|
1694
|
+
r.prototype.roomId = "", r.prototype.type = 0, r.prototype.userMap = $util.emptyObject, r.prototype.globalCustom = null;
|
|
1695
|
+
let n;
|
|
1696
|
+
return Object.defineProperty(r.prototype, "_globalCustom", {
|
|
1697
|
+
get: $util.oneOfGetter(n = ["globalCustom"]),
|
|
1698
|
+
set: $util.oneOfSetter(n)
|
|
1699
|
+
}), r.create = function(t) {
|
|
1700
|
+
return new r(t);
|
|
1701
|
+
}, r.encode = function(t, e) {
|
|
1697
1702
|
if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
|
|
1698
1703
|
/* id 1, wireType 2 =*/
|
|
1699
1704
|
10
|
|
@@ -1716,9 +1721,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1716
1721
|
/* id 4, wireType 2 =*/
|
|
1717
1722
|
34
|
|
1718
1723
|
).fork()).ldelim(), e;
|
|
1719
|
-
},
|
|
1724
|
+
}, r.encodeDelimited = function(t, e) {
|
|
1720
1725
|
return this.encode(t, e).ldelim();
|
|
1721
|
-
},
|
|
1726
|
+
}, r.decode = function(t, e, s) {
|
|
1722
1727
|
t instanceof $Reader || (t = $Reader.create(t));
|
|
1723
1728
|
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.LayoutData(), d, p;
|
|
1724
1729
|
for (; t.pos < l; ) {
|
|
@@ -1763,9 +1768,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1763
1768
|
}
|
|
1764
1769
|
}
|
|
1765
1770
|
return c;
|
|
1766
|
-
},
|
|
1771
|
+
}, r.decodeDelimited = function(t) {
|
|
1767
1772
|
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
1768
|
-
},
|
|
1773
|
+
}, r.verify = function(t) {
|
|
1769
1774
|
if (typeof t != "object" || t === null) return "object expected";
|
|
1770
1775
|
if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
|
|
1771
1776
|
if (t.type != null && t.hasOwnProperty("type"))
|
|
@@ -1790,7 +1795,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1790
1795
|
if (e) return "globalCustom." + e;
|
|
1791
1796
|
}
|
|
1792
1797
|
return null;
|
|
1793
|
-
},
|
|
1798
|
+
}, r.fromObject = function(t) {
|
|
1794
1799
|
if (t instanceof $root.com.quick.voice.proto.LayoutData) return t;
|
|
1795
1800
|
let e = new $root.com.quick.voice.proto.LayoutData();
|
|
1796
1801
|
switch (t.roomId != null && (e.roomId = String(t.roomId)), t.type) {
|
|
@@ -1826,7 +1831,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1826
1831
|
e.globalCustom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.globalCustom);
|
|
1827
1832
|
}
|
|
1828
1833
|
return e;
|
|
1829
|
-
},
|
|
1834
|
+
}, r.toObject = function(t, e) {
|
|
1830
1835
|
e || (e = {});
|
|
1831
1836
|
let s = {};
|
|
1832
1837
|
(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);
|
|
@@ -1836,23 +1841,23 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1836
1841
|
for (let c = 0; c < l.length; ++c) s.userMap[l[c]] = $root.com.quick.voice.proto.UserInfo.toObject(t.userMap[l[c]], e);
|
|
1837
1842
|
}
|
|
1838
1843
|
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;
|
|
1839
|
-
},
|
|
1844
|
+
}, r.prototype.toJSON = function() {
|
|
1840
1845
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1841
|
-
},
|
|
1846
|
+
}, r.getTypeUrl = function(t) {
|
|
1842
1847
|
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.LayoutData";
|
|
1843
|
-
},
|
|
1848
|
+
}, r;
|
|
1844
1849
|
}(), u.UserInfo = function() {
|
|
1845
|
-
function
|
|
1850
|
+
function r(i) {
|
|
1846
1851
|
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]]);
|
|
1847
1852
|
}
|
|
1848
|
-
|
|
1849
|
-
let
|
|
1850
|
-
return Object.defineProperty(
|
|
1851
|
-
get: $util.oneOfGetter(
|
|
1852
|
-
set: $util.oneOfSetter(
|
|
1853
|
-
}),
|
|
1854
|
-
return new
|
|
1855
|
-
},
|
|
1853
|
+
r.prototype.id = "", r.prototype.audios = $util.emptyArray, r.prototype.videos = $util.emptyArray, r.prototype.custom = null;
|
|
1854
|
+
let n;
|
|
1855
|
+
return Object.defineProperty(r.prototype, "_custom", {
|
|
1856
|
+
get: $util.oneOfGetter(n = ["custom"]),
|
|
1857
|
+
set: $util.oneOfSetter(n)
|
|
1858
|
+
}), r.create = function(t) {
|
|
1859
|
+
return new r(t);
|
|
1860
|
+
}, r.encode = function(t, e) {
|
|
1856
1861
|
if (e || (e = $Writer.create()), t.id != null && Object.hasOwnProperty.call(t, "id") && e.uint32(
|
|
1857
1862
|
/* id 1, wireType 2 =*/
|
|
1858
1863
|
10
|
|
@@ -1868,9 +1873,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1868
1873
|
/* id 4, wireType 2 =*/
|
|
1869
1874
|
34
|
|
1870
1875
|
).fork()).ldelim(), e;
|
|
1871
|
-
},
|
|
1876
|
+
}, r.encodeDelimited = function(t, e) {
|
|
1872
1877
|
return this.encode(t, e).ldelim();
|
|
1873
|
-
},
|
|
1878
|
+
}, r.decode = function(t, e, s) {
|
|
1874
1879
|
t instanceof $Reader || (t = $Reader.create(t));
|
|
1875
1880
|
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.UserInfo();
|
|
1876
1881
|
for (; t.pos < l; ) {
|
|
@@ -1899,9 +1904,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1899
1904
|
}
|
|
1900
1905
|
}
|
|
1901
1906
|
return c;
|
|
1902
|
-
},
|
|
1907
|
+
}, r.decodeDelimited = function(t) {
|
|
1903
1908
|
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
1904
|
-
},
|
|
1909
|
+
}, r.verify = function(t) {
|
|
1905
1910
|
if (typeof t != "object" || t === null) return "object expected";
|
|
1906
1911
|
if (t.id != null && t.hasOwnProperty("id") && !$util.isString(t.id)) return "id: string expected";
|
|
1907
1912
|
if (t.audios != null && t.hasOwnProperty("audios")) {
|
|
@@ -1923,7 +1928,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1923
1928
|
if (e) return "custom." + e;
|
|
1924
1929
|
}
|
|
1925
1930
|
return null;
|
|
1926
|
-
},
|
|
1931
|
+
}, r.fromObject = function(t) {
|
|
1927
1932
|
if (t instanceof $root.com.quick.voice.proto.UserInfo) return t;
|
|
1928
1933
|
let e = new $root.com.quick.voice.proto.UserInfo();
|
|
1929
1934
|
if (t.id != null && (e.id = String(t.id)), t.audios) {
|
|
@@ -1947,7 +1952,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1947
1952
|
e.custom = $root.com.quick.voice.proto.CustomInfo.fromObject(t.custom);
|
|
1948
1953
|
}
|
|
1949
1954
|
return e;
|
|
1950
|
-
},
|
|
1955
|
+
}, r.toObject = function(t, e) {
|
|
1951
1956
|
e || (e = {});
|
|
1952
1957
|
let s = {};
|
|
1953
1958
|
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) {
|
|
@@ -1959,23 +1964,23 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1959
1964
|
for (let l = 0; l < t.videos.length; ++l) s.videos[l] = $root.com.quick.voice.proto.VideoInfo.toObject(t.videos[l], e);
|
|
1960
1965
|
}
|
|
1961
1966
|
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;
|
|
1962
|
-
},
|
|
1967
|
+
}, r.prototype.toJSON = function() {
|
|
1963
1968
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
1964
|
-
},
|
|
1969
|
+
}, r.getTypeUrl = function(t) {
|
|
1965
1970
|
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.UserInfo";
|
|
1966
|
-
},
|
|
1971
|
+
}, r;
|
|
1967
1972
|
}(), u.AudioInfo = function() {
|
|
1968
|
-
function
|
|
1973
|
+
function r(i) {
|
|
1969
1974
|
if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
1970
1975
|
}
|
|
1971
|
-
|
|
1972
|
-
let
|
|
1973
|
-
return Object.defineProperty(
|
|
1974
|
-
get: $util.oneOfGetter(
|
|
1975
|
-
set: $util.oneOfSetter(
|
|
1976
|
-
}),
|
|
1977
|
-
return new
|
|
1978
|
-
},
|
|
1976
|
+
r.prototype.type = 0, r.prototype.isEnable = !1, r.prototype.isMute = !1, r.prototype.volume = 0, r.prototype.updateTime = null;
|
|
1977
|
+
let n;
|
|
1978
|
+
return Object.defineProperty(r.prototype, "_updateTime", {
|
|
1979
|
+
get: $util.oneOfGetter(n = ["updateTime"]),
|
|
1980
|
+
set: $util.oneOfSetter(n)
|
|
1981
|
+
}), r.create = function(t) {
|
|
1982
|
+
return new r(t);
|
|
1983
|
+
}, r.encode = function(t, e) {
|
|
1979
1984
|
return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
1980
1985
|
/* id 1, wireType 0 =*/
|
|
1981
1986
|
8
|
|
@@ -1992,9 +1997,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
1992
1997
|
/* id 5, wireType 0 =*/
|
|
1993
1998
|
40
|
|
1994
1999
|
).int64(t.updateTime), e;
|
|
1995
|
-
},
|
|
2000
|
+
}, r.encodeDelimited = function(t, e) {
|
|
1996
2001
|
return this.encode(t, e).ldelim();
|
|
1997
|
-
},
|
|
2002
|
+
}, r.decode = function(t, e, s) {
|
|
1998
2003
|
t instanceof $Reader || (t = $Reader.create(t));
|
|
1999
2004
|
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.AudioInfo();
|
|
2000
2005
|
for (; t.pos < l; ) {
|
|
@@ -2027,9 +2032,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2027
2032
|
}
|
|
2028
2033
|
}
|
|
2029
2034
|
return c;
|
|
2030
|
-
},
|
|
2035
|
+
}, r.decodeDelimited = function(t) {
|
|
2031
2036
|
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2032
|
-
},
|
|
2037
|
+
}, r.verify = function(t) {
|
|
2033
2038
|
if (typeof t != "object" || t === null) return "object expected";
|
|
2034
2039
|
if (t.type != null && t.hasOwnProperty("type"))
|
|
2035
2040
|
switch (t.type) {
|
|
@@ -2040,7 +2045,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2040
2045
|
break;
|
|
2041
2046
|
}
|
|
2042
2047
|
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;
|
|
2043
|
-
},
|
|
2048
|
+
}, r.fromObject = function(t) {
|
|
2044
2049
|
if (t instanceof $root.com.quick.voice.proto.AudioInfo) return t;
|
|
2045
2050
|
let e = new $root.com.quick.voice.proto.AudioInfo();
|
|
2046
2051
|
switch (t.type) {
|
|
@@ -2060,27 +2065,27 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2060
2065
|
break;
|
|
2061
2066
|
}
|
|
2062
2067
|
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;
|
|
2063
|
-
},
|
|
2068
|
+
}, r.toObject = function(t, e) {
|
|
2064
2069
|
e || (e = {});
|
|
2065
2070
|
let s = {};
|
|
2066
2071
|
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;
|
|
2067
|
-
},
|
|
2072
|
+
}, r.prototype.toJSON = function() {
|
|
2068
2073
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
2069
|
-
},
|
|
2074
|
+
}, r.getTypeUrl = function(t) {
|
|
2070
2075
|
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.AudioInfo";
|
|
2071
|
-
},
|
|
2076
|
+
}, r;
|
|
2072
2077
|
}(), u.VideoInfo = function() {
|
|
2073
|
-
function
|
|
2078
|
+
function r(i) {
|
|
2074
2079
|
if (i) for (let t = Object.keys(i), e = 0; e < t.length; ++e) i[t[e]] != null && (this[t[e]] = i[t[e]]);
|
|
2075
2080
|
}
|
|
2076
|
-
|
|
2077
|
-
let
|
|
2078
|
-
return Object.defineProperty(
|
|
2079
|
-
get: $util.oneOfGetter(
|
|
2080
|
-
set: $util.oneOfSetter(
|
|
2081
|
-
}),
|
|
2082
|
-
return new
|
|
2083
|
-
},
|
|
2081
|
+
r.prototype.type = 0, r.prototype.isEnable = !1, r.prototype.isMute = !1, r.prototype.width = 0, r.prototype.height = 0, r.prototype.x = 0, r.prototype.y = 0, r.prototype.updateTime = null;
|
|
2082
|
+
let n;
|
|
2083
|
+
return Object.defineProperty(r.prototype, "_updateTime", {
|
|
2084
|
+
get: $util.oneOfGetter(n = ["updateTime"]),
|
|
2085
|
+
set: $util.oneOfSetter(n)
|
|
2086
|
+
}), r.create = function(t) {
|
|
2087
|
+
return new r(t);
|
|
2088
|
+
}, r.encode = function(t, e) {
|
|
2084
2089
|
return e || (e = $Writer.create()), t.type != null && Object.hasOwnProperty.call(t, "type") && e.uint32(
|
|
2085
2090
|
/* id 1, wireType 0 =*/
|
|
2086
2091
|
8
|
|
@@ -2106,9 +2111,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2106
2111
|
/* id 8, wireType 0 =*/
|
|
2107
2112
|
64
|
|
2108
2113
|
).int64(t.updateTime), e;
|
|
2109
|
-
},
|
|
2114
|
+
}, r.encodeDelimited = function(t, e) {
|
|
2110
2115
|
return this.encode(t, e).ldelim();
|
|
2111
|
-
},
|
|
2116
|
+
}, r.decode = function(t, e, s) {
|
|
2112
2117
|
t instanceof $Reader || (t = $Reader.create(t));
|
|
2113
2118
|
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.VideoInfo();
|
|
2114
2119
|
for (; t.pos < l; ) {
|
|
@@ -2153,9 +2158,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2153
2158
|
}
|
|
2154
2159
|
}
|
|
2155
2160
|
return c;
|
|
2156
|
-
},
|
|
2161
|
+
}, r.decodeDelimited = function(t) {
|
|
2157
2162
|
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2158
|
-
},
|
|
2163
|
+
}, r.verify = function(t) {
|
|
2159
2164
|
if (typeof t != "object" || t === null) return "object expected";
|
|
2160
2165
|
if (t.type != null && t.hasOwnProperty("type"))
|
|
2161
2166
|
switch (t.type) {
|
|
@@ -2166,7 +2171,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2166
2171
|
break;
|
|
2167
2172
|
}
|
|
2168
2173
|
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;
|
|
2169
|
-
},
|
|
2174
|
+
}, r.fromObject = function(t) {
|
|
2170
2175
|
if (t instanceof $root.com.quick.voice.proto.VideoInfo) return t;
|
|
2171
2176
|
let e = new $root.com.quick.voice.proto.VideoInfo();
|
|
2172
2177
|
switch (t.type) {
|
|
@@ -2186,27 +2191,27 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2186
2191
|
break;
|
|
2187
2192
|
}
|
|
2188
2193
|
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;
|
|
2189
|
-
},
|
|
2194
|
+
}, r.toObject = function(t, e) {
|
|
2190
2195
|
e || (e = {});
|
|
2191
2196
|
let s = {};
|
|
2192
2197
|
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;
|
|
2193
|
-
},
|
|
2198
|
+
}, r.prototype.toJSON = function() {
|
|
2194
2199
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
2195
|
-
},
|
|
2200
|
+
}, r.getTypeUrl = function(t) {
|
|
2196
2201
|
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.VideoInfo";
|
|
2197
|
-
},
|
|
2202
|
+
}, r;
|
|
2198
2203
|
}(), u.CustomInfo = function() {
|
|
2199
|
-
function
|
|
2204
|
+
function r(i) {
|
|
2200
2205
|
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]]);
|
|
2201
2206
|
}
|
|
2202
|
-
|
|
2203
|
-
let
|
|
2204
|
-
return Object.defineProperty(
|
|
2205
|
-
get: $util.oneOfGetter(
|
|
2206
|
-
set: $util.oneOfSetter(
|
|
2207
|
-
}),
|
|
2208
|
-
return new
|
|
2209
|
-
},
|
|
2207
|
+
r.prototype.roomId = "", r.prototype.customKeyMap = $util.emptyObject, r.prototype.updateTime = null;
|
|
2208
|
+
let n;
|
|
2209
|
+
return Object.defineProperty(r.prototype, "_updateTime", {
|
|
2210
|
+
get: $util.oneOfGetter(n = ["updateTime"]),
|
|
2211
|
+
set: $util.oneOfSetter(n)
|
|
2212
|
+
}), r.create = function(t) {
|
|
2213
|
+
return new r(t);
|
|
2214
|
+
}, r.encode = function(t, e) {
|
|
2210
2215
|
if (e || (e = $Writer.create()), t.roomId != null && Object.hasOwnProperty.call(t, "roomId") && e.uint32(
|
|
2211
2216
|
/* id 1, wireType 2 =*/
|
|
2212
2217
|
10
|
|
@@ -2224,9 +2229,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2224
2229
|
/* id 3, wireType 0 =*/
|
|
2225
2230
|
24
|
|
2226
2231
|
).int64(t.updateTime), e;
|
|
2227
|
-
},
|
|
2232
|
+
}, r.encodeDelimited = function(t, e) {
|
|
2228
2233
|
return this.encode(t, e).ldelim();
|
|
2229
|
-
},
|
|
2234
|
+
}, r.decode = function(t, e, s) {
|
|
2230
2235
|
t instanceof $Reader || (t = $Reader.create(t));
|
|
2231
2236
|
let l = e === void 0 ? t.len : t.pos + e, c = new $root.com.quick.voice.proto.CustomInfo(), d, p;
|
|
2232
2237
|
for (; t.pos < l; ) {
|
|
@@ -2267,9 +2272,9 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2267
2272
|
}
|
|
2268
2273
|
}
|
|
2269
2274
|
return c;
|
|
2270
|
-
},
|
|
2275
|
+
}, r.decodeDelimited = function(t) {
|
|
2271
2276
|
return t instanceof $Reader || (t = new $Reader(t)), this.decode(t, t.uint32());
|
|
2272
|
-
},
|
|
2277
|
+
}, r.verify = function(t) {
|
|
2273
2278
|
if (typeof t != "object" || t === null) return "object expected";
|
|
2274
2279
|
if (t.roomId != null && t.hasOwnProperty("roomId") && !$util.isString(t.roomId)) return "roomId: string expected";
|
|
2275
2280
|
if (t.customKeyMap != null && t.hasOwnProperty("customKeyMap")) {
|
|
@@ -2278,7 +2283,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2278
2283
|
for (let s = 0; s < e.length; ++s) if (!$util.isString(t.customKeyMap[e[s]])) return "customKeyMap: string{k:string} expected";
|
|
2279
2284
|
}
|
|
2280
2285
|
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;
|
|
2281
|
-
},
|
|
2286
|
+
}, r.fromObject = function(t) {
|
|
2282
2287
|
if (t instanceof $root.com.quick.voice.proto.CustomInfo) return t;
|
|
2283
2288
|
let e = new $root.com.quick.voice.proto.CustomInfo();
|
|
2284
2289
|
if (t.roomId != null && (e.roomId = String(t.roomId)), t.customKeyMap) {
|
|
@@ -2287,7 +2292,7 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2287
2292
|
for (let s = Object.keys(t.customKeyMap), l = 0; l < s.length; ++l) e.customKeyMap[s[l]] = String(t.customKeyMap[s[l]]);
|
|
2288
2293
|
}
|
|
2289
2294
|
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;
|
|
2290
|
-
},
|
|
2295
|
+
}, r.toObject = function(t, e) {
|
|
2291
2296
|
e || (e = {});
|
|
2292
2297
|
let s = {};
|
|
2293
2298
|
(e.objects || e.defaults) && (s.customKeyMap = {}), e.defaults && (s.roomId = ""), t.roomId != null && t.hasOwnProperty("roomId") && (s.roomId = t.roomId);
|
|
@@ -2297,20 +2302,20 @@ const $Reader = minimalExports.Reader, $Writer = minimalExports.Writer, $util =
|
|
|
2297
2302
|
for (let c = 0; c < l.length; ++c) s.customKeyMap[l[c]] = t.customKeyMap[l[c]];
|
|
2298
2303
|
}
|
|
2299
2304
|
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;
|
|
2300
|
-
},
|
|
2305
|
+
}, r.prototype.toJSON = function() {
|
|
2301
2306
|
return this.constructor.toObject(this, minimalExports.util.toJSONOptions);
|
|
2302
|
-
},
|
|
2307
|
+
}, r.getTypeUrl = function(t) {
|
|
2303
2308
|
return t === void 0 && (t = "type.googleapis.com"), t + "/com.quick.voice.proto.CustomInfo";
|
|
2304
|
-
},
|
|
2309
|
+
}, r;
|
|
2305
2310
|
}(), u.LayoutType = function() {
|
|
2306
|
-
const
|
|
2307
|
-
return r[
|
|
2311
|
+
const r = {}, n = Object.create(r);
|
|
2312
|
+
return n[r[0] = "AudioAndVideo"] = 0, n[r[1] = "OnlyAudio"] = 1, n[r[2] = "OnlyVideo"] = 2, n;
|
|
2308
2313
|
}(), u.AudioType = function() {
|
|
2309
|
-
const
|
|
2310
|
-
return r[
|
|
2314
|
+
const r = {}, n = Object.create(r);
|
|
2315
|
+
return n[r[0] = "Microphone"] = 0, n[r[1] = "SystemVoice"] = 1, n;
|
|
2311
2316
|
}(), u.VideoType = function() {
|
|
2312
|
-
const
|
|
2313
|
-
return r[
|
|
2317
|
+
const r = {}, n = Object.create(r);
|
|
2318
|
+
return n[r[0] = "Camera"] = 0, n[r[1] = "Screen"] = 1, n;
|
|
2314
2319
|
}(), u;
|
|
2315
2320
|
}(), a;
|
|
2316
2321
|
}(), o;
|
|
@@ -2349,9 +2354,9 @@ class RoomUser {
|
|
|
2349
2354
|
});
|
|
2350
2355
|
m(this, "init", (o) => {
|
|
2351
2356
|
var t, e, s, l;
|
|
2352
|
-
const { id: a, audios: u = [], videos:
|
|
2357
|
+
const { id: a, audios: u = [], videos: r = [] } = o;
|
|
2353
2358
|
this.userId = a;
|
|
2354
|
-
const
|
|
2359
|
+
const n = this.getUpdateTimeKey();
|
|
2355
2360
|
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);
|
|
2356
2361
|
for (const c of u) {
|
|
2357
2362
|
const { type: d = 0, isEnable: p = !1, isMute: f = !1, updateTime: w, volume: b = 0 } = c;
|
|
@@ -2370,7 +2375,7 @@ class RoomUser {
|
|
|
2370
2375
|
break;
|
|
2371
2376
|
}
|
|
2372
2377
|
}
|
|
2373
|
-
for (const c of
|
|
2378
|
+
for (const c of r) {
|
|
2374
2379
|
const { type: d = 0, isEnable: p, isMute: f, updateTime: w, width: b, height: g, x: k, y: _ } = c;
|
|
2375
2380
|
switch (d) {
|
|
2376
2381
|
case 0:
|
|
@@ -2389,7 +2394,7 @@ class RoomUser {
|
|
|
2389
2394
|
}
|
|
2390
2395
|
(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);
|
|
2391
2396
|
const i = this.getUpdateTimeKey();
|
|
2392
|
-
|
|
2397
|
+
n !== i && (this.updateTime = (/* @__PURE__ */ new Date()).getTime());
|
|
2393
2398
|
});
|
|
2394
2399
|
m(this, "destroy", () => {
|
|
2395
2400
|
var o, a;
|
|
@@ -2400,16 +2405,16 @@ class RoomUser {
|
|
|
2400
2405
|
const parseSEI = (h) => {
|
|
2401
2406
|
let o = 0, a = 0;
|
|
2402
2407
|
for (; ; ) {
|
|
2403
|
-
const
|
|
2404
|
-
if (a = a +
|
|
2408
|
+
const r = h[o];
|
|
2409
|
+
if (a = a + r, o = o + 1, r !== 255) break;
|
|
2405
2410
|
}
|
|
2406
2411
|
let u = 0;
|
|
2407
2412
|
for (; ; ) {
|
|
2408
|
-
const
|
|
2409
|
-
if (u = u +
|
|
2413
|
+
const r = h[o];
|
|
2414
|
+
if (u = u + r, o = o + 1, r !== 255) break;
|
|
2410
2415
|
}
|
|
2411
2416
|
if (a === 5) {
|
|
2412
|
-
const
|
|
2417
|
+
const r = h.slice(o, o + 16), i = Array.from(r, (f) => f.toString(16).padStart(2, "0")).join("");
|
|
2413
2418
|
o = o + 16;
|
|
2414
2419
|
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;
|
|
2415
2420
|
let d;
|
|
@@ -2459,30 +2464,30 @@ class QuickVoPlayer {
|
|
|
2459
2464
|
return Array.from(o, (u) => u.updateTime).join("_");
|
|
2460
2465
|
});
|
|
2461
2466
|
m(this, "checkAndCreateUser", (o, a) => {
|
|
2462
|
-
var u,
|
|
2467
|
+
var u, r;
|
|
2463
2468
|
if (this.usersMap.has(o)) {
|
|
2464
|
-
const
|
|
2465
|
-
if (
|
|
2466
|
-
const { sx: i, sy: t, sw: e, sh: s } =
|
|
2467
|
-
(u =
|
|
2469
|
+
const n = this.usersMap.get(o);
|
|
2470
|
+
if (n == null || n.init(a), n != null && n.mc_video) {
|
|
2471
|
+
const { sx: i, sy: t, sw: e, sh: s } = n.mc_video;
|
|
2472
|
+
(u = n == null ? void 0 : n.mc_video.worker) == null || u.setCut({ sx: i, sy: t, sw: e, sh: s });
|
|
2468
2473
|
}
|
|
2469
|
-
if (
|
|
2470
|
-
const { sx: i, sy: t, sw: e, sh: s } =
|
|
2471
|
-
(
|
|
2474
|
+
if (n != null && n.ss_video) {
|
|
2475
|
+
const { sx: i, sy: t, sw: e, sh: s } = n.ss_video;
|
|
2476
|
+
(r = n == null ? void 0 : n.ss_video.worker) == null || r.setCut({ sx: i, sy: t, sw: e, sh: s });
|
|
2472
2477
|
}
|
|
2473
2478
|
} else {
|
|
2474
|
-
const
|
|
2475
|
-
if (this.usersMap.set(o,
|
|
2476
|
-
if (
|
|
2477
|
-
const { sx: i, sy: t, sw: e, sh: s } =
|
|
2478
|
-
|
|
2479
|
-
p(), this.prPlayer.cut.remove(l), this.usersMap.delete(
|
|
2479
|
+
const n = new RoomUser();
|
|
2480
|
+
if (this.usersMap.set(o, n), n.init(a), n) {
|
|
2481
|
+
if (n.mc_video) {
|
|
2482
|
+
const { sx: i, sy: t, sw: e, sh: s } = n.mc_video, l = `${n.userId}_mc_video`, { worker: c, stream: d, destroy: p } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
|
|
2483
|
+
n.mc_video.worker = c, this.displayMode === "original" && c.setPause(!0), n.mc_video.stream = d, n.mc_video.destroy = () => {
|
|
2484
|
+
p(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
|
|
2480
2485
|
};
|
|
2481
2486
|
}
|
|
2482
|
-
if (
|
|
2483
|
-
const { sx: i, sy: t, sw: e, sh: s } =
|
|
2484
|
-
|
|
2485
|
-
p(), this.prPlayer.cut.remove(l), this.usersMap.delete(
|
|
2487
|
+
if (n.ss_video) {
|
|
2488
|
+
const { sx: i, sy: t, sw: e, sh: s } = n.ss_video, l = `${n.userId}_ss_video`, { worker: c, stream: d, destroy: p } = this.prPlayer.cut.create(l, { sx: i, sy: t, sw: e, sh: s });
|
|
2489
|
+
n.ss_video.worker = c, this.displayMode === "original" && c.setPause(!0), n.ss_video.stream = d, n.ss_video.destroy = () => {
|
|
2490
|
+
p(), this.prPlayer.cut.remove(l), this.usersMap.delete(n.userId);
|
|
2486
2491
|
};
|
|
2487
2492
|
}
|
|
2488
2493
|
}
|
|
@@ -2495,12 +2500,12 @@ class QuickVoPlayer {
|
|
|
2495
2500
|
try {
|
|
2496
2501
|
const a = parseSEI(o);
|
|
2497
2502
|
if (!a) return;
|
|
2498
|
-
const { event: u, data:
|
|
2503
|
+
const { event: u, data: r } = a;
|
|
2499
2504
|
switch (u) {
|
|
2500
2505
|
case 0:
|
|
2501
2506
|
{
|
|
2502
|
-
const { roomId:
|
|
2503
|
-
if (
|
|
2507
|
+
const { roomId: n, userMap: i } = r;
|
|
2508
|
+
if (n !== this.room.roomId) return;
|
|
2504
2509
|
const t = this.getAllUseUpdateKey(), e = Object.keys(i);
|
|
2505
2510
|
{
|
|
2506
2511
|
const l = [...this.usersMap.values()];
|
|
@@ -2520,8 +2525,8 @@ class QuickVoPlayer {
|
|
|
2520
2525
|
break;
|
|
2521
2526
|
case 1:
|
|
2522
2527
|
{
|
|
2523
|
-
const { roomId:
|
|
2524
|
-
this.room.roomId =
|
|
2528
|
+
const { roomId: n, updateTime: i } = r, { author: t, version: e } = r.customKeyMap;
|
|
2529
|
+
this.room.roomId = n, this.room.updateTime = i, this.room.author = t, this.room.version = e;
|
|
2525
2530
|
}
|
|
2526
2531
|
break;
|
|
2527
2532
|
}
|
|
@@ -2530,14 +2535,14 @@ class QuickVoPlayer {
|
|
|
2530
2535
|
}
|
|
2531
2536
|
});
|
|
2532
2537
|
m(this, "setDisplayMode", (o) => {
|
|
2533
|
-
var a, u,
|
|
2538
|
+
var a, u, r, n, i, t, e, s;
|
|
2534
2539
|
switch (this.displayMode = o, o) {
|
|
2535
2540
|
case "original":
|
|
2536
2541
|
{
|
|
2537
2542
|
this.prPlayer.setPause(!1);
|
|
2538
2543
|
const l = [...this.usersMap.values()];
|
|
2539
2544
|
for (const c of l)
|
|
2540
|
-
(u = (a = c.mc_video) == null ? void 0 : a.worker) == null || u.setPause(!0), (
|
|
2545
|
+
(u = (a = c.mc_video) == null ? void 0 : a.worker) == null || u.setPause(!0), (n = (r = c.ss_video) == null ? void 0 : r.worker) == null || n.setPause(!0);
|
|
2541
2546
|
}
|
|
2542
2547
|
break;
|
|
2543
2548
|
case "cut":
|