ready to handle video

This commit is contained in:
open-trade 2022-01-20 18:44:28 +08:00
parent 7208364785
commit 3dcbbcc416

View File

@ -20,6 +20,7 @@ export default class Connection {
_hash: message.Hash | undefined; _hash: message.Hash | undefined;
_msgbox: MsgboxCallback | undefined; _msgbox: MsgboxCallback | undefined;
_peerInfo: message.PeerInfo | undefined; _peerInfo: message.PeerInfo | undefined;
_firstFrame: Boolean | undefined;
constructor() { constructor() {
this._msgs = []; this._msgs = [];
@ -179,6 +180,8 @@ export default class Connection {
this._peerInfo = r.peerInfo; this._peerInfo = r.peerInfo;
this.msgbox('success', 'Successful', 'Connected, waiting for image...'); this.msgbox('success', 'Successful', 'Connected, waiting for image...');
} }
} else if (msg?.videoFrame) {
this.handleVideoFrame();
} }
} }
} }
@ -222,6 +225,13 @@ export default class Connection {
}); });
await this._ws?.sendMessage({ loginRequest }); await this._ws?.sendMessage({ loginRequest });
} }
handleVideoFrame() {
if (!this._firstFrame) {
this.msgbox('', '', '');
this._firstFrame = true;
}
}
} }
async function testDelay() { async function testDelay() {