From 3dcbbcc4161c5f1c991d87ec450cd9f31f6d4e24 Mon Sep 17 00:00:00 2001 From: open-trade Date: Thu, 20 Jan 2022 18:44:28 +0800 Subject: [PATCH] ready to handle video --- src/connection.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/connection.ts b/src/connection.ts index 1e207f6bf..ac3087190 100644 --- a/src/connection.ts +++ b/src/connection.ts @@ -20,6 +20,7 @@ export default class Connection { _hash: message.Hash | undefined; _msgbox: MsgboxCallback | undefined; _peerInfo: message.PeerInfo | undefined; + _firstFrame: Boolean | undefined; constructor() { this._msgs = []; @@ -179,6 +180,8 @@ export default class Connection { this._peerInfo = r.peerInfo; 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 }); } + + handleVideoFrame() { + if (!this._firstFrame) { + this.msgbox('', '', ''); + this._firstFrame = true; + } + } } async function testDelay() {