Skip to content

Commit

Permalink
Revert and emit event on every case
Browse files Browse the repository at this point in the history
Before the emitter was doing it only when event.name.sourceId was null
  • Loading branch information
Santiago-Souto committed Oct 22, 2024
1 parent 1868f4c commit 191756c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/millicast-sdk/src/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit 191756c

Please sign in to comment.