From 191756ca376a548f9392f0fcb2afc1205d942142 Mon Sep 17 00:00:00 2001 From: Santiago Souto Date: Tue, 22 Oct 2024 14:59:18 -0300 Subject: [PATCH] Revert and emit event on every case Before the emitter was doing it only when event.name.sourceId was null --- packages/millicast-sdk/src/View.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/millicast-sdk/src/View.js b/packages/millicast-sdk/src/View.js index 4ac05498..ae176b29 100644 --- a/packages/millicast-sdk/src/View.js +++ b/packages/millicast-sdk/src/View.js @@ -254,10 +254,8 @@ export default class View extends BaseWebRTC { await webRTCPeerInstance.createRTCPeer(this.options.peerConfig) // Stop emiting events from the previous instances this.stopReemitingWebRTCPeerInstanceEvents?.() - this.stopReemitingSignalingInstanceEvents?.() // And start emitting from the new ones this.stopReemitingWebRTCPeerInstanceEvents = reemit(webRTCPeerInstance, this, Object.values(webRTCEvents).filter(e => e !== webRTCEvents.track)) - this.stopReemitingSignalingInstanceEvents = reemit(signalingInstance, this, [signalingEvents.broadcastEvent]) if (this.options.metadata) { if (!this.worker) { @@ -313,20 +311,19 @@ export default class View extends BaseWebRTC { this.DRMProfile = subscriberData.drmObject } } - this.emit(signalingEvents.broadcastEvent, event) this.isMainStreamActive = true while (this.eventQueue.length > 0) { this.onTrackEvent(this.eventQueue.shift()) } - return + break case 'inactive': this.isMainStreamActive = false break default: break } - this.emit(signalingEvents.broadcastEvent, event) } + this.emit(signalingEvents.broadcastEvent, event) }) const getLocalSDPPromise = webRTCPeerInstance.getRTCLocalSDP({ ...this.options, stereo: true })