From 6a445905a608c3301369ba147926f889b1761658 Mon Sep 17 00:00:00 2001 From: Vincent Song Date: Tue, 22 Oct 2024 16:46:34 +1100 Subject: [PATCH] fix: added default events in signaling service (#462) --- packages/millicast-sdk/src/Signaling.js | 4 +++- packages/millicast-sdk/src/View.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/millicast-sdk/src/Signaling.js b/packages/millicast-sdk/src/Signaling.js index dcfa5fbb..fc86bf94 100644 --- a/packages/millicast-sdk/src/Signaling.js +++ b/packages/millicast-sdk/src/Signaling.js @@ -196,7 +196,9 @@ export default class Signaling extends EventEmitter { // Signaling server only recognizes 'AV1' and not 'AV1X' sdp = SdpParser.adaptCodecName(sdp, 'AV1X', VideoCodec.AV1) - const data = { sdp, streamId: this.streamName, pinnedSourceId: optionsParsed.pinnedSourceId, excludedSourceIds: optionsParsed.excludedSourceIds } + // default events + const events = ['active', 'inative', 'layers', 'viewercount', 'vad', 'updated', 'migrate', 'stopped'] + const data = { sdp, streamId: this.streamName, pinnedSourceId: optionsParsed.pinnedSourceId, excludedSourceIds: optionsParsed.excludedSourceIds, events } if (optionsParsed.vad) { data.vad = true } if (Array.isArray(optionsParsed.events)) { data.events = optionsParsed.events } diff --git a/packages/millicast-sdk/src/View.js b/packages/millicast-sdk/src/View.js index cba118b0..ceb10006 100644 --- a/packages/millicast-sdk/src/View.js +++ b/packages/millicast-sdk/src/View.js @@ -323,8 +323,8 @@ export default class View extends BaseWebRTC { default: break } - this.emit(signalingEvents.broadcastEvent, event) } + this.emit(signalingEvents.broadcastEvent, event) }) const getLocalSDPPromise = webRTCPeerInstance.getRTCLocalSDP({ ...this.options, stereo: true })