Do not aggressively disconnect when video stream goes down (#2621)
This commit is contained in:
@ -147,7 +147,6 @@ export enum ConnectionError {
|
||||
Unset = 0,
|
||||
LongLoadingTime,
|
||||
|
||||
LostVideoStream,
|
||||
ICENegotiate,
|
||||
DataChannelError,
|
||||
WebSocketError,
|
||||
@ -168,8 +167,6 @@ export const CONNECTION_ERROR_TEXT: Record<ConnectionError, string> = {
|
||||
[ConnectionError.Unset]: '',
|
||||
[ConnectionError.LongLoadingTime]:
|
||||
'Loading is taking longer than expected...',
|
||||
[ConnectionError.LostVideoStream]:
|
||||
'Lost connection to video stream... Reconnecting...',
|
||||
[ConnectionError.ICENegotiate]: 'ICE negotiation failed.',
|
||||
[ConnectionError.DataChannelError]: 'The data channel signaled an error.',
|
||||
[ConnectionError.WebSocketError]: 'The websocket signaled an error.',
|
||||
@ -1350,17 +1347,9 @@ export class EngineCommandManager extends EventTarget {
|
||||
console.log('received track', mediaStream)
|
||||
|
||||
mediaStream.getVideoTracks()[0].addEventListener('mute', () => {
|
||||
if (this.engineConnection) {
|
||||
this.engineConnection.state = {
|
||||
type: EngineConnectionStateType.Disconnecting,
|
||||
value: {
|
||||
type: DisconnectingType.Error,
|
||||
value: {
|
||||
error: ConnectionError.LostVideoStream,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
console.error(
|
||||
'video track mute: check webrtc internals -> inbound rtp'
|
||||
)
|
||||
})
|
||||
|
||||
setMediaStream(mediaStream)
|
||||
|
Reference in New Issue
Block a user