@100mslive/react-native-hms 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -340
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +292 -94
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +127 -127
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +167 -115
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +283 -45
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +7 -7
- package/ios/HMSDecoder.swift +276 -137
- package/ios/HMSHelper.swift +3 -3
- package/ios/HMSManager.m +7 -0
- package/ios/HMSManager.swift +37 -2
- package/ios/HMSRNSDK.swift +339 -97
- package/ios/HMSView.m +2 -0
- package/ios/HMSView.swift +35 -3
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/yogesh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/classes/HMSAudioCodec.js +4 -4
- package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioDevice.js +4 -4
- package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioFilePlayerNode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixingMode.js +4 -4
- package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMode.js +4 -4
- package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioNode.js +2 -1
- package/lib/commonjs/classes/HMSAudioNode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraFacing.js +4 -4
- package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
- package/lib/commonjs/classes/HMSChangeTrackStateRequest.js.map +1 -1
- package/lib/commonjs/classes/HMSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSConstants.js +11 -0
- package/lib/commonjs/classes/HMSConstants.js.map +1 -0
- package/lib/commonjs/classes/HMSEncoder.js +129 -102
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSHelper.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalPeer.js +0 -1
- package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js +0 -2
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLogAlarmManager.js +4 -4
- package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/commonjs/classes/HMSLogLevel.js +4 -4
- package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
- package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSLogger.js +17 -25
- package/lib/commonjs/classes/HMSLogger.js.map +1 -1
- package/lib/commonjs/classes/HMSMessage.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageRecipient.js +1 -1
- package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageRecipientType.js +4 -4
- package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageType.js +4 -4
- package/lib/commonjs/classes/HMSMessageType.js.map +1 -1
- package/lib/commonjs/classes/HMSMicNode.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventEmitter.js +101 -0
- package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -0
- package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/commonjs/classes/HMSPIPListenerActions.js +4 -4
- package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +69 -18
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerUpdate.js +7 -5
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js +229 -0
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -0
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/HMSPublishSettings.js +0 -6
- package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSRTCStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -1
- package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js +0 -1
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRole.js +0 -6
- package/lib/commonjs/classes/HMSRole.js.map +1 -1
- package/lib/commonjs/classes/HMSRoleChangeRequest.js +3 -1
- package/lib/commonjs/classes/HMSRoleChangeRequest.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js +79 -22
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomCache.js +128 -0
- package/lib/commonjs/classes/HMSRoomCache.js.map +1 -0
- package/lib/commonjs/classes/HMSRoomUpdate.js +4 -4
- package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +933 -158
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
- package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSpeaker.js.map +1 -1
- package/lib/commonjs/classes/HMSSubscribeSettings.js +0 -2
- package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js +4 -4
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSource.js +4 -4
- package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackType.js +4 -4
- package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackUpdate.js +4 -4
- package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +5 -5
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoCodec.js +4 -4
- package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoViewMode.js +4 -4
- package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +2 -1
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/classes/HMSAudioCodec.js +3 -3
- package/lib/module/classes/HMSAudioCodec.js.map +1 -1
- package/lib/module/classes/HMSAudioDevice.js +3 -3
- package/lib/module/classes/HMSAudioDevice.js.map +1 -1
- package/lib/module/classes/HMSAudioFilePlayerNode.js.map +1 -1
- package/lib/module/classes/HMSAudioMixerSource.js.map +1 -1
- package/lib/module/classes/HMSAudioMixingMode.js +3 -3
- package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/module/classes/HMSAudioMode.js +3 -3
- package/lib/module/classes/HMSAudioMode.js.map +1 -1
- package/lib/module/classes/HMSAudioNode.js +2 -1
- package/lib/module/classes/HMSAudioNode.js.map +1 -1
- package/lib/module/classes/HMSAudioSettings.js.map +1 -1
- package/lib/module/classes/HMSAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/module/classes/HMSCameraFacing.js +3 -3
- package/lib/module/classes/HMSCameraFacing.js.map +1 -1
- package/lib/module/classes/HMSChangeTrackStateRequest.js.map +1 -1
- package/lib/module/classes/HMSConfig.js.map +1 -1
- package/lib/module/classes/HMSConstants.js +4 -0
- package/lib/module/classes/HMSConstants.js.map +1 -0
- package/lib/module/classes/HMSEncoder.js +129 -102
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSException.js.map +1 -1
- package/lib/module/classes/HMSHLSConfig.js.map +1 -1
- package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -1
- package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -1
- package/lib/module/classes/HMSHLSRecordingState.js.map +1 -1
- package/lib/module/classes/HMSHLSStreamingState.js.map +1 -1
- package/lib/module/classes/HMSHLSVariant.js.map +1 -1
- package/lib/module/classes/HMSHelper.js.map +1 -1
- package/lib/module/classes/HMSLocalAudioStats.js.map +1 -1
- package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSLocalPeer.js +0 -1
- package/lib/module/classes/HMSLocalPeer.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoTrack.js +0 -2
- package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSLogAlarmManager.js +3 -3
- package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/module/classes/HMSLogLevel.js +3 -3
- package/lib/module/classes/HMSLogLevel.js.map +1 -1
- package/lib/module/classes/HMSLogSettings.js.map +1 -1
- package/lib/module/classes/HMSLogger.js +17 -25
- package/lib/module/classes/HMSLogger.js.map +1 -1
- package/lib/module/classes/HMSMessage.js.map +1 -1
- package/lib/module/classes/HMSMessageRecipient.js +1 -1
- package/lib/module/classes/HMSMessageRecipient.js.map +1 -1
- package/lib/module/classes/HMSMessageRecipientType.js +3 -3
- package/lib/module/classes/HMSMessageRecipientType.js.map +1 -1
- package/lib/module/classes/HMSMessageType.js +3 -3
- package/lib/module/classes/HMSMessageType.js.map +1 -1
- package/lib/module/classes/HMSMicNode.js.map +1 -1
- package/lib/module/classes/HMSNativeEventEmitter.js +94 -0
- package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -0
- package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/module/classes/HMSPIPListenerActions.js +3 -3
- package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +69 -18
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerUpdate.js +4 -3
- package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/module/classes/HMSPeersCache.js +216 -0
- package/lib/module/classes/HMSPeersCache.js.map +1 -0
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/HMSPublishSettings.js +0 -6
- package/lib/module/classes/HMSPublishSettings.js.map +1 -1
- package/lib/module/classes/HMSRTCStats.js.map +1 -1
- package/lib/module/classes/HMSRTCStatsReport.js.map +1 -1
- package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSRemotePeer.js +0 -1
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSRole.js +0 -6
- package/lib/module/classes/HMSRole.js.map +1 -1
- package/lib/module/classes/HMSRoleChangeRequest.js +3 -1
- package/lib/module/classes/HMSRoleChangeRequest.js.map +1 -1
- package/lib/module/classes/HMSRoom.js +79 -22
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSRoomCache.js +115 -0
- package/lib/module/classes/HMSRoomCache.js.map +1 -0
- package/lib/module/classes/HMSRoomUpdate.js +3 -3
- package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +934 -159
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
- package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/module/classes/HMSSimulcastLayerSettings.js.map +1 -1
- package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/module/classes/HMSSpeaker.js.map +1 -1
- package/lib/module/classes/HMSSubscribeSettings.js +0 -2
- package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/module/classes/HMSTrack.js.map +1 -1
- package/lib/module/classes/HMSTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSTrackSettingsInitState.js +3 -3
- package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/module/classes/HMSTrackSource.js +3 -3
- package/lib/module/classes/HMSTrackSource.js.map +1 -1
- package/lib/module/classes/HMSTrackType.js +3 -3
- package/lib/module/classes/HMSTrackType.js.map +1 -1
- package/lib/module/classes/HMSTrackUpdate.js +3 -3
- package/lib/module/classes/HMSTrackUpdate.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +4 -4
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HMSVideoCodec.js +3 -3
- package/lib/module/classes/HMSVideoCodec.js.map +1 -1
- package/lib/module/classes/HMSVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSVideoSettings.js.map +1 -1
- package/lib/module/classes/HMSVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSVideoViewMode.js +3 -3
- package/lib/module/classes/HMSVideoViewMode.js.map +1 -1
- package/lib/module/classes/HmsView.js +2 -1
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +4 -4
- package/lib/typescript/classes/HMSChangeTrackStateRequest.d.ts +2 -2
- package/lib/typescript/classes/HMSConstants.d.ts +3 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +10 -6
- package/lib/typescript/classes/HMSHLSStreamingState.d.ts +2 -2
- package/lib/typescript/classes/HMSLocalPeer.d.ts +0 -14
- package/lib/typescript/classes/HMSLocalVideoTrack.d.ts +0 -2
- package/lib/typescript/classes/HMSLogger.d.ts +1 -7
- package/lib/typescript/classes/HMSMessageRecipient.d.ts +2 -2
- package/lib/typescript/classes/HMSNativeEventEmitter.d.ts +13 -0
- package/lib/typescript/classes/HMSPeer.d.ts +12 -18
- package/lib/typescript/classes/HMSPeerUpdate.d.ts +1 -0
- package/lib/typescript/classes/HMSPeersCache.d.ts +17 -0
- package/lib/typescript/classes/HMSPublishSettings.d.ts +8 -15
- package/lib/typescript/classes/HMSRemotePeer.d.ts +0 -14
- package/lib/typescript/classes/HMSRole.d.ts +0 -6
- package/lib/typescript/classes/HMSRoleChangeRequest.d.ts +2 -2
- package/lib/typescript/classes/HMSRoom.d.ts +11 -22
- package/lib/typescript/classes/HMSRoomCache.d.ts +16 -0
- package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +4 -4
- package/lib/typescript/classes/HMSSDK.d.ts +3 -13
- package/lib/typescript/classes/HMSServerRecordingState.d.ts +2 -2
- package/lib/typescript/classes/HMSSubscribeSettings.d.ts +0 -2
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/package.json +5 -4
- package/react-native-hms.podspec +1 -1
- package/sdk-versions.json +3 -2
- package/src/classes/HMSAudioNode.ts +3 -1
- package/src/classes/HMSBrowserRecordingState.ts +4 -4
- package/src/classes/HMSChangeTrackStateRequest.ts +2 -2
- package/src/classes/HMSConstants.ts +3 -0
- package/src/classes/HMSEncoder.ts +162 -120
- package/src/classes/HMSHLSStreamingState.ts +2 -2
- package/src/classes/HMSLocalPeer.ts +0 -15
- package/src/classes/HMSLocalVideoTrack.ts +0 -2
- package/src/classes/HMSLogger.ts +20 -19
- package/src/classes/HMSMessageRecipient.ts +3 -3
- package/src/classes/HMSNativeEventEmitter.ts +109 -0
- package/src/classes/HMSPeer.ts +135 -32
- package/src/classes/HMSPeerUpdate.ts +9 -0
- package/src/classes/HMSPeersCache.ts +252 -0
- package/src/classes/HMSPublishSettings.ts +8 -18
- package/src/classes/HMSRemotePeer.ts +0 -16
- package/src/classes/HMSRole.ts +0 -9
- package/src/classes/HMSRoleChangeRequest.ts +5 -3
- package/src/classes/HMSRoom.ts +141 -37
- package/src/classes/HMSRoomCache.ts +157 -0
- package/src/classes/HMSRtmpStreamingState.ts +4 -4
- package/src/classes/HMSSDK.tsx +685 -292
- package/src/classes/HMSServerRecordingState.ts +2 -2
- package/src/classes/HMSSubscribeSettings.ts +1 -7
- package/src/classes/HMSUpdateListenerActions.ts +1 -1
- package/src/classes/HmsView.tsx +2 -1
- package/src/index.ts +1 -0
|
@@ -2,7 +2,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { AppState,
|
|
5
|
+
import { AppState, NativeModules, Platform } from 'react-native';
|
|
6
6
|
import { HMSEncoder } from './HMSEncoder';
|
|
7
7
|
import { HMSHelper } from './HMSHelper';
|
|
8
8
|
import { HMSLocalAudioStats } from './HMSLocalAudioStats';
|
|
@@ -15,6 +15,10 @@ import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
|
15
15
|
import { HmsViewComponent } from './HmsView';
|
|
16
16
|
import { HMSMessageType } from './HMSMessageType';
|
|
17
17
|
import { HMSPIPListenerActions } from './HMSPIPListenerActions';
|
|
18
|
+
import { HMSNativeEventEmitter } from './HMSNativeEventEmitter';
|
|
19
|
+
import { clearHmsPeersCache, getHmsPeersCache, HMSPeersCache, setHmsPeersCache } from './HMSPeersCache';
|
|
20
|
+
import { clearHmsRoomCache, getHmsRoomCache, HMSRoomCache, setHmsRoomCache } from './HMSRoomCache';
|
|
21
|
+
import { HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
|
|
18
22
|
const {
|
|
19
23
|
/**
|
|
20
24
|
* @ignore
|
|
@@ -22,7 +26,7 @@ const {
|
|
|
22
26
|
HMSManager
|
|
23
27
|
} = NativeModules;
|
|
24
28
|
const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersion');
|
|
25
|
-
const HmsEventEmitter = new
|
|
29
|
+
const HmsEventEmitter = new HMSNativeEventEmitter(HMSManager);
|
|
26
30
|
let HmsSdk;
|
|
27
31
|
export class HMSSDK {
|
|
28
32
|
constructor(id) {
|
|
@@ -50,77 +54,62 @@ export class HMSSDK {
|
|
|
50
54
|
_defineProperty(this, "onRemoteVideoStatsDelegate", void 0);
|
|
51
55
|
_defineProperty(this, "onAudioDeviceChangedDelegate", void 0);
|
|
52
56
|
_defineProperty(this, "onPIPRoomLeaveDelegate", void 0);
|
|
57
|
+
_defineProperty(this, "emitterSubscriptions", {});
|
|
58
|
+
/**
|
|
59
|
+
* - Updates the logger for this instance of HMSSDK
|
|
60
|
+
* @param {HMSLogger} hmsLogger
|
|
61
|
+
* @memberof HMSSDK
|
|
62
|
+
*/
|
|
53
63
|
_defineProperty(this, "setLogger", hmsLogger => {
|
|
54
64
|
setLogger(this.id, hmsLogger);
|
|
55
65
|
});
|
|
66
|
+
/**
|
|
67
|
+
* - Calls removeListeners that in turn breaks all connections with native listeners.
|
|
68
|
+
*
|
|
69
|
+
* @memberof HMSSDK
|
|
70
|
+
*/
|
|
56
71
|
_defineProperty(this, "destroy", async () => {
|
|
57
72
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function destroy', {
|
|
58
73
|
id: this.id
|
|
59
74
|
});
|
|
60
|
-
|
|
75
|
+
clearHmsPeersCache();
|
|
76
|
+
clearHmsRoomCache();
|
|
77
|
+
this.removeAllListeners();
|
|
61
78
|
return await HMSManager.destroy({
|
|
62
79
|
id: this.id
|
|
63
80
|
});
|
|
64
81
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.RECONNECTING, this.reconnectingListener);
|
|
75
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.RECONNECTED, this.reconnectedListener);
|
|
76
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST, this.onRoleChangeRequestListener);
|
|
77
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST, this.onChangeTrackStateRequestListener);
|
|
78
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, this.onRemovedFromRoomListener);
|
|
79
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_RTC_STATS, this.RTCStatsListener);
|
|
80
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS, this.onLocalAudioStatsListener);
|
|
81
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
|
|
82
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
|
|
83
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
|
|
84
|
-
HmsEventEmitter.addListener(HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
|
|
85
|
-
if (Platform.OS === 'android') {
|
|
86
|
-
HmsEventEmitter.addListener(HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, this.onPIPRoomLeaveListener);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
_defineProperty(this, "removeListeners", () => {
|
|
90
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_JOIN, this.onJoinListener);
|
|
91
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_PREVIEW, this.onPreviewListener);
|
|
92
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_ROOM_UPDATE, this.onRoomListener);
|
|
93
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_PEER_UPDATE, this.onPeerListener);
|
|
94
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_TRACK_UPDATE, this.onTrackListener);
|
|
95
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_ERROR, this.onErrorListener);
|
|
96
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_MESSAGE, this.onMessageListener);
|
|
97
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_SPEAKER, this.onSpeakerListener);
|
|
98
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.RECONNECTING, this.reconnectingListener);
|
|
99
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.RECONNECTED, this.reconnectedListener);
|
|
100
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST, this.onRoleChangeRequestListener);
|
|
101
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST, this.onChangeTrackStateRequestListener);
|
|
102
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, this.onRemovedFromRoomListener);
|
|
103
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_RTC_STATS, this.RTCStatsListener);
|
|
104
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS, this.onLocalAudioStatsListener);
|
|
105
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
|
|
106
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
|
|
107
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
|
|
108
|
-
HmsEventEmitter.removeListener(HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
|
|
109
|
-
if (Platform.OS === 'android') {
|
|
110
|
-
HmsEventEmitter.removeListener(HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, this.onPIPRoomLeaveListener);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
82
|
+
/**
|
|
83
|
+
* takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
|
|
84
|
+
* after joining the room user will start receiving the events and updates of the room.
|
|
85
|
+
*
|
|
86
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/join} for more info
|
|
87
|
+
*
|
|
88
|
+
* @param {HMSConfig} config
|
|
89
|
+
* @memberof HMSSDK
|
|
90
|
+
*/
|
|
113
91
|
_defineProperty(this, "join", async config => {
|
|
114
92
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function join', {
|
|
115
93
|
config,
|
|
116
94
|
id: this.id
|
|
117
95
|
});
|
|
118
96
|
this.addAppStateListener();
|
|
97
|
+
setHmsPeersCache(new HMSPeersCache(this.id));
|
|
98
|
+
setHmsRoomCache(new HMSRoomCache(this.id));
|
|
119
99
|
await HMSManager.join({
|
|
120
100
|
...config,
|
|
121
101
|
id: this.id
|
|
122
102
|
});
|
|
123
103
|
});
|
|
104
|
+
/**
|
|
105
|
+
* - preview function is used to initiate a preview for the localPeer.
|
|
106
|
+
* - We can call this function and wait for a response in previewListener, the response will contain previewTracks for local peer.
|
|
107
|
+
*
|
|
108
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/preview} for more info
|
|
109
|
+
*
|
|
110
|
+
* @param {HMSConfig} config
|
|
111
|
+
* @memberof HMSSDK
|
|
112
|
+
*/
|
|
124
113
|
_defineProperty(this, "preview", config => {
|
|
125
114
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function preview', {
|
|
126
115
|
config,
|
|
@@ -131,6 +120,17 @@ export class HMSSDK {
|
|
|
131
120
|
id: this.id
|
|
132
121
|
});
|
|
133
122
|
});
|
|
123
|
+
/**
|
|
124
|
+
* - previewForRole can be used when there is role change request for current localPeer and we want
|
|
125
|
+
* to show the localPeer how the tracks look before publishing them to room.
|
|
126
|
+
*
|
|
127
|
+
* - It requires a role of type [HMSRole]{@link HMSRole} for which we want to preview the tracks.
|
|
128
|
+
*
|
|
129
|
+
* checkout {@link https://www.100ms.live/docs/react-native} for more info
|
|
130
|
+
*
|
|
131
|
+
* @param {HMSRole}
|
|
132
|
+
* @memberof HMSSDK
|
|
133
|
+
*/
|
|
134
134
|
_defineProperty(this, "previewForRole", async role => {
|
|
135
135
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function previewForRole', {
|
|
136
136
|
role,
|
|
@@ -146,6 +146,17 @@ export class HMSSDK {
|
|
|
146
146
|
return 'API currently not available for android';
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
|
+
/**
|
|
150
|
+
* - HmsView is react component that takes trackId and starts showing that track on a tile.
|
|
151
|
+
* - The appearance of tile is completely customizable with style prop.
|
|
152
|
+
* - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
|
|
153
|
+
* - Mirror to flip the video vertically.
|
|
154
|
+
*
|
|
155
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
|
|
156
|
+
*
|
|
157
|
+
* @param {HmsViewProps}
|
|
158
|
+
* @memberof HMSSDK
|
|
159
|
+
*/
|
|
149
160
|
_defineProperty(this, "HmsView", /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
150
161
|
const {
|
|
151
162
|
trackId,
|
|
@@ -164,8 +175,22 @@ export class HMSSDK {
|
|
|
164
175
|
id: this.id
|
|
165
176
|
});
|
|
166
177
|
}));
|
|
167
|
-
_defineProperty(this, "
|
|
178
|
+
_defineProperty(this, "roomLeaveCleanup", () => {
|
|
168
179
|
var _this$appStateSubscri;
|
|
180
|
+
this.muteStatus = undefined;
|
|
181
|
+
this === null || this === void 0 ? void 0 : (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 ? void 0 : _this$appStateSubscri.remove();
|
|
182
|
+
clearHmsPeersCache();
|
|
183
|
+
clearHmsRoomCache();
|
|
184
|
+
HMSEncoder.clearData(); // Clearing cached data in encoder
|
|
185
|
+
});
|
|
186
|
+
/**
|
|
187
|
+
* Calls leave function of native sdk and session of current user is invalidated.
|
|
188
|
+
*
|
|
189
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/leave} for more info
|
|
190
|
+
*
|
|
191
|
+
* @memberof HMSSDK
|
|
192
|
+
*/
|
|
193
|
+
_defineProperty(this, "leave", async () => {
|
|
169
194
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function leave', {
|
|
170
195
|
id: this.id
|
|
171
196
|
});
|
|
@@ -173,10 +198,17 @@ export class HMSSDK {
|
|
|
173
198
|
id: this.id
|
|
174
199
|
};
|
|
175
200
|
const op = await HMSManager.leave(data);
|
|
176
|
-
this.
|
|
177
|
-
this === null || this === void 0 ? void 0 : (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 ? void 0 : _this$appStateSubscri.remove();
|
|
201
|
+
this.roomLeaveCleanup();
|
|
178
202
|
return op;
|
|
179
203
|
});
|
|
204
|
+
/**
|
|
205
|
+
* - This function sends message to all the peers in the room, the get the message in onMessage listener.
|
|
206
|
+
*
|
|
207
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
|
|
208
|
+
*
|
|
209
|
+
* @param {message: string} and @param {type: string}
|
|
210
|
+
* @memberof HMSSDK
|
|
211
|
+
*/
|
|
180
212
|
_defineProperty(this, "sendBroadcastMessage", async function (message) {
|
|
181
213
|
let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : HMSMessageType.CHAT;
|
|
182
214
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function sendBroadcastMessage', {
|
|
@@ -190,6 +222,14 @@ export class HMSSDK {
|
|
|
190
222
|
id: _this.id
|
|
191
223
|
});
|
|
192
224
|
});
|
|
225
|
+
/**
|
|
226
|
+
* - sendGroupMessage sends a message to specific set of roles, whoever has any of those role in room
|
|
227
|
+
* will get the message in onMessage listener.
|
|
228
|
+
*
|
|
229
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
|
|
230
|
+
*
|
|
231
|
+
* @memberof HMSSDK
|
|
232
|
+
*/
|
|
193
233
|
_defineProperty(this, "sendGroupMessage", async function (message, roles) {
|
|
194
234
|
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : HMSMessageType.CHAT;
|
|
195
235
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function sendGroupMessage', {
|
|
@@ -205,6 +245,14 @@ export class HMSSDK {
|
|
|
205
245
|
type: type || null
|
|
206
246
|
});
|
|
207
247
|
});
|
|
248
|
+
/**
|
|
249
|
+
* - sendDirectMessage sends a private message to a single peer, only that peer will get the message
|
|
250
|
+
* in onMessage Listener.
|
|
251
|
+
*
|
|
252
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
|
|
253
|
+
*
|
|
254
|
+
* @memberof HMSSDK
|
|
255
|
+
*/
|
|
208
256
|
_defineProperty(this, "sendDirectMessage", async function (message, peer) {
|
|
209
257
|
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : HMSMessageType.CHAT;
|
|
210
258
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function sendDirectMessage', {
|
|
@@ -220,6 +268,18 @@ export class HMSSDK {
|
|
|
220
268
|
type: type || null
|
|
221
269
|
});
|
|
222
270
|
});
|
|
271
|
+
/**
|
|
272
|
+
* - changeMetadata changes a specific field in localPeer which is [metadata] it is a string that can
|
|
273
|
+
* be used for various functionalities like raiseHand, beRightBack and many more that explains the
|
|
274
|
+
* current status of the peer.
|
|
275
|
+
*
|
|
276
|
+
* - it is advised to use a json object in string format to store multiple dataPoints in metadata.
|
|
277
|
+
*
|
|
278
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata} for more info
|
|
279
|
+
*
|
|
280
|
+
* @param {string}
|
|
281
|
+
* @memberof HMSSDK
|
|
282
|
+
*/
|
|
223
283
|
_defineProperty(this, "changeMetadata", async metadata => {
|
|
224
284
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeMetadata', {
|
|
225
285
|
metadata,
|
|
@@ -230,6 +290,15 @@ export class HMSSDK {
|
|
|
230
290
|
id: this.id
|
|
231
291
|
});
|
|
232
292
|
});
|
|
293
|
+
/**
|
|
294
|
+
* - startRTMPOrRecording takes a configuration object {@link HMSRTMPConfig} and stats the RTMP recording
|
|
295
|
+
* - this object of {@link HMSRTMPConfig} sets the urls for streaming and weather to set recording on or not
|
|
296
|
+
* - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
|
|
297
|
+
*
|
|
298
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
|
|
299
|
+
*
|
|
300
|
+
* @memberof HMSSDK
|
|
301
|
+
*/
|
|
233
302
|
_defineProperty(this, "startRTMPOrRecording", async data => {
|
|
234
303
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startRTMPOrRecording', {
|
|
235
304
|
...data,
|
|
@@ -241,6 +310,14 @@ export class HMSSDK {
|
|
|
241
310
|
});
|
|
242
311
|
return op;
|
|
243
312
|
});
|
|
313
|
+
/**
|
|
314
|
+
* - this function stops all the ongoing RTMP streaming and recording.
|
|
315
|
+
* - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
|
|
316
|
+
*
|
|
317
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
|
|
318
|
+
*
|
|
319
|
+
* @memberof HMSSDK
|
|
320
|
+
*/
|
|
244
321
|
_defineProperty(this, "stopRtmpAndRecording", async () => {
|
|
245
322
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopRtmpAndRecording', {});
|
|
246
323
|
const op = await HMSManager.stopRtmpAndRecording({
|
|
@@ -248,6 +325,15 @@ export class HMSSDK {
|
|
|
248
325
|
});
|
|
249
326
|
return op;
|
|
250
327
|
});
|
|
328
|
+
/**
|
|
329
|
+
* - This function starts HLSStreaming.
|
|
330
|
+
* - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
|
|
331
|
+
*
|
|
332
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
|
|
333
|
+
*
|
|
334
|
+
* @param {HMSHLSConfig}
|
|
335
|
+
* @memberof HMSSDK
|
|
336
|
+
*/
|
|
251
337
|
_defineProperty(this, "startHLSStreaming", async data => {
|
|
252
338
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startHLSStreaming', {
|
|
253
339
|
...data,
|
|
@@ -258,12 +344,36 @@ export class HMSSDK {
|
|
|
258
344
|
id: this.id
|
|
259
345
|
});
|
|
260
346
|
});
|
|
347
|
+
/**
|
|
348
|
+
* - stopHLSStreaming function stops the ongoing HLSStreams.
|
|
349
|
+
* - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
|
|
350
|
+
*
|
|
351
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
|
|
352
|
+
*
|
|
353
|
+
* @memberof HMSSDK
|
|
354
|
+
*/
|
|
261
355
|
_defineProperty(this, "stopHLSStreaming", async () => {
|
|
262
356
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopHLSStreaming', {});
|
|
263
357
|
return await HMSManager.stopHLSStreaming({
|
|
264
358
|
id: this.id
|
|
265
359
|
});
|
|
266
360
|
});
|
|
361
|
+
/**
|
|
362
|
+
* @deprecated This function has been deprecated in favor of #Function changeRoleOfPeer
|
|
363
|
+
*
|
|
364
|
+
* - This function can be used in a situation when we want to change role hence manipulate their
|
|
365
|
+
* access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
|
|
366
|
+
* role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
|
|
367
|
+
* the role or ask the to accept the role change request using a boolean force.
|
|
368
|
+
*
|
|
369
|
+
* - if we change the role forcefully the peer's role will be updated without asking the peer
|
|
370
|
+
* otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
|
|
371
|
+
* for more information on this checkout {@link onRoleChangeRequestListener}
|
|
372
|
+
*
|
|
373
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
374
|
+
*
|
|
375
|
+
* @memberof HMSSDK
|
|
376
|
+
*/
|
|
267
377
|
_defineProperty(this, "changeRole", async function (peer, role) {
|
|
268
378
|
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
269
379
|
const data = {
|
|
@@ -275,6 +385,20 @@ export class HMSSDK {
|
|
|
275
385
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeRole', data);
|
|
276
386
|
return await HMSManager.changeRole(data);
|
|
277
387
|
});
|
|
388
|
+
/**
|
|
389
|
+
* - This function can be used in a situation when we want to change role hence manipulate their
|
|
390
|
+
* access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
|
|
391
|
+
* role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
|
|
392
|
+
* the role or ask the to accept the role change request using a boolean force.
|
|
393
|
+
*
|
|
394
|
+
* - if we change the role forcefully the peer's role will be updated without asking the peer
|
|
395
|
+
* otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
|
|
396
|
+
* for more information on this checkout {@link onRoleChangeRequestListener}
|
|
397
|
+
*
|
|
398
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
399
|
+
*
|
|
400
|
+
* @memberof HMSSDK
|
|
401
|
+
*/
|
|
278
402
|
_defineProperty(this, "changeRoleOfPeer", async function (peer, role) {
|
|
279
403
|
let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
280
404
|
const data = {
|
|
@@ -286,6 +410,19 @@ export class HMSSDK {
|
|
|
286
410
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeRoleOfPeer', data);
|
|
287
411
|
return HMSManager.changeRoleOfPeer(data);
|
|
288
412
|
});
|
|
413
|
+
/**
|
|
414
|
+
* - This function can be used in a situation when we want to change role of multiple peers by specifying their roles.
|
|
415
|
+
* Hence manipulate their access and rights in the current room.
|
|
416
|
+
* It takes the list of roles {@link HMSRole} whom role we want to change
|
|
417
|
+
* and role {@link HMSRole} which will be the new role for peers.
|
|
418
|
+
*
|
|
419
|
+
* - Note that role will be updated without asking the peers.
|
|
420
|
+
* Meaning, Peers will not get the roleChangeRequest in roleChangeRequest listener.
|
|
421
|
+
*
|
|
422
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
423
|
+
*
|
|
424
|
+
* @memberof HMSSDK
|
|
425
|
+
*/
|
|
289
426
|
_defineProperty(this, "changeRoleOfPeersWithRoles", async (ofRoles, toRole) => {
|
|
290
427
|
const data = {
|
|
291
428
|
ofRoles: ofRoles.map(ofRole => ofRole.name).filter(Boolean),
|
|
@@ -295,6 +432,15 @@ export class HMSSDK {
|
|
|
295
432
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeRoleOfPeersWithRoles', data);
|
|
296
433
|
return HMSManager.changeRoleOfPeersWithRoles(data);
|
|
297
434
|
});
|
|
435
|
+
/**
|
|
436
|
+
* - This function can be used to manipulate mute status of any track.
|
|
437
|
+
* - Targeted peer affected by this action will get a callback in onChangeTrackStateRequestListener.
|
|
438
|
+
*
|
|
439
|
+
* * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
|
|
440
|
+
*
|
|
441
|
+
* @param {HMSTrack}
|
|
442
|
+
* @memberof HMSSDK
|
|
443
|
+
*/
|
|
298
444
|
_defineProperty(this, "changeTrackState", async (track, mute) => {
|
|
299
445
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeTrackState', {
|
|
300
446
|
track,
|
|
@@ -308,6 +454,14 @@ export class HMSSDK {
|
|
|
308
454
|
};
|
|
309
455
|
return await HMSManager.changeTrackState(data);
|
|
310
456
|
});
|
|
457
|
+
/**
|
|
458
|
+
* - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
|
|
459
|
+
* - We can change mute status for all the tracks of peers having a particular role.
|
|
460
|
+
* - @param source determines the source of the track ex. video, audio etc.
|
|
461
|
+
* - The peers affected by this action will get a callback in onChangeTrackStateRequestListener.
|
|
462
|
+
*
|
|
463
|
+
* @memberof HMSSDK
|
|
464
|
+
*/
|
|
311
465
|
_defineProperty(this, "changeTrackStateForRoles", async (mute, type, source, roles) => {
|
|
312
466
|
let roleNames = null;
|
|
313
467
|
if (roles) {
|
|
@@ -329,6 +483,14 @@ export class HMSSDK {
|
|
|
329
483
|
};
|
|
330
484
|
return await HMSManager.changeTrackStateForRoles(data);
|
|
331
485
|
});
|
|
486
|
+
/**
|
|
487
|
+
* - removePeer can forcefully disconnect a Peer from the room.
|
|
488
|
+
* - the user who's removed from this action will get a callback in {@link onRemovedFromRoomListener}.
|
|
489
|
+
*
|
|
490
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/remove-peer} for more info
|
|
491
|
+
*
|
|
492
|
+
* @memberof HMSSDK
|
|
493
|
+
*/
|
|
332
494
|
_defineProperty(this, "removePeer", async (peer, reason) => {
|
|
333
495
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function removePeer', {
|
|
334
496
|
peerId: peer.peerID,
|
|
@@ -342,6 +504,15 @@ export class HMSSDK {
|
|
|
342
504
|
};
|
|
343
505
|
return await HMSManager.removePeer(data);
|
|
344
506
|
});
|
|
507
|
+
/**
|
|
508
|
+
* - endRoom can be used in a situation where we want to disconnect all the peers from current room
|
|
509
|
+
* and end the call.
|
|
510
|
+
* - everyone in the room will get an update of this action in {@link onRemovedFromRoomListener}.
|
|
511
|
+
*
|
|
512
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/end-room} for more info
|
|
513
|
+
*
|
|
514
|
+
* @memberof HMSSDK
|
|
515
|
+
*/
|
|
345
516
|
_defineProperty(this, "endRoom", async function (reason) {
|
|
346
517
|
let lock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
347
518
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function endRoom', {
|
|
@@ -356,6 +527,13 @@ export class HMSSDK {
|
|
|
356
527
|
};
|
|
357
528
|
return await HMSManager.endRoom(data);
|
|
358
529
|
});
|
|
530
|
+
/**
|
|
531
|
+
* - This function can be used to change name of localPeer.
|
|
532
|
+
*
|
|
533
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-name} for more info
|
|
534
|
+
*
|
|
535
|
+
* @memberof HMSSDK
|
|
536
|
+
*/
|
|
359
537
|
_defineProperty(this, "changeName", async name => {
|
|
360
538
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeName', {
|
|
361
539
|
name,
|
|
@@ -367,6 +545,13 @@ export class HMSSDK {
|
|
|
367
545
|
};
|
|
368
546
|
return await HMSManager.changeName(data);
|
|
369
547
|
});
|
|
548
|
+
/**
|
|
549
|
+
* - Calling this function will accept the most recent roleChange request made by anyone in the room
|
|
550
|
+
*
|
|
551
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
|
|
552
|
+
*
|
|
553
|
+
* @memberof HMSSDK
|
|
554
|
+
*/
|
|
370
555
|
_defineProperty(this, "acceptRoleChange", async () => {
|
|
371
556
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function acceptRoleChange', {
|
|
372
557
|
id: this.id
|
|
@@ -375,6 +560,14 @@ export class HMSSDK {
|
|
|
375
560
|
id: this.id
|
|
376
561
|
});
|
|
377
562
|
});
|
|
563
|
+
/**
|
|
564
|
+
* - setPlaybackForAllAudio is an extension of the abilities of setPlaybackAllowed in
|
|
565
|
+
* HMSRemoteAudioTrack. It sets mute status for all peers in the room only for the local peer.
|
|
566
|
+
*
|
|
567
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
|
|
568
|
+
*
|
|
569
|
+
* @memberof HMSSDK
|
|
570
|
+
*/
|
|
378
571
|
_defineProperty(this, "setPlaybackForAllAudio", mute => {
|
|
379
572
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setPlaybackForAllAudio', {
|
|
380
573
|
mute,
|
|
@@ -386,6 +579,11 @@ export class HMSSDK {
|
|
|
386
579
|
id: this.id
|
|
387
580
|
});
|
|
388
581
|
});
|
|
582
|
+
/**
|
|
583
|
+
* - This function mutes audio for all peers in the room.
|
|
584
|
+
*
|
|
585
|
+
* @memberof HMSSDK
|
|
586
|
+
*/
|
|
389
587
|
_defineProperty(this, "remoteMuteAllAudio", async () => {
|
|
390
588
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function remoteMuteAllAudio', {
|
|
391
589
|
id: this.id
|
|
@@ -394,16 +592,34 @@ export class HMSSDK {
|
|
|
394
592
|
id: this.id
|
|
395
593
|
});
|
|
396
594
|
});
|
|
595
|
+
/**
|
|
596
|
+
* - getRoom is a wrapper function on an existing native function also known as getRoom the returns
|
|
597
|
+
* current room object which is of type {@link HMSRoom}
|
|
598
|
+
*
|
|
599
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/join#get-room} for more info
|
|
600
|
+
*
|
|
601
|
+
* @memberof HMSSDK
|
|
602
|
+
* @return Promise<HMSRoom>
|
|
603
|
+
*/
|
|
397
604
|
_defineProperty(this, "getRoom", async () => {
|
|
605
|
+
var _getHmsRoomCache;
|
|
398
606
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getRoom', {
|
|
399
607
|
id: this.id
|
|
400
608
|
});
|
|
401
609
|
const hmsRoom = await HMSManager.getRoom({
|
|
402
610
|
id: this.id
|
|
403
611
|
});
|
|
612
|
+
(_getHmsRoomCache = getHmsRoomCache()) === null || _getHmsRoomCache === void 0 ? void 0 : _getHmsRoomCache.updateRoomCache(hmsRoom);
|
|
404
613
|
const encodedHmsRoom = HMSEncoder.encodeHmsRoom(hmsRoom, this.id);
|
|
405
614
|
return encodedHmsRoom;
|
|
406
615
|
});
|
|
616
|
+
/**
|
|
617
|
+
* - getLocalPeer is a wrapper function on an existing native function also known as getLocalPeer the returns
|
|
618
|
+
* current local peer object which is of type {@link HMSLocalPeer}
|
|
619
|
+
*
|
|
620
|
+
* @memberof HMSSDK
|
|
621
|
+
* @return Promise<HMSLocalPeer>
|
|
622
|
+
*/
|
|
407
623
|
_defineProperty(this, "getLocalPeer", async () => {
|
|
408
624
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getLocalPeer', {
|
|
409
625
|
id: this.id
|
|
@@ -414,6 +630,13 @@ export class HMSSDK {
|
|
|
414
630
|
const encodedLocalPeer = HMSEncoder.encodeHmsLocalPeer(localPeer, this.id);
|
|
415
631
|
return encodedLocalPeer;
|
|
416
632
|
});
|
|
633
|
+
/**
|
|
634
|
+
* - getRemotePeers is a wrapper function on an existing native function also known as getRemotePeers the returns
|
|
635
|
+
* remote peers array which is of type {@link HMSRemotePeer}
|
|
636
|
+
*
|
|
637
|
+
* @memberof HMSSDK
|
|
638
|
+
* @return Promise<HMSRemotePeer[]>
|
|
639
|
+
*/
|
|
417
640
|
_defineProperty(this, "getRemotePeers", async () => {
|
|
418
641
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getRemotePeers', {
|
|
419
642
|
id: this.id
|
|
@@ -424,6 +647,13 @@ export class HMSSDK {
|
|
|
424
647
|
const encodedRemotePeers = HMSEncoder.encodeHmsRemotePeers(remotePeers, this.id);
|
|
425
648
|
return encodedRemotePeers;
|
|
426
649
|
});
|
|
650
|
+
/**
|
|
651
|
+
* - getRoles is a wrapper function on an existing native function also known as getRoles the returns
|
|
652
|
+
* array of all present roles which is of type {@link HMSRole}
|
|
653
|
+
*
|
|
654
|
+
* @memberof HMSSDK
|
|
655
|
+
* @return Promise<HMSRole[]>
|
|
656
|
+
*/
|
|
427
657
|
_defineProperty(this, "getRoles", async () => {
|
|
428
658
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getRoles', {
|
|
429
659
|
id: this.id
|
|
@@ -434,6 +664,13 @@ export class HMSSDK {
|
|
|
434
664
|
const encodedRoles = HMSEncoder.encodeHmsRoles(roles);
|
|
435
665
|
return encodedRoles;
|
|
436
666
|
});
|
|
667
|
+
/**
|
|
668
|
+
* - This function sets the volume of any peer in the room
|
|
669
|
+
*
|
|
670
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/set-volume} for more info
|
|
671
|
+
*
|
|
672
|
+
* @memberof HMSSDK
|
|
673
|
+
*/
|
|
437
674
|
_defineProperty(this, "setVolume", (track, volume) => {
|
|
438
675
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setVolume', {
|
|
439
676
|
track,
|
|
@@ -454,6 +691,13 @@ export class HMSSDK {
|
|
|
454
691
|
id: this.id
|
|
455
692
|
});
|
|
456
693
|
});
|
|
694
|
+
/**
|
|
695
|
+
* - This is a temporary solution for the situation when mic access is taken from the app and
|
|
696
|
+
* user returns to the app with no mic access. It will re-acquire the mic by setting the volume
|
|
697
|
+
* from native side
|
|
698
|
+
*
|
|
699
|
+
* @memberof HMSSDK
|
|
700
|
+
*/
|
|
457
701
|
_defineProperty(this, "addAppStateListener", () => {
|
|
458
702
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function addAppStateListener', {
|
|
459
703
|
id: this.id
|
|
@@ -464,6 +708,13 @@ export class HMSSDK {
|
|
|
464
708
|
}
|
|
465
709
|
});
|
|
466
710
|
});
|
|
711
|
+
/**
|
|
712
|
+
* - This function is used to start screenshare, currently available only for android
|
|
713
|
+
*
|
|
714
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
|
|
715
|
+
*
|
|
716
|
+
* @memberof HMSSDK
|
|
717
|
+
*/
|
|
467
718
|
_defineProperty(this, "startScreenshare", async () => {
|
|
468
719
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startScreenshare', {
|
|
469
720
|
id: this.id
|
|
@@ -472,6 +723,13 @@ export class HMSSDK {
|
|
|
472
723
|
id: this.id
|
|
473
724
|
});
|
|
474
725
|
});
|
|
726
|
+
/**
|
|
727
|
+
* - Returns a boolean stating if the screen is currently shared or not
|
|
728
|
+
*
|
|
729
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
|
|
730
|
+
*
|
|
731
|
+
* @memberof HMSSDK
|
|
732
|
+
*/
|
|
475
733
|
_defineProperty(this, "isScreenShared", async () => {
|
|
476
734
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function isScreenShared', {
|
|
477
735
|
id: this.id
|
|
@@ -480,6 +738,13 @@ export class HMSSDK {
|
|
|
480
738
|
id: this.id
|
|
481
739
|
});
|
|
482
740
|
});
|
|
741
|
+
/**
|
|
742
|
+
* - stops the screenShare, currently available for android only.
|
|
743
|
+
*
|
|
744
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
|
|
745
|
+
*
|
|
746
|
+
* @memberof HMSSDK
|
|
747
|
+
*/
|
|
483
748
|
_defineProperty(this, "stopScreenshare", async () => {
|
|
484
749
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopScreenshare', {
|
|
485
750
|
id: this.id
|
|
@@ -488,6 +753,18 @@ export class HMSSDK {
|
|
|
488
753
|
id: this.id
|
|
489
754
|
});
|
|
490
755
|
});
|
|
756
|
+
/**
|
|
757
|
+
* - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
|
|
758
|
+
* through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
|
|
759
|
+
* {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
|
|
760
|
+
*
|
|
761
|
+
* - These listeners get various dataPoints for current peers and their connectivity to the room
|
|
762
|
+
* such as jitter, latency etc.
|
|
763
|
+
*
|
|
764
|
+
* - currently available for iOS only
|
|
765
|
+
*
|
|
766
|
+
* @memberof HMSSDK
|
|
767
|
+
*/
|
|
491
768
|
_defineProperty(this, "enableRTCStats", () => {
|
|
492
769
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function enableRTCStats', {
|
|
493
770
|
id: this.id
|
|
@@ -496,6 +773,14 @@ export class HMSSDK {
|
|
|
496
773
|
id: this.id
|
|
497
774
|
});
|
|
498
775
|
});
|
|
776
|
+
/**
|
|
777
|
+
* - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
|
|
778
|
+
* that activates a check which filters out the events acquired in native listeners and don't
|
|
779
|
+
* let them pass through bridge
|
|
780
|
+
*
|
|
781
|
+
* - currently available for iOS only.
|
|
782
|
+
* @memberof HMSSDK
|
|
783
|
+
*/
|
|
499
784
|
_defineProperty(this, "disableRTCStats", () => {
|
|
500
785
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function disableRTCStats', {
|
|
501
786
|
id: this.id
|
|
@@ -520,6 +805,14 @@ export class HMSSDK {
|
|
|
520
805
|
id: this.id
|
|
521
806
|
});
|
|
522
807
|
});
|
|
808
|
+
/**
|
|
809
|
+
* - This wrapper function is used to start streaming device audio, currently available only for android.
|
|
810
|
+
*
|
|
811
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stream-device-audio-from-the-app} for more info.
|
|
812
|
+
*
|
|
813
|
+
* @param {HMSAudioMixingMode}
|
|
814
|
+
* @memberof HMSSDK
|
|
815
|
+
*/
|
|
523
816
|
_defineProperty(this, "startAudioshare", async audioMixingMode => {
|
|
524
817
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startAudioshare', {
|
|
525
818
|
id: this.id,
|
|
@@ -535,6 +828,13 @@ export class HMSSDK {
|
|
|
535
828
|
return 'API currently not available for iOS';
|
|
536
829
|
}
|
|
537
830
|
});
|
|
831
|
+
/**
|
|
832
|
+
* - This wrapper function returns true if audio is being shared and vice versa, currently available only for android.
|
|
833
|
+
*
|
|
834
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-get-audio-share-status} for more info.
|
|
835
|
+
*
|
|
836
|
+
* @memberof HMSSDK
|
|
837
|
+
*/
|
|
538
838
|
_defineProperty(this, "isAudioShared", async () => {
|
|
539
839
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function isAudioShared', {
|
|
540
840
|
id: this.id
|
|
@@ -548,6 +848,13 @@ export class HMSSDK {
|
|
|
548
848
|
return 'API currently not available for iOS';
|
|
549
849
|
}
|
|
550
850
|
});
|
|
851
|
+
/**
|
|
852
|
+
* - This wrapper function is used to stop streaming device audio, currently available only for android.
|
|
853
|
+
*
|
|
854
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stop-audio-sharing} for more info.
|
|
855
|
+
*
|
|
856
|
+
* @memberof HMSSDK
|
|
857
|
+
*/
|
|
551
858
|
_defineProperty(this, "stopAudioshare", async () => {
|
|
552
859
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopAudioshare', {
|
|
553
860
|
id: this.id
|
|
@@ -561,6 +868,12 @@ export class HMSSDK {
|
|
|
561
868
|
return 'API currently not available for iOS';
|
|
562
869
|
}
|
|
563
870
|
});
|
|
871
|
+
/**
|
|
872
|
+
* - This wrapper function returns the current audio mixing mode, currently available only for android.
|
|
873
|
+
*
|
|
874
|
+
* @memberof HMSSDK
|
|
875
|
+
* @return HMSAudioMixingMode
|
|
876
|
+
*/
|
|
564
877
|
_defineProperty(this, "getAudioMixingMode", async () => {
|
|
565
878
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getAudioMixingMode', {
|
|
566
879
|
id: this.id
|
|
@@ -574,6 +887,14 @@ export class HMSSDK {
|
|
|
574
887
|
return 'API currently not available for iOS';
|
|
575
888
|
}
|
|
576
889
|
});
|
|
890
|
+
/**
|
|
891
|
+
* - This wrapper function used to change the mode while the user is streaming audio, currently available only for android.
|
|
892
|
+
*
|
|
893
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-change-mode} for more info
|
|
894
|
+
*
|
|
895
|
+
* @param {HMSAudioMixingMode}
|
|
896
|
+
* @memberof HMSSDK
|
|
897
|
+
*/
|
|
577
898
|
_defineProperty(this, "setAudioMixingMode", async audioMixingMode => {
|
|
578
899
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setAudioMixingMode', {
|
|
579
900
|
id: this.id,
|
|
@@ -589,6 +910,15 @@ export class HMSSDK {
|
|
|
589
910
|
return 'API currently not available for iOS';
|
|
590
911
|
}
|
|
591
912
|
});
|
|
913
|
+
/**
|
|
914
|
+
* - This wrapper function returns the array of audio output devices which is of
|
|
915
|
+
* type {@link HMSAudioDevice[]}, currently available only for android.
|
|
916
|
+
*
|
|
917
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-list-of-audio-device} for more info
|
|
918
|
+
*
|
|
919
|
+
* @memberof HMSSDK
|
|
920
|
+
* @return HMSAudioDevice[]
|
|
921
|
+
*/
|
|
592
922
|
_defineProperty(this, "getAudioDevicesList", async () => {
|
|
593
923
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getAudioDevicesList', {
|
|
594
924
|
id: this.id
|
|
@@ -602,6 +932,15 @@ export class HMSSDK {
|
|
|
602
932
|
return 'API currently not available for iOS';
|
|
603
933
|
}
|
|
604
934
|
});
|
|
935
|
+
/**
|
|
936
|
+
* - This wrapper function returns the current audio output device which is of
|
|
937
|
+
* type {@link HMSAudioDevice}, currently available only for android.
|
|
938
|
+
*
|
|
939
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-current-focussed-device} for more info
|
|
940
|
+
*
|
|
941
|
+
* @memberof HMSSDK
|
|
942
|
+
* @return HMSAudioDevice
|
|
943
|
+
*/
|
|
605
944
|
_defineProperty(this, "getAudioOutputRouteType", async () => {
|
|
606
945
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getAudioOutputRouteType', {
|
|
607
946
|
id: this.id
|
|
@@ -615,6 +954,14 @@ export class HMSSDK {
|
|
|
615
954
|
return 'API currently not available for iOS';
|
|
616
955
|
}
|
|
617
956
|
});
|
|
957
|
+
/**
|
|
958
|
+
* - This wrapper function used to switch output to device other than the default, currently available only for android.
|
|
959
|
+
*
|
|
960
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
|
|
961
|
+
*
|
|
962
|
+
* @param {HMSAudioDevice}
|
|
963
|
+
* @memberof HMSSDK
|
|
964
|
+
*/
|
|
618
965
|
_defineProperty(this, "switchAudioOutput", audioDevice => {
|
|
619
966
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function switchAudioOutput', {
|
|
620
967
|
id: this.id,
|
|
@@ -630,6 +977,14 @@ export class HMSSDK {
|
|
|
630
977
|
return 'API currently not available for iOS';
|
|
631
978
|
}
|
|
632
979
|
});
|
|
980
|
+
/**
|
|
981
|
+
* - This wrapper function used to change Audio Mode manually, currently available only for android.
|
|
982
|
+
*
|
|
983
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-mode-change} for more info
|
|
984
|
+
*
|
|
985
|
+
* @param {HMSAudioMode}
|
|
986
|
+
* @memberof HMSSDK
|
|
987
|
+
*/
|
|
633
988
|
_defineProperty(this, "setAudioMode", audioMode => {
|
|
634
989
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setAudioMode', {
|
|
635
990
|
id: this.id,
|
|
@@ -645,6 +1000,14 @@ export class HMSSDK {
|
|
|
645
1000
|
return 'API currently not available for iOS';
|
|
646
1001
|
}
|
|
647
1002
|
});
|
|
1003
|
+
/**
|
|
1004
|
+
* - This is a wrapper function which adds a listener which is triggered when audio output device is switched, currently available only for android.
|
|
1005
|
+
*
|
|
1006
|
+
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#adding-a-listener} for more info
|
|
1007
|
+
*
|
|
1008
|
+
* @param {Function}
|
|
1009
|
+
* @memberof HMSSDK
|
|
1010
|
+
*/
|
|
648
1011
|
_defineProperty(this, "setAudioDeviceChangeListener", callback => {
|
|
649
1012
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setAudioDeviceChangeListener', {
|
|
650
1013
|
id: this.id
|
|
@@ -677,6 +1040,13 @@ export class HMSSDK {
|
|
|
677
1040
|
id: this.id
|
|
678
1041
|
});
|
|
679
1042
|
});
|
|
1043
|
+
/**
|
|
1044
|
+
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
1045
|
+
*
|
|
1046
|
+
* @param {string} action
|
|
1047
|
+
* @param {*} callback
|
|
1048
|
+
* @memberof HMSSDK
|
|
1049
|
+
*/
|
|
680
1050
|
_defineProperty(this, "addEventListener", (action, callback) => {
|
|
681
1051
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function addEventListener', {
|
|
682
1052
|
action,
|
|
@@ -684,68 +1054,257 @@ export class HMSSDK {
|
|
|
684
1054
|
});
|
|
685
1055
|
switch (action) {
|
|
686
1056
|
case HMSUpdateListenerActions.ON_PREVIEW:
|
|
687
|
-
|
|
688
|
-
|
|
1057
|
+
{
|
|
1058
|
+
// Checking if we already have ON_PREVIEW subscription
|
|
1059
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_PREVIEW]) {
|
|
1060
|
+
// Adding ON_PREVIEW native listener
|
|
1061
|
+
const previewSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_PREVIEW, this.onPreviewListener);
|
|
1062
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_PREVIEW] = previewSubscription;
|
|
1063
|
+
}
|
|
1064
|
+
// Adding App Delegate listener
|
|
1065
|
+
this.onPreviewDelegate = callback;
|
|
1066
|
+
break;
|
|
1067
|
+
}
|
|
689
1068
|
case HMSUpdateListenerActions.ON_JOIN:
|
|
690
|
-
|
|
691
|
-
|
|
1069
|
+
{
|
|
1070
|
+
// Checking if we already have ON_JOIN subscription
|
|
1071
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_JOIN]) {
|
|
1072
|
+
// Adding ON_JOIN native listener
|
|
1073
|
+
const joinSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_JOIN, this.onJoinListener);
|
|
1074
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_JOIN] = joinSubscription;
|
|
1075
|
+
}
|
|
1076
|
+
// Adding App Delegate listener
|
|
1077
|
+
this.onJoinDelegate = callback;
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
692
1080
|
case HMSUpdateListenerActions.ON_ROOM_UPDATE:
|
|
693
|
-
|
|
694
|
-
|
|
1081
|
+
{
|
|
1082
|
+
// Checking if we already have ON_ROOM_UPDATE subscription
|
|
1083
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROOM_UPDATE]) {
|
|
1084
|
+
// Adding ON_ROOM_UPDATE native listener
|
|
1085
|
+
const roomSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_ROOM_UPDATE, this.onRoomListener);
|
|
1086
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROOM_UPDATE] = roomSubscription;
|
|
1087
|
+
}
|
|
1088
|
+
// Adding App Delegate listener
|
|
1089
|
+
this.onRoomDelegate = callback;
|
|
1090
|
+
break;
|
|
1091
|
+
}
|
|
695
1092
|
case HMSUpdateListenerActions.ON_PEER_UPDATE:
|
|
696
|
-
|
|
697
|
-
|
|
1093
|
+
{
|
|
1094
|
+
// Checking if we already have ON_PEER_UPDATE subscription
|
|
1095
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_PEER_UPDATE]) {
|
|
1096
|
+
// Adding ON_PEER_UPDATE native listener
|
|
1097
|
+
const peerSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_PEER_UPDATE, this.onPeerListener);
|
|
1098
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_PEER_UPDATE] = peerSubscription;
|
|
1099
|
+
}
|
|
1100
|
+
// Adding App Delegate listener
|
|
1101
|
+
this.onPeerDelegate = callback;
|
|
1102
|
+
break;
|
|
1103
|
+
}
|
|
698
1104
|
case HMSUpdateListenerActions.ON_TRACK_UPDATE:
|
|
699
|
-
|
|
700
|
-
|
|
1105
|
+
{
|
|
1106
|
+
// Checking if we already have ON_TRACK_UPDATE subscription
|
|
1107
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRACK_UPDATE]) {
|
|
1108
|
+
// Adding ON_TRACK_UPDATE native listener
|
|
1109
|
+
const trackSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_TRACK_UPDATE, this.onTrackListener);
|
|
1110
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRACK_UPDATE] = trackSubscription;
|
|
1111
|
+
}
|
|
1112
|
+
// Adding App Delegate listener
|
|
1113
|
+
this.onTrackDelegate = callback;
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
701
1116
|
case HMSUpdateListenerActions.ON_ERROR:
|
|
702
|
-
|
|
703
|
-
|
|
1117
|
+
{
|
|
1118
|
+
// Checking if we already have ON_ERROR subscription
|
|
1119
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_ERROR]) {
|
|
1120
|
+
// Adding ON_ERROR native listener
|
|
1121
|
+
const errorSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_ERROR, this.onErrorListener);
|
|
1122
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_ERROR] = errorSubscription;
|
|
1123
|
+
}
|
|
1124
|
+
// Adding App Delegate listener
|
|
1125
|
+
this.onErrorDelegate = callback;
|
|
1126
|
+
break;
|
|
1127
|
+
}
|
|
704
1128
|
case HMSUpdateListenerActions.ON_MESSAGE:
|
|
705
|
-
|
|
706
|
-
|
|
1129
|
+
{
|
|
1130
|
+
// Checking if we already have ON_MESSAGE subscription
|
|
1131
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_MESSAGE]) {
|
|
1132
|
+
// Adding ON_MESSAGE native listener
|
|
1133
|
+
const messageSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_MESSAGE, this.onMessageListener);
|
|
1134
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_MESSAGE] = messageSubscription;
|
|
1135
|
+
}
|
|
1136
|
+
// Adding App Delegate listener
|
|
1137
|
+
this.onMessageDelegate = callback;
|
|
1138
|
+
break;
|
|
1139
|
+
}
|
|
707
1140
|
case HMSUpdateListenerActions.ON_SPEAKER:
|
|
708
|
-
|
|
709
|
-
|
|
1141
|
+
{
|
|
1142
|
+
// Checking if we already have ON_SPEAKER subscription
|
|
1143
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_SPEAKER]) {
|
|
1144
|
+
// Adding ON_SPEAKER native listener
|
|
1145
|
+
const speakerSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_SPEAKER, this.onSpeakerListener);
|
|
1146
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_SPEAKER] = speakerSubscription;
|
|
1147
|
+
}
|
|
1148
|
+
// Adding App Delegate listener
|
|
1149
|
+
this.onSpeakerDelegate = callback;
|
|
1150
|
+
break;
|
|
1151
|
+
}
|
|
710
1152
|
case HMSUpdateListenerActions.RECONNECTING:
|
|
711
|
-
|
|
712
|
-
|
|
1153
|
+
{
|
|
1154
|
+
// Checking if we already have RECONNECTING subscription
|
|
1155
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTING]) {
|
|
1156
|
+
// Adding RECONNECTING native listener
|
|
1157
|
+
const reconnectingSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.RECONNECTING, this.reconnectingListener);
|
|
1158
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTING] = reconnectingSubscription;
|
|
1159
|
+
}
|
|
1160
|
+
// Adding App Delegate listener
|
|
1161
|
+
this.onReconnectingDelegate = callback;
|
|
1162
|
+
break;
|
|
1163
|
+
}
|
|
713
1164
|
case HMSUpdateListenerActions.RECONNECTED:
|
|
714
|
-
|
|
715
|
-
|
|
1165
|
+
{
|
|
1166
|
+
// Checking if we already have RECONNECTED subscription
|
|
1167
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTED]) {
|
|
1168
|
+
// Adding RECONNECTED native listener
|
|
1169
|
+
const reconnectedSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.RECONNECTED, this.reconnectedListener);
|
|
1170
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTED] = reconnectedSubscription;
|
|
1171
|
+
}
|
|
1172
|
+
// Adding App Delegate listener
|
|
1173
|
+
this.onReconnectedDelegate = callback;
|
|
1174
|
+
break;
|
|
1175
|
+
}
|
|
716
1176
|
case HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST:
|
|
717
|
-
|
|
718
|
-
|
|
1177
|
+
{
|
|
1178
|
+
// Checking if we already have ON_ROLE_CHANGE_REQUEST subscription
|
|
1179
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST]) {
|
|
1180
|
+
// Adding ON_ROLE_CHANGE_REQUEST native listener
|
|
1181
|
+
const roleChangeReqSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST, this.onRoleChangeRequestListener);
|
|
1182
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST] = roleChangeReqSubscription;
|
|
1183
|
+
}
|
|
1184
|
+
// Adding App Delegate listener
|
|
1185
|
+
this.onRoleChangeRequestDelegate = callback;
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
719
1188
|
case HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST:
|
|
720
|
-
|
|
721
|
-
|
|
1189
|
+
{
|
|
1190
|
+
// Checking if we already have ON_CHANGE_TRACK_STATE_REQUEST subscription
|
|
1191
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST]) {
|
|
1192
|
+
// Adding ON_CHANGE_TRACK_STATE_REQUEST native listener
|
|
1193
|
+
const changeTrackReqSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST, this.onChangeTrackStateRequestListener);
|
|
1194
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST] = changeTrackReqSubscription;
|
|
1195
|
+
}
|
|
1196
|
+
// Adding App Delegate listener
|
|
1197
|
+
this.onChangeTrackStateRequestDelegate = callback;
|
|
1198
|
+
break;
|
|
1199
|
+
}
|
|
722
1200
|
case HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM:
|
|
723
|
-
|
|
724
|
-
|
|
1201
|
+
{
|
|
1202
|
+
// Checking if we already have ON_REMOVED_FROM_ROOM subscription
|
|
1203
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM]) {
|
|
1204
|
+
// Adding ON_REMOVED_FROM_ROOM native listener
|
|
1205
|
+
const removedFromRoomSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, this.onRemovedFromRoomListener);
|
|
1206
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM] = removedFromRoomSubscription;
|
|
1207
|
+
}
|
|
1208
|
+
// Adding App Delegate listener
|
|
1209
|
+
this.onRemovedFromRoomDelegate = callback;
|
|
1210
|
+
break;
|
|
1211
|
+
}
|
|
725
1212
|
case HMSUpdateListenerActions.ON_RTC_STATS:
|
|
726
|
-
|
|
727
|
-
|
|
1213
|
+
{
|
|
1214
|
+
// Checking if we already have ON_RTC_STATS subscription
|
|
1215
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_RTC_STATS]) {
|
|
1216
|
+
// Adding ON_RTC_STATS native listener
|
|
1217
|
+
const rtcStatsSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_RTC_STATS, this.RTCStatsListener);
|
|
1218
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_RTC_STATS] = rtcStatsSubscription;
|
|
1219
|
+
}
|
|
1220
|
+
// Adding App Delegate listener
|
|
1221
|
+
this.onRtcStatsDelegate = callback;
|
|
1222
|
+
break;
|
|
1223
|
+
}
|
|
728
1224
|
case HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS:
|
|
729
|
-
|
|
730
|
-
|
|
1225
|
+
{
|
|
1226
|
+
// Checking if we already have ON_LOCAL_AUDIO_STATS subscription
|
|
1227
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS]) {
|
|
1228
|
+
// Adding ON_LOCAL_AUDIO_STATS native listener
|
|
1229
|
+
const lclAudioStatsSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS, this.onLocalAudioStatsListener);
|
|
1230
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS] = lclAudioStatsSubscription;
|
|
1231
|
+
}
|
|
1232
|
+
// Adding App Delegate listener
|
|
1233
|
+
this.onLocalAudioStatsDelegate = callback;
|
|
1234
|
+
break;
|
|
1235
|
+
}
|
|
731
1236
|
case HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS:
|
|
732
|
-
|
|
733
|
-
|
|
1237
|
+
{
|
|
1238
|
+
// Checking if we already have ON_LOCAL_VIDEO_STATS subscription
|
|
1239
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS]) {
|
|
1240
|
+
// Adding ON_LOCAL_VIDEO_STATS native listener
|
|
1241
|
+
const lclVideoStatsSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
|
|
1242
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS] = lclVideoStatsSubscription;
|
|
1243
|
+
}
|
|
1244
|
+
// Adding App Delegate listener
|
|
1245
|
+
this.onLocalVideoStatsDelegate = callback;
|
|
1246
|
+
break;
|
|
1247
|
+
}
|
|
734
1248
|
case HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS:
|
|
735
|
-
|
|
736
|
-
|
|
1249
|
+
{
|
|
1250
|
+
// Checking if we already have ON_REMOTE_AUDIO_STATS subscription
|
|
1251
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS]) {
|
|
1252
|
+
// Adding ON_REMOTE_AUDIO_STATS native listener
|
|
1253
|
+
const rmAudioStatsSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
|
|
1254
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS] = rmAudioStatsSubscription;
|
|
1255
|
+
}
|
|
1256
|
+
// Adding App Delegate listener
|
|
1257
|
+
this.onRemoteAudioStatsDelegate = callback;
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
737
1260
|
case HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS:
|
|
738
|
-
|
|
739
|
-
|
|
1261
|
+
{
|
|
1262
|
+
// Checking if we already have ON_REMOTE_VIDEO_STATS subscription
|
|
1263
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS]) {
|
|
1264
|
+
// Adding ON_REMOTE_VIDEO_STATS native listener
|
|
1265
|
+
const rmVideoStatsSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
|
|
1266
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS] = rmVideoStatsSubscription;
|
|
1267
|
+
}
|
|
1268
|
+
// Adding App Delegate listener
|
|
1269
|
+
this.onRemoteVideoStatsDelegate = callback;
|
|
1270
|
+
break;
|
|
1271
|
+
}
|
|
740
1272
|
case HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
|
|
741
|
-
|
|
742
|
-
|
|
1273
|
+
{
|
|
1274
|
+
// Checking if we already have ON_AUDIO_DEVICE_CHANGED subscription
|
|
1275
|
+
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED]) {
|
|
1276
|
+
// Adding ON_AUDIO_DEVICE_CHANGED native listener
|
|
1277
|
+
const audDeviceChgSubscription = HmsEventEmitter.addListener(this.id, HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
|
|
1278
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED] = audDeviceChgSubscription;
|
|
1279
|
+
}
|
|
1280
|
+
// Adding App Delegate listener
|
|
1281
|
+
this.onAudioDeviceChangedDelegate = callback;
|
|
1282
|
+
break;
|
|
1283
|
+
}
|
|
743
1284
|
case HMSPIPListenerActions.ON_PIP_ROOM_LEAVE:
|
|
744
|
-
|
|
745
|
-
|
|
1285
|
+
{
|
|
1286
|
+
if (Platform.OS === 'android') {
|
|
1287
|
+
// Checking if we already have ON_PIP_ROOM_LEAVE subscription
|
|
1288
|
+
if (!this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_ROOM_LEAVE]) {
|
|
1289
|
+
// Adding ON_PIP_ROOM_LEAVE native listener
|
|
1290
|
+
const pipRoomLeaveSubscription = HmsEventEmitter.addListener(this.id, HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, this.onPIPRoomLeaveListener);
|
|
1291
|
+
this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_ROOM_LEAVE] = pipRoomLeaveSubscription;
|
|
1292
|
+
}
|
|
1293
|
+
// Adding App Delegate listener
|
|
1294
|
+
this.onPIPRoomLeaveDelegate = callback;
|
|
1295
|
+
}
|
|
1296
|
+
break;
|
|
1297
|
+
}
|
|
746
1298
|
default:
|
|
747
1299
|
}
|
|
748
1300
|
});
|
|
1301
|
+
/**
|
|
1302
|
+
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
1303
|
+
*
|
|
1304
|
+
* @param {string} action
|
|
1305
|
+
* @param {*} callback
|
|
1306
|
+
* @memberof HMSSDK
|
|
1307
|
+
*/
|
|
749
1308
|
_defineProperty(this, "removeEventListener", action => {
|
|
750
1309
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function removeEventListener', {
|
|
751
1310
|
action,
|
|
@@ -753,68 +1312,255 @@ export class HMSSDK {
|
|
|
753
1312
|
});
|
|
754
1313
|
switch (action) {
|
|
755
1314
|
case HMSUpdateListenerActions.ON_PREVIEW:
|
|
756
|
-
|
|
757
|
-
|
|
1315
|
+
{
|
|
1316
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_PREVIEW];
|
|
1317
|
+
// Removing ON_PREVIEW native listener
|
|
1318
|
+
if (subscription) {
|
|
1319
|
+
subscription.remove();
|
|
1320
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_PREVIEW] = undefined;
|
|
1321
|
+
}
|
|
1322
|
+
// Removing App Delegate listener
|
|
1323
|
+
this.onPreviewDelegate = null;
|
|
1324
|
+
break;
|
|
1325
|
+
}
|
|
758
1326
|
case HMSUpdateListenerActions.ON_JOIN:
|
|
759
|
-
|
|
760
|
-
|
|
1327
|
+
{
|
|
1328
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_JOIN];
|
|
1329
|
+
// Removing ON_JOIN native listener
|
|
1330
|
+
if (subscription) {
|
|
1331
|
+
subscription.remove();
|
|
1332
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_JOIN] = undefined;
|
|
1333
|
+
}
|
|
1334
|
+
// Removing App Delegate listener
|
|
1335
|
+
this.onJoinDelegate = null;
|
|
1336
|
+
break;
|
|
1337
|
+
}
|
|
761
1338
|
case HMSUpdateListenerActions.ON_ROOM_UPDATE:
|
|
762
|
-
|
|
763
|
-
|
|
1339
|
+
{
|
|
1340
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROOM_UPDATE];
|
|
1341
|
+
// Removing ON_ROOM_UPDATE native listener
|
|
1342
|
+
if (subscription) {
|
|
1343
|
+
subscription.remove();
|
|
1344
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROOM_UPDATE] = undefined;
|
|
1345
|
+
}
|
|
1346
|
+
// Removing App Delegate listener
|
|
1347
|
+
this.onRoomDelegate = null;
|
|
1348
|
+
break;
|
|
1349
|
+
}
|
|
764
1350
|
case HMSUpdateListenerActions.ON_PEER_UPDATE:
|
|
765
|
-
|
|
766
|
-
|
|
1351
|
+
{
|
|
1352
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_PEER_UPDATE];
|
|
1353
|
+
// Removing ON_PEER_UPDATE native listener
|
|
1354
|
+
if (subscription) {
|
|
1355
|
+
subscription.remove();
|
|
1356
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_PEER_UPDATE] = undefined;
|
|
1357
|
+
}
|
|
1358
|
+
// Removing App Delegate listener
|
|
1359
|
+
this.onPeerDelegate = null;
|
|
1360
|
+
break;
|
|
1361
|
+
}
|
|
767
1362
|
case HMSUpdateListenerActions.ON_TRACK_UPDATE:
|
|
768
|
-
|
|
769
|
-
|
|
1363
|
+
{
|
|
1364
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRACK_UPDATE];
|
|
1365
|
+
// Removing ON_TRACK_UPDATE native listener
|
|
1366
|
+
if (subscription) {
|
|
1367
|
+
subscription.remove();
|
|
1368
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRACK_UPDATE] = undefined;
|
|
1369
|
+
}
|
|
1370
|
+
// Removing App Delegate listener
|
|
1371
|
+
this.onTrackDelegate = null;
|
|
1372
|
+
break;
|
|
1373
|
+
}
|
|
770
1374
|
case HMSUpdateListenerActions.ON_ERROR:
|
|
771
|
-
|
|
772
|
-
|
|
1375
|
+
{
|
|
1376
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_ERROR];
|
|
1377
|
+
// Removing ON_ERROR native listener
|
|
1378
|
+
if (subscription) {
|
|
1379
|
+
subscription.remove();
|
|
1380
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_ERROR] = undefined;
|
|
1381
|
+
}
|
|
1382
|
+
// Removing App Delegate listener
|
|
1383
|
+
this.onErrorDelegate = null;
|
|
1384
|
+
break;
|
|
1385
|
+
}
|
|
773
1386
|
case HMSUpdateListenerActions.ON_MESSAGE:
|
|
774
|
-
|
|
775
|
-
|
|
1387
|
+
{
|
|
1388
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_MESSAGE];
|
|
1389
|
+
// Removing ON_MESSAGE native listener
|
|
1390
|
+
if (subscription) {
|
|
1391
|
+
subscription.remove();
|
|
1392
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_MESSAGE] = undefined;
|
|
1393
|
+
}
|
|
1394
|
+
// Removing App Delegate listener
|
|
1395
|
+
this.onMessageDelegate = null;
|
|
1396
|
+
break;
|
|
1397
|
+
}
|
|
776
1398
|
case HMSUpdateListenerActions.ON_SPEAKER:
|
|
777
|
-
|
|
778
|
-
|
|
1399
|
+
{
|
|
1400
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_SPEAKER];
|
|
1401
|
+
// Removing ON_SPEAKER native listener
|
|
1402
|
+
if (subscription) {
|
|
1403
|
+
subscription.remove();
|
|
1404
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_SPEAKER] = undefined;
|
|
1405
|
+
}
|
|
1406
|
+
// Removing App Delegate listener
|
|
1407
|
+
this.onSpeakerDelegate = null;
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
779
1410
|
case HMSUpdateListenerActions.RECONNECTING:
|
|
780
|
-
|
|
781
|
-
|
|
1411
|
+
{
|
|
1412
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTING];
|
|
1413
|
+
// Removing RECONNECTING native listener
|
|
1414
|
+
if (subscription) {
|
|
1415
|
+
subscription.remove();
|
|
1416
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTING] = undefined;
|
|
1417
|
+
}
|
|
1418
|
+
// Removing App Delegate listener
|
|
1419
|
+
this.onReconnectingDelegate = null;
|
|
1420
|
+
break;
|
|
1421
|
+
}
|
|
782
1422
|
case HMSUpdateListenerActions.RECONNECTED:
|
|
783
|
-
|
|
784
|
-
|
|
1423
|
+
{
|
|
1424
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTED];
|
|
1425
|
+
// Removing RECONNECTED native listener
|
|
1426
|
+
if (subscription) {
|
|
1427
|
+
subscription.remove();
|
|
1428
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTED] = undefined;
|
|
1429
|
+
}
|
|
1430
|
+
// Removing App Delegate listener
|
|
1431
|
+
this.onReconnectedDelegate = null;
|
|
1432
|
+
break;
|
|
1433
|
+
}
|
|
785
1434
|
case HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST:
|
|
786
|
-
|
|
787
|
-
|
|
1435
|
+
{
|
|
1436
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST];
|
|
1437
|
+
// Removing ON_ROLE_CHANGE_REQUEST native listener
|
|
1438
|
+
if (subscription) {
|
|
1439
|
+
subscription.remove();
|
|
1440
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST] = undefined;
|
|
1441
|
+
}
|
|
1442
|
+
// Removing App Delegate listener
|
|
1443
|
+
this.onRoleChangeRequestDelegate = null;
|
|
1444
|
+
break;
|
|
1445
|
+
}
|
|
788
1446
|
case HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST:
|
|
789
|
-
|
|
790
|
-
|
|
1447
|
+
{
|
|
1448
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST];
|
|
1449
|
+
// Removing ON_CHANGE_TRACK_STATE_REQUEST native listener
|
|
1450
|
+
if (subscription) {
|
|
1451
|
+
subscription.remove();
|
|
1452
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST] = undefined;
|
|
1453
|
+
}
|
|
1454
|
+
// Removing App Delegate listener
|
|
1455
|
+
this.onChangeTrackStateRequestDelegate = null;
|
|
1456
|
+
break;
|
|
1457
|
+
}
|
|
791
1458
|
case HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM:
|
|
792
|
-
|
|
793
|
-
|
|
1459
|
+
{
|
|
1460
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM];
|
|
1461
|
+
// Removing ON_REMOVED_FROM_ROOM native listener
|
|
1462
|
+
if (subscription) {
|
|
1463
|
+
subscription.remove();
|
|
1464
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM] = undefined;
|
|
1465
|
+
}
|
|
1466
|
+
// Removing App Delegate listener
|
|
1467
|
+
this.onRemovedFromRoomDelegate = null;
|
|
1468
|
+
break;
|
|
1469
|
+
}
|
|
794
1470
|
case HMSUpdateListenerActions.ON_RTC_STATS:
|
|
795
|
-
|
|
796
|
-
|
|
1471
|
+
{
|
|
1472
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_RTC_STATS];
|
|
1473
|
+
// Removing ON_RTC_STATS native listener
|
|
1474
|
+
if (subscription) {
|
|
1475
|
+
subscription.remove();
|
|
1476
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_RTC_STATS] = undefined;
|
|
1477
|
+
}
|
|
1478
|
+
// Removing App Delegate listener
|
|
1479
|
+
this.onRtcStatsDelegate = null;
|
|
1480
|
+
break;
|
|
1481
|
+
}
|
|
797
1482
|
case HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS:
|
|
798
|
-
|
|
799
|
-
|
|
1483
|
+
{
|
|
1484
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS];
|
|
1485
|
+
// Removing ON_LOCAL_AUDIO_STATS native listener
|
|
1486
|
+
if (subscription) {
|
|
1487
|
+
subscription.remove();
|
|
1488
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS] = undefined;
|
|
1489
|
+
}
|
|
1490
|
+
// Removing App Delegate listener
|
|
1491
|
+
this.onLocalAudioStatsDelegate = null;
|
|
1492
|
+
break;
|
|
1493
|
+
}
|
|
800
1494
|
case HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS:
|
|
801
|
-
|
|
802
|
-
|
|
1495
|
+
{
|
|
1496
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS];
|
|
1497
|
+
// Removing ON_LOCAL_VIDEO_STATS native listener
|
|
1498
|
+
if (subscription) {
|
|
1499
|
+
subscription.remove();
|
|
1500
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS] = undefined;
|
|
1501
|
+
}
|
|
1502
|
+
// Removing App Delegate listener
|
|
1503
|
+
this.onLocalVideoStatsDelegate = null;
|
|
1504
|
+
break;
|
|
1505
|
+
}
|
|
803
1506
|
case HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS:
|
|
804
|
-
|
|
805
|
-
|
|
1507
|
+
{
|
|
1508
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS];
|
|
1509
|
+
// Removing ON_REMOTE_AUDIO_STATS native listener
|
|
1510
|
+
if (subscription) {
|
|
1511
|
+
subscription.remove();
|
|
1512
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS] = undefined;
|
|
1513
|
+
}
|
|
1514
|
+
// Removing App Delegate listener
|
|
1515
|
+
this.onRemoteAudioStatsDelegate = null;
|
|
1516
|
+
break;
|
|
1517
|
+
}
|
|
806
1518
|
case HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS:
|
|
807
|
-
|
|
808
|
-
|
|
1519
|
+
{
|
|
1520
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS];
|
|
1521
|
+
// Removing ON_REMOTE_VIDEO_STATS native listener
|
|
1522
|
+
if (subscription) {
|
|
1523
|
+
subscription.remove();
|
|
1524
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS] = undefined;
|
|
1525
|
+
}
|
|
1526
|
+
// Removing App Delegate listener
|
|
1527
|
+
this.onRemoteVideoStatsDelegate = null;
|
|
1528
|
+
break;
|
|
1529
|
+
}
|
|
809
1530
|
case HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
|
|
810
|
-
|
|
811
|
-
|
|
1531
|
+
{
|
|
1532
|
+
const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED];
|
|
1533
|
+
// Removing ON_AUDIO_DEVICE_CHANGED native listener
|
|
1534
|
+
if (subscription) {
|
|
1535
|
+
subscription.remove();
|
|
1536
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED] = undefined;
|
|
1537
|
+
}
|
|
1538
|
+
// Removing App Delegate listener
|
|
1539
|
+
this.onAudioDeviceChangedDelegate = null;
|
|
1540
|
+
break;
|
|
1541
|
+
}
|
|
812
1542
|
case HMSPIPListenerActions.ON_PIP_ROOM_LEAVE:
|
|
813
|
-
|
|
814
|
-
|
|
1543
|
+
{
|
|
1544
|
+
if (Platform.OS === 'android') {
|
|
1545
|
+
const subscription = this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_ROOM_LEAVE];
|
|
1546
|
+
// Removing ON_PIP_ROOM_LEAVE native listener
|
|
1547
|
+
if (subscription) {
|
|
1548
|
+
subscription.remove();
|
|
1549
|
+
this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_ROOM_LEAVE] = undefined;
|
|
1550
|
+
}
|
|
1551
|
+
// Removing App Delegate listener
|
|
1552
|
+
this.onPIPRoomLeaveDelegate = null;
|
|
1553
|
+
}
|
|
1554
|
+
break;
|
|
1555
|
+
}
|
|
815
1556
|
default:
|
|
816
1557
|
}
|
|
817
1558
|
});
|
|
1559
|
+
/**
|
|
1560
|
+
* removes all the listeners
|
|
1561
|
+
*
|
|
1562
|
+
* @memberof HMSSDK
|
|
1563
|
+
*/
|
|
818
1564
|
_defineProperty(this, "removeAllListeners", () => {
|
|
819
1565
|
this.onPreviewDelegate = null;
|
|
820
1566
|
this.onJoinDelegate = null;
|
|
@@ -830,10 +1576,32 @@ export class HMSSDK {
|
|
|
830
1576
|
this.onChangeTrackStateRequestDelegate = null;
|
|
831
1577
|
this.onRemovedFromRoomDelegate = null;
|
|
832
1578
|
this.onPIPRoomLeaveDelegate = null;
|
|
1579
|
+
|
|
1580
|
+
// Getting list of all available `emitterSubscription` objects
|
|
1581
|
+
Object.values(this.emitterSubscriptions).filter(Boolean).forEach(emitterSubscription => {
|
|
1582
|
+
emitterSubscription.remove();
|
|
1583
|
+
});
|
|
1584
|
+
|
|
1585
|
+
// clearing reference of all `emitterSubscription` objects
|
|
1586
|
+
this.emitterSubscriptions = {};
|
|
833
1587
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Function REMOVE_ALL_LISTENER', {
|
|
834
1588
|
id: this.id
|
|
835
1589
|
});
|
|
836
1590
|
});
|
|
1591
|
+
/**
|
|
1592
|
+
* - Below are all the listeners that are connected to native side.
|
|
1593
|
+
*
|
|
1594
|
+
* - All of the are connected when build function is called, we can connect them to the app by
|
|
1595
|
+
* calling {@link addEventListener} with corresponding event type.
|
|
1596
|
+
*
|
|
1597
|
+
* - Before passing the data to the eventListener of the app these listeners encode the data in
|
|
1598
|
+
* ts classes for a proper structuring of the data.
|
|
1599
|
+
*
|
|
1600
|
+
* - Even When event listeners of the app are disconnected using {@link removeEventListener} or
|
|
1601
|
+
* {@link removeAllListeners} or not even connected in first place, these functions still run to
|
|
1602
|
+
* maintain the current state of the instance of {@link HMSSDK}.
|
|
1603
|
+
*
|
|
1604
|
+
*/
|
|
837
1605
|
_defineProperty(this, "onPreviewListener", data => {
|
|
838
1606
|
if (data.id !== this.id) {
|
|
839
1607
|
return;
|
|
@@ -866,11 +1634,13 @@ export class HMSSDK {
|
|
|
866
1634
|
}
|
|
867
1635
|
});
|
|
868
1636
|
_defineProperty(this, "onRoomListener", data => {
|
|
1637
|
+
var _getHmsRoomCache2;
|
|
869
1638
|
if (data.id !== this.id) {
|
|
870
1639
|
return;
|
|
871
1640
|
}
|
|
872
1641
|
const room = HMSEncoder.encodeHmsRoom(data.room, this.id);
|
|
873
1642
|
const type = data.type;
|
|
1643
|
+
(_getHmsRoomCache2 = getHmsRoomCache()) === null || _getHmsRoomCache2 === void 0 ? void 0 : _getHmsRoomCache2.updateRoomCache(data.room, data.type);
|
|
874
1644
|
if (this.onRoomDelegate) {
|
|
875
1645
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_ROOM_LISTENER_CALL', {
|
|
876
1646
|
room,
|
|
@@ -882,12 +1652,22 @@ export class HMSSDK {
|
|
|
882
1652
|
});
|
|
883
1653
|
}
|
|
884
1654
|
});
|
|
885
|
-
_defineProperty(this, "onPeerListener",
|
|
886
|
-
|
|
887
|
-
|
|
1655
|
+
_defineProperty(this, "onPeerListener", peerData => {
|
|
1656
|
+
var _getHmsPeersCache;
|
|
1657
|
+
const data = {
|
|
1658
|
+
peer: peerData,
|
|
1659
|
+
type: null
|
|
1660
|
+
};
|
|
1661
|
+
for (const ordinal of HMSPeerUpdateOrdinals.keys()) {
|
|
1662
|
+
if (ordinal in peerData) {
|
|
1663
|
+
data.peer.peerID = peerData[ordinal];
|
|
1664
|
+
data.type = ordinal;
|
|
1665
|
+
break;
|
|
1666
|
+
}
|
|
888
1667
|
}
|
|
889
|
-
const peer = HMSEncoder.encodeHmsPeer(data.peer
|
|
890
|
-
const type = data.type;
|
|
1668
|
+
const peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
1669
|
+
const type = HMSEncoder.encodeHmsPeerUpdate(data.type) || data.type;
|
|
1670
|
+
(_getHmsPeersCache = getHmsPeersCache()) === null || _getHmsPeersCache === void 0 ? void 0 : _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
|
|
891
1671
|
if (this.onPeerDelegate) {
|
|
892
1672
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_PEER_LISTENER_CALL', {
|
|
893
1673
|
peer,
|
|
@@ -900,12 +1680,16 @@ export class HMSSDK {
|
|
|
900
1680
|
}
|
|
901
1681
|
});
|
|
902
1682
|
_defineProperty(this, "onTrackListener", data => {
|
|
1683
|
+
var _getHmsPeersCache2;
|
|
903
1684
|
if (data.id !== this.id) {
|
|
904
1685
|
return;
|
|
905
1686
|
}
|
|
906
1687
|
const track = HMSEncoder.encodeHmsTrack(data.track, this.id);
|
|
907
|
-
const peer = HMSEncoder.encodeHmsPeer(data.peer
|
|
1688
|
+
const peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
908
1689
|
const type = data.type;
|
|
1690
|
+
(_getHmsPeersCache2 = getHmsPeersCache()) === null || _getHmsPeersCache2 === void 0 ? void 0 : _getHmsPeersCache2.updatePeerCache(data.peer.peerID, {
|
|
1691
|
+
track
|
|
1692
|
+
}, data.type);
|
|
909
1693
|
if (this.muteStatus && (data === null || data === void 0 ? void 0 : data.type) === 'TRACK_ADDED' && track.type === HMSTrackType.AUDIO) {
|
|
910
1694
|
this.setPlaybackForAllAudio(this.muteStatus);
|
|
911
1695
|
}
|
|
@@ -926,7 +1710,7 @@ export class HMSSDK {
|
|
|
926
1710
|
if (data.id !== this.id) {
|
|
927
1711
|
return;
|
|
928
1712
|
}
|
|
929
|
-
const message = HMSEncoder.encodeHMSMessage(data
|
|
1713
|
+
const message = HMSEncoder.encodeHMSMessage(data);
|
|
930
1714
|
if (this.onMessageDelegate) {
|
|
931
1715
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_MESSAGE_LISTENER_CALL', message);
|
|
932
1716
|
this.onMessageDelegate(message);
|
|
@@ -956,7 +1740,7 @@ export class HMSSDK {
|
|
|
956
1740
|
return;
|
|
957
1741
|
}
|
|
958
1742
|
if (this.onRoleChangeRequestDelegate) {
|
|
959
|
-
const encodedRoleChangeRequest = HMSEncoder.encodeHmsRoleChangeRequest(data
|
|
1743
|
+
const encodedRoleChangeRequest = HMSEncoder.encodeHmsRoleChangeRequest(data);
|
|
960
1744
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_ROLE_CHANGE_LISTENER_CALL', encodedRoleChangeRequest);
|
|
961
1745
|
this.onRoleChangeRequestDelegate(encodedRoleChangeRequest);
|
|
962
1746
|
}
|
|
@@ -966,7 +1750,7 @@ export class HMSSDK {
|
|
|
966
1750
|
return;
|
|
967
1751
|
}
|
|
968
1752
|
if (this.onChangeTrackStateRequestDelegate) {
|
|
969
|
-
const encodedRoleChangeRequest = HMSEncoder.encodeHmsChangeTrackStateRequest(data
|
|
1753
|
+
const encodedRoleChangeRequest = HMSEncoder.encodeHmsChangeTrackStateRequest(data);
|
|
970
1754
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_CHANGE_TRACK_STATE_REQUEST_LISTENER_CALL', encodedRoleChangeRequest);
|
|
971
1755
|
this.onChangeTrackStateRequestDelegate(encodedRoleChangeRequest);
|
|
972
1756
|
}
|
|
@@ -975,10 +1759,11 @@ export class HMSSDK {
|
|
|
975
1759
|
if (data.id !== this.id) {
|
|
976
1760
|
return;
|
|
977
1761
|
}
|
|
1762
|
+
this.roomLeaveCleanup();
|
|
978
1763
|
if (this.onRemovedFromRoomDelegate) {
|
|
979
1764
|
let requestedBy = null;
|
|
980
1765
|
if (data.requestedBy) {
|
|
981
|
-
requestedBy = HMSEncoder.encodeHmsPeer(data.requestedBy
|
|
1766
|
+
requestedBy = HMSEncoder.encodeHmsPeer(data.requestedBy);
|
|
982
1767
|
}
|
|
983
1768
|
const reason = data.reason;
|
|
984
1769
|
const roomEnded = data.roomEnded;
|
|
@@ -1032,7 +1817,7 @@ export class HMSSDK {
|
|
|
1032
1817
|
return;
|
|
1033
1818
|
}
|
|
1034
1819
|
let localAudioStats = new HMSLocalAudioStats(data.localAudioStats);
|
|
1035
|
-
let peer = HMSEncoder.encodeHmsPeer(data.peer
|
|
1820
|
+
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
1036
1821
|
let track = HMSEncoder.encodeHmsLocalAudioTrack(data.track, this.id);
|
|
1037
1822
|
if (this.onLocalAudioStatsDelegate) {
|
|
1038
1823
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onLocalAudioStatsListener_CALL', {
|
|
@@ -1054,7 +1839,7 @@ export class HMSSDK {
|
|
|
1054
1839
|
return;
|
|
1055
1840
|
}
|
|
1056
1841
|
let localVideoStats = new HMSLocalVideoStats(data.localVideoStats);
|
|
1057
|
-
let peer = HMSEncoder.encodeHmsPeer(data.peer
|
|
1842
|
+
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
1058
1843
|
let track = HMSEncoder.encodeHmsLocalVideoTrack(data.track, this.id);
|
|
1059
1844
|
if (this.onLocalVideoStatsDelegate) {
|
|
1060
1845
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onLocalVideoStatsListener_CALL', {
|
|
@@ -1076,7 +1861,7 @@ export class HMSSDK {
|
|
|
1076
1861
|
return;
|
|
1077
1862
|
}
|
|
1078
1863
|
let remoteAudioStats = new HMSRemoteAudioStats(data.remoteAudioStats);
|
|
1079
|
-
let peer = HMSEncoder.encodeHmsPeer(data.peer
|
|
1864
|
+
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
1080
1865
|
let track = HMSEncoder.encodeHmsRemoteAudioTrack(data.track, this.id);
|
|
1081
1866
|
if (this.onRemoteAudioStatsDelegate) {
|
|
1082
1867
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onRemoteAudioStatsListener_CALL', {
|
|
@@ -1098,7 +1883,7 @@ export class HMSSDK {
|
|
|
1098
1883
|
return;
|
|
1099
1884
|
}
|
|
1100
1885
|
let remoteVideoStats = new HMSRemoteVideoStats(data.remoteVideoStats);
|
|
1101
|
-
let peer = HMSEncoder.encodeHmsPeer(data.peer
|
|
1886
|
+
let peer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
1102
1887
|
let track = HMSEncoder.encodeHmsRemoteVideoTrack(data.track, this.id);
|
|
1103
1888
|
if (this.onRemoteVideoStatsDelegate) {
|
|
1104
1889
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onRemoteVideoStatsListener_CALL', {
|
|
@@ -1127,12 +1912,10 @@ export class HMSSDK {
|
|
|
1127
1912
|
}
|
|
1128
1913
|
});
|
|
1129
1914
|
_defineProperty(this, "onPIPRoomLeaveListener", data => {
|
|
1130
|
-
var _this$appStateSubscri2;
|
|
1131
1915
|
if (data.id !== this.id) {
|
|
1132
1916
|
return;
|
|
1133
1917
|
}
|
|
1134
|
-
this.
|
|
1135
|
-
this === null || this === void 0 ? void 0 : (_this$appStateSubscri2 = this.appStateSubscription) === null || _this$appStateSubscri2 === void 0 ? void 0 : _this$appStateSubscri2.remove();
|
|
1918
|
+
this.roomLeaveCleanup();
|
|
1136
1919
|
if (this.onPIPRoomLeaveDelegate) {
|
|
1137
1920
|
logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onPIPRoomLeave_CALL', data);
|
|
1138
1921
|
this.onPIPRoomLeaveDelegate({
|
|
@@ -1182,7 +1965,6 @@ export class HMSSDK {
|
|
|
1182
1965
|
logSettings: params === null || params === void 0 ? void 0 : params.logSettings
|
|
1183
1966
|
});
|
|
1184
1967
|
HmsSdk = new HMSSDK(id);
|
|
1185
|
-
HmsSdk.attachListeners();
|
|
1186
1968
|
return HmsSdk;
|
|
1187
1969
|
}
|
|
1188
1970
|
|
|
@@ -1194,13 +1976,6 @@ export class HMSSDK {
|
|
|
1194
1976
|
static getLogger() {
|
|
1195
1977
|
return getLogger();
|
|
1196
1978
|
}
|
|
1197
|
-
|
|
1198
|
-
/**
|
|
1199
|
-
* - Updates the logger for this instance of HMSSDK
|
|
1200
|
-
* @param {HMSLogger} hmsLogger
|
|
1201
|
-
* @memberof HMSSDK
|
|
1202
|
-
*/
|
|
1203
|
-
|
|
1204
1979
|
async isPipModeSupported() {
|
|
1205
1980
|
return HMSManager.handlePipActions('isPipModeSupported', {
|
|
1206
1981
|
id: this.id
|