From fc952f016b46e8706c00c5fa740217e5d73cf2bf Mon Sep 17 00:00:00 2001 From: amar-1995 Date: Fri, 9 Aug 2024 12:40:20 +0530 Subject: [PATCH] fix: send track update event --- packages/hms-video-store/src/transport/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/hms-video-store/src/transport/index.ts b/packages/hms-video-store/src/transport/index.ts index 0f3338166d..b5c494f562 100644 --- a/packages/hms-video-store/src/transport/index.ts +++ b/packages/hms-video-store/src/transport/index.ts @@ -24,7 +24,7 @@ import { ErrorFactory } from '../error/ErrorFactory'; import { HMSAction } from '../error/HMSAction'; import { HMSException } from '../error/HMSException'; import { EventBus } from '../events/EventBus'; -import { HMSICEServer, HMSRole, HMSUpdateListener } from '../interfaces'; +import { HMSICEServer, HMSRole, HMSTrackUpdate, HMSUpdateListener } from '../interfaces'; import { HMSLocalStream } from '../media/streams/HMSLocalStream'; import { HMSLocalTrack, HMSLocalVideoTrack, HMSTrack } from '../media/tracks'; import { TrackState } from '../notification-manager'; @@ -532,6 +532,14 @@ export default class HMSTransport { this.trackStates.set(originalTrackState.track_id, newTrackState); HMSLogger.d(TAG, 'Track Update', this.trackStates, track); this.signal.trackUpdate(new Map([[originalTrackState.track_id, newTrackState]])); + const peer = this.store.getLocalPeer(); + if (peer) { + this.listener?.onTrackUpdate( + track.enabled ? HMSTrackUpdate.TRACK_UNMUTED : HMSTrackUpdate.TRACK_MUTED, + track, + peer, + ); + } } }