From 56023c044f0bfb5a146e1b5bd596a57bb03bfed4 Mon Sep 17 00:00:00 2001 From: raviteja83 Date: Thu, 1 Aug 2024 13:42:56 +0530 Subject: [PATCH] fix: handle plugin failure on migration --- .../hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts index bf0e24be33..017dc52332 100644 --- a/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts +++ b/packages/hms-video-store/src/media/tracks/HMSLocalVideoTrack.ts @@ -12,6 +12,7 @@ import { HMSVideoTrackSettings as IHMSVideoTrackSettings, ScreenCaptureHandle, } from '../../interfaces'; +import { HMSException } from '../../internal'; import { HMSPluginSupportResult, HMSVideoPlugin } from '../../plugins'; import { HMSMediaStreamPlugin, HMSVideoPluginsManager } from '../../plugins/video'; import { HMSMediaStreamPluginsManager } from '../../plugins/video/HMSMediaStreamPluginsManager'; @@ -100,7 +101,9 @@ export class HMSLocalVideoTrack extends HMSVideoTrack { ); if (this.pluginsManager.pluginsMap.size > 0) { this.pluginsManager.pluginsMap.forEach(value => { - track.addPlugin(value); + track + .addPlugin(value) + .catch((e: HMSException) => HMSLogger.e(this.TAG, 'Plugin add failed while migrating', value, e)); }); } if (this.mediaStreamPluginsManager.plugins.size > 0) {