diff options
Diffstat (limited to 'packages/meshbay-hub/src')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/transport-media.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js b/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js index ca015b9b..91af0338 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/transport-media.js @@ -254,7 +254,13 @@ extendTransport(class { /** Room for `n` more segments. */ grantStreamCredit(n = 1) { - if (!this._connected) return; + // Only on a session that is up: the player goes on granting as it plays + // from its buffer through a reconnect, and a grant that reached the new + // channel before its handshake was answered "Handshake required", which + // the player showed in place of the film. The stream went with the lost + // session; the reconnect asks for it again (video-player.js + // `reconnectPlan`). The same goes for the diagnostic and the stop below. + if (!this._sessionUp) return; console.log('[stream] grant credit:', n); this._send({ type: 'stream_more', v: '0.1', n }); } @@ -267,7 +273,7 @@ extendTransport(class { * the two halves in one file. The node only logs it. */ sendStreamDiag(diag) { - if (!this._connected) return; + if (!this._sessionUp) return; try { this._send({ type: 'client_diag', v: '0.1', ...diag }); } catch { /* gone */ } } @@ -279,7 +285,7 @@ extendTransport(class { * the next video answered "server busy". */ stopStream() { - if (!this._connected) return; + if (!this._sessionUp) return; try { this._send({ type: 'stream_stop', v: '0.1' }); } catch { /* gone */ } } }); |