|
@@ -214,30 +214,30 @@ export class StreamService {
|
|
|
framePack.setUint32(this.block - 4, steamByteLength);
|
|
|
steamByteLength += currentSlice.byteLength;
|
|
|
// const isLastFrame = framePack.byteLength - this.chunk_size < 0;
|
|
|
- let isPush: boolean;
|
|
|
+
|
|
|
// this.logger.log('statusPack', statusPack);
|
|
|
if (this.channel && this.channel.isOpen()) {
|
|
|
- isPush = this.channel.sendMessageBinary(
|
|
|
+ const isPush = this.channel.sendMessageBinary(
|
|
|
Buffer.from(framePack.buffer),
|
|
|
);
|
|
|
- }
|
|
|
-
|
|
|
- if (i === slices) {
|
|
|
- this.onSteaming.next(false);
|
|
|
- steamByteLength = 0;
|
|
|
- if (isPush) {
|
|
|
- // debugger;
|
|
|
- const stop = performance.now();
|
|
|
- const inMillSeconds = stop - start;
|
|
|
- const rounded = Number(inMillSeconds).toFixed(3);
|
|
|
- this.logger.log(
|
|
|
- `[timer]-当前流:${stream.clipPath}流耗时-->${rounded}ms`,
|
|
|
- );
|
|
|
- return resolve({ frame: stream.frame, done: true });
|
|
|
- } else {
|
|
|
- return resolve({ frame: stream.frame, done: false });
|
|
|
+ if (i === slices) {
|
|
|
+ this.onSteaming.next(false);
|
|
|
+ steamByteLength = 0;
|
|
|
+ if (isPush) {
|
|
|
+ // debugger;
|
|
|
+ const stop = performance.now();
|
|
|
+ const inMillSeconds = stop - start;
|
|
|
+ const rounded = Number(inMillSeconds).toFixed(3);
|
|
|
+ this.logger.log(
|
|
|
+ `[timer]-当前流:${stream.clipPath}流耗时-->${rounded}ms`,
|
|
|
+ );
|
|
|
+ return resolve({ frame: stream.frame, done: true });
|
|
|
+ } else {
|
|
|
+ return resolve({ frame: stream.frame, done: false });
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ } else {
|
|
|
+ return resolve({ frame: stream.frame, done: false });
|
|
|
}
|
|
|
}
|
|
|
// let steamByteLength = 0;
|