@100mslive/react-native-hms 2.0.0-alpha.0 → 2.0.0-alpha.1
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 +21 -15
- package/android/build.gradle +95 -48
- package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +8 -10
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +177 -3
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +149 -29
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManagerImpl.kt +185 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +80 -20
- package/android/src/main/java/com/reactnativehmssdk/{HMSManager.kt → HMSManagerImpl.kt} +517 -145
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +503 -312
- package/android/src/main/java/com/reactnativehmssdk/HMSReactNativeEvent.kt +29 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManagerImpl.kt +119 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +64 -12
- package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +9 -9
- package/android/src/main/java/com/reactnativehmssdk/HmssdkPackage.kt +44 -8
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityDecoder.kt +435 -0
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityHelper.kt +353 -0
- package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSRNInteractivityCenter.kt +245 -0
- package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +13 -3
- package/android/src/newarch/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +128 -0
- package/android/src/newarch/java/com/reactnativehmssdk/HMSManager.kt +332 -0
- package/android/src/newarch/java/com/reactnativehmssdk/HMSSDKViewManager.kt +102 -0
- package/android/src/oldarch/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +61 -0
- package/android/src/oldarch/java/com/reactnativehmssdk/HMSManager.kt +351 -0
- package/android/src/oldarch/java/com/reactnativehmssdk/HMSSDKViewManager.kt +87 -0
- package/ios/HMSConstants.swift +4 -0
- package/ios/HMSDecoder.swift +154 -18
- package/ios/HMSHLSPlayerComponentView.mm +325 -0
- package/ios/HMSHLSPlayerManager.m +16 -0
- package/ios/HMSHLSPlayerManager.swift +236 -70
- package/ios/HMSHelper.swift +126 -14
- package/ios/HMSInteractivityDecoder.swift +314 -0
- package/ios/HMSInteractivityHelper.swift +169 -0
- package/ios/HMSManager.m +203 -10
- package/ios/HMSManager.mm +365 -0
- package/ios/HMSManager.swift +431 -87
- package/ios/HMSRNInteractivityCenter.swift +161 -0
- package/ios/HMSRNSDK.swift +961 -134
- package/ios/HMSView.m +9 -0
- package/ios/HMSView.swift +45 -16
- package/ios/HMSViewComponentView.mm +229 -0
- package/ios/PIPMode/HMSPipModel.swift +18 -0
- package/ios/PIPMode/HMSPipView.swift +36 -0
- package/ios/PIPMode/HMSSampleBufferSwiftUIView.swift +45 -0
- package/lib/commonjs/classes/HMSAudioCodec.js +1 -2
- package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioDevice.js +10 -2
- package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioFilePlayerNode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixerSource.js +3 -3
- package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixingMode.js +12 -2
- package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMode.js +1 -2
- package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioNode.js +3 -3
- package/lib/commonjs/classes/HMSAudioNode.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioSettings.js +3 -3
- package/lib/commonjs/classes/HMSAudioSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrack.js +9 -0
- package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrackSettings.js +12 -5
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSBrowserRecordingState.js +5 -3
- package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraControl.js +3 -4
- package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraFacing.js +10 -2
- package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
- package/lib/commonjs/classes/HMSChangeTrackStateRequest.js +3 -3
- package/lib/commonjs/classes/HMSChangeTrackStateRequest.js.map +1 -1
- package/lib/commonjs/classes/HMSConfig.js +30 -3
- package/lib/commonjs/classes/HMSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSConstants.js +1 -2
- package/lib/commonjs/classes/HMSConstants.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +57 -14
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSEventEmitter.js +1 -2
- package/lib/commonjs/classes/HMSEventEmitter.js.map +1 -1
- package/lib/commonjs/classes/HMSException.js +21 -3
- package/lib/commonjs/classes/HMSException.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSConfig.js +3 -3
- package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js +3 -3
- package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSPlaylistType.js +12 -0
- package/lib/commonjs/classes/HMSHLSPlaylistType.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSRecordingConfig.js +3 -3
- package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSRecordingState.js +7 -7
- package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSStreamingState.js +9 -3
- package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSHLSTimedMetadata.js +2 -0
- package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -0
- package/lib/commonjs/classes/HMSHLSVariant.js +5 -3
- package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
- package/lib/commonjs/classes/HMSHelper.js.map +1 -1
- package/lib/commonjs/classes/HMSIOSAudioMode.js +16 -2
- package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
- package/lib/commonjs/classes/HMSInteractivityCenter.js +174 -0
- package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -0
- package/lib/commonjs/classes/HMSInteractivityEncoder.js +83 -0
- package/lib/commonjs/classes/HMSInteractivityEncoder.js.map +1 -0
- package/lib/commonjs/classes/HMSLayer.js +1 -2
- package/lib/commonjs/classes/HMSLayer.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalAudioStats.js +3 -3
- package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalAudioTrack.js +3 -3
- package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalPeer.js +3 -3
- package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoStats.js +3 -3
- package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js +3 -3
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLogAlarmManager.js +13 -2
- package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/commonjs/classes/HMSLogLevel.js +13 -2
- package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
- package/lib/commonjs/classes/HMSLogSettings.js +17 -3
- package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSLogger.js +4 -5
- package/lib/commonjs/classes/HMSLogger.js.map +1 -1
- package/lib/commonjs/classes/HMSMessage.js +3 -3
- package/lib/commonjs/classes/HMSMessage.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageRecipient.js +3 -3
- package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -1
- package/lib/commonjs/classes/HMSMessageRecipientType.js +1 -2
- package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
- package/lib/commonjs/classes/HMSMicNode.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventEmitter.js +4 -6
- package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventListener.js +3 -4
- package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -1
- package/lib/commonjs/classes/HMSNetworkQuality.js +14 -3
- package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +158 -0
- package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -0
- package/lib/commonjs/classes/HMSPIPConfig.js +6 -0
- package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -0
- package/lib/commonjs/classes/HMSPIPListenerActions.js +10 -2
- package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +186 -5
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerListIterator.js +25 -7
- package/lib/commonjs/classes/HMSPeerListIterator.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerListIteratorOptions.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerType.js +24 -0
- package/lib/commonjs/classes/HMSPeerType.js.map +1 -0
- package/lib/commonjs/classes/HMSPeerUpdate.js +2 -4
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js +6 -7
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
- package/lib/commonjs/classes/HMSPermissions.js +11 -3
- package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
- package/lib/commonjs/classes/HMSPollsListenerActions.js +11 -0
- package/lib/commonjs/classes/HMSPollsListenerActions.js.map +1 -0
- package/lib/commonjs/classes/HMSPublishSettings.js +3 -3
- package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSQualityLimitationReason.js +1 -2
- package/lib/commonjs/classes/HMSQualityLimitationReason.js.map +1 -1
- package/lib/commonjs/classes/HMSQualityLimitationReasons.js +3 -3
- package/lib/commonjs/classes/HMSQualityLimitationReasons.js.map +1 -1
- package/lib/commonjs/classes/HMSRTCStats.js +3 -3
- package/lib/commonjs/classes/HMSRTCStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRTCStatsReport.js +3 -3
- package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -1
- package/lib/commonjs/classes/HMSRTMPConfig.js +17 -3
- package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSRecordingState.js +17 -0
- package/lib/commonjs/classes/HMSRecordingState.js.map +1 -0
- package/lib/commonjs/classes/HMSRemoteAudioStats.js +3 -3
- package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js +3 -3
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js +3 -3
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoStats.js +3 -3
- package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js +3 -3
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRole.js +20 -3
- package/lib/commonjs/classes/HMSRole.js.map +1 -1
- package/lib/commonjs/classes/HMSRoleChangeRequest.js +3 -3
- package/lib/commonjs/classes/HMSRoleChangeRequest.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js +17 -4
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomCache.js +13 -7
- package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomUpdate.js +2 -2
- package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpStreamingState.js +5 -5
- package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js +16 -3
- package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +1313 -327
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
- package/lib/commonjs/classes/HMSServerRecordingState.js +5 -3
- package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +20 -23
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js +3 -3
- package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerSettings.js +3 -3
- package/lib/commonjs/classes/HMSSimulcastLayerSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js +3 -3
- package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettings.js +3 -3
- package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js +3 -3
- package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js.map +1 -1
- package/lib/commonjs/classes/HMSSpeaker.js +3 -3
- package/lib/commonjs/classes/HMSSpeaker.js.map +1 -1
- package/lib/commonjs/classes/HMSStreamingState.js +15 -0
- package/lib/commonjs/classes/HMSStreamingState.js.map +1 -0
- package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js +3 -3
- package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js.map +1 -1
- package/lib/commonjs/classes/HMSSubscribeSettings.js +3 -3
- package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrack.js +16 -3
- package/lib/commonjs/classes/HMSTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettings.js +13 -3
- package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js +10 -2
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSource.js +11 -2
- package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackType.js +8 -2
- package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackUpdate.js +1 -2
- package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +44 -5
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoCodec.js +1 -2
- package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoResolution.js +3 -3
- package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoSettings.js +3 -3
- package/lib/commonjs/classes/HMSVideoSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js +20 -3
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +18 -7
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoViewMode.js +1 -2
- package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +77 -28
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js +6 -0
- package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPoll.js +6 -0
- package/lib/commonjs/classes/polls/HMSPoll.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollCategory.js +12 -0
- package/lib/commonjs/classes/polls/HMSPollCategory.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestion.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestion.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionAnswer.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionAnswer.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOption.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOption.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOptionCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionOptionCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionQuizOptionCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionQuizOptionCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponse.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponse.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseCreateParams.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseCreateParams.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseResult.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResponseResult.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResult.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionResult.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionType.js +14 -0
- package/lib/commonjs/classes/polls/HMSPollQuestionType.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollResponsePeerInfo.js +2 -0
- package/lib/commonjs/classes/polls/HMSPollResponsePeerInfo.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollResult.js +6 -0
- package/lib/commonjs/classes/polls/HMSPollResult.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollState.js +13 -0
- package/lib/commonjs/classes/polls/HMSPollState.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollType.js +12 -0
- package/lib/commonjs/classes/polls/HMSPollType.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollUpdateType.js +13 -0
- package/lib/commonjs/classes/polls/HMSPollUpdateType.js.map +1 -0
- package/lib/commonjs/classes/polls/HMSPollUserTrackingMode.js +13 -0
- package/lib/commonjs/classes/polls/HMSPollUserTrackingMode.js.map +1 -0
- package/lib/commonjs/classes/polls/PollLeaderboardResponse.js +6 -0
- package/lib/commonjs/classes/polls/PollLeaderboardResponse.js.map +1 -0
- package/lib/commonjs/classes/transcriptions/HMSTranscript.js +6 -0
- package/lib/commonjs/classes/transcriptions/HMSTranscript.js.map +1 -0
- package/lib/commonjs/classes/transcriptions/OnTranscriptionError.js +2 -0
- package/lib/commonjs/classes/transcriptions/OnTranscriptionError.js.map +1 -0
- package/lib/commonjs/classes/transcriptions/TranscriptionState.js +14 -0
- package/lib/commonjs/classes/transcriptions/TranscriptionState.js.map +1 -0
- package/lib/commonjs/classes/transcriptions/Transcriptions.js +6 -0
- package/lib/commonjs/classes/transcriptions/Transcriptions.js.map +1 -0
- package/lib/commonjs/classes/transcriptions/TranscriptionsMode.js +12 -0
- package/lib/commonjs/classes/transcriptions/TranscriptionsMode.js.map +1 -0
- package/lib/commonjs/classes/transcriptions/index.js +61 -0
- package/lib/commonjs/classes/transcriptions/index.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js +6 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js +11 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js +12 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js +12 -0
- package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/index.js +39 -0
- package/lib/commonjs/classes/whiteboard/index.js.map +1 -0
- package/lib/commonjs/classes/whiteboard/registerCallbacks.js +26 -0
- package/lib/commonjs/classes/whiteboard/registerCallbacks.js.map +1 -0
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +155 -49
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +5 -6
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js +26 -16
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js +22 -1
- package/lib/commonjs/components/HMSHLSPlayer/index.js.map +1 -1
- package/lib/commonjs/hooks/hmsviews.js +17 -0
- package/lib/commonjs/hooks/hmsviews.js.map +1 -0
- package/lib/commonjs/hooks/polls.js +17 -0
- package/lib/commonjs/hooks/polls.js.map +1 -0
- package/lib/commonjs/hooks/useHMSPeerUpdates.js +3 -5
- package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -1
- package/lib/commonjs/index.js +233 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/HMSManagerModule.js +10 -0
- package/lib/commonjs/modules/HMSManagerModule.js.map +1 -0
- package/lib/commonjs/specs/HMSHLSPlayerNativeComponent.js +75 -0
- package/lib/commonjs/specs/HMSHLSPlayerNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/HMSViewNativeComponent.js +55 -0
- package/lib/commonjs/specs/HMSViewNativeComponent.js.map +1 -0
- package/lib/commonjs/specs/NativeHMSManager.js +38 -0
- package/lib/commonjs/specs/NativeHMSManager.js.map +1 -0
- package/lib/commonjs/stores/hls-player-playback-slice.js +10 -0
- package/lib/commonjs/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/commonjs/stores/hls-player-stats-store.js +28 -17
- package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -1
- package/lib/commonjs/stores/hms-interactivity-store.js +21 -0
- package/lib/commonjs/stores/hms-interactivity-store.js.map +1 -0
- package/lib/commonjs/stores/hms-polls-slice.js +19 -0
- package/lib/commonjs/stores/hms-polls-slice.js.map +1 -0
- package/lib/commonjs/stores/hms-store.js +5 -6
- package/lib/commonjs/stores/hms-store.js.map +1 -1
- package/lib/commonjs/stores/hmsviews-slice.js +19 -0
- package/lib/commonjs/stores/hmsviews-slice.js.map +1 -0
- package/lib/commonjs/stores/types.js.map +1 -1
- package/lib/commonjs/types.js +4 -7
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/emitter/EventEmitter.js +23 -7
- package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -1
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js +3 -3
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js.map +1 -1
- package/lib/commonjs/utils/emitter/_EventSubscription.js +3 -3
- package/lib/commonjs/utils/emitter/_EventSubscription.js.map +1 -1
- package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js +3 -4
- package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js.map +1 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/keyboard.js +46 -0
- package/lib/commonjs/utils/keyboard.js.map +1 -0
- package/lib/commonjs/utils/notification.js +13 -0
- package/lib/commonjs/utils/notification.js.map +1 -0
- package/lib/commonjs/utils/windowController.js +30 -0
- package/lib/commonjs/utils/windowController.js.map +1 -0
- package/lib/module/classes/HMSAudioCodec.js.map +1 -1
- package/lib/module/classes/HMSAudioDevice.js +9 -0
- package/lib/module/classes/HMSAudioDevice.js.map +1 -1
- package/lib/module/classes/HMSAudioFilePlayerNode.js.map +1 -1
- package/lib/module/classes/HMSAudioMixerSource.js +3 -3
- package/lib/module/classes/HMSAudioMixerSource.js.map +1 -1
- package/lib/module/classes/HMSAudioMixingMode.js +11 -0
- package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
- package/lib/module/classes/HMSAudioMode.js.map +1 -1
- package/lib/module/classes/HMSAudioNode.js +3 -3
- package/lib/module/classes/HMSAudioNode.js.map +1 -1
- package/lib/module/classes/HMSAudioSettings.js +3 -3
- package/lib/module/classes/HMSAudioSettings.js.map +1 -1
- package/lib/module/classes/HMSAudioTrack.js +9 -0
- package/lib/module/classes/HMSAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSAudioTrackSettings.js +12 -5
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSBrowserRecordingState.js +5 -3
- package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/module/classes/HMSCameraControl.js +2 -3
- package/lib/module/classes/HMSCameraControl.js.map +1 -1
- package/lib/module/classes/HMSCameraFacing.js +9 -0
- package/lib/module/classes/HMSCameraFacing.js.map +1 -1
- package/lib/module/classes/HMSChangeTrackStateRequest.js +3 -3
- package/lib/module/classes/HMSChangeTrackStateRequest.js.map +1 -1
- package/lib/module/classes/HMSConfig.js +30 -3
- package/lib/module/classes/HMSConfig.js.map +1 -1
- package/lib/module/classes/HMSConstants.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +56 -13
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSEventEmitter.js.map +1 -1
- package/lib/module/classes/HMSException.js +21 -3
- package/lib/module/classes/HMSException.js.map +1 -1
- package/lib/module/classes/HMSHLSConfig.js +3 -3
- package/lib/module/classes/HMSHLSConfig.js.map +1 -1
- package/lib/module/classes/HMSHLSMeetingURLVariant.js +3 -3
- package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -1
- package/lib/module/classes/HMSHLSPlaylistType.js +6 -0
- package/lib/module/classes/HMSHLSPlaylistType.js.map +1 -0
- package/lib/module/classes/HMSHLSRecordingConfig.js +3 -3
- package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -1
- package/lib/module/classes/HMSHLSRecordingState.js +7 -7
- package/lib/module/classes/HMSHLSRecordingState.js.map +1 -1
- package/lib/module/classes/HMSHLSStreamingState.js +9 -3
- package/lib/module/classes/HMSHLSStreamingState.js.map +1 -1
- package/lib/module/classes/HMSHLSTimedMetadata.js +2 -0
- package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -0
- package/lib/module/classes/HMSHLSVariant.js +5 -3
- package/lib/module/classes/HMSHLSVariant.js.map +1 -1
- package/lib/module/classes/HMSHelper.js.map +1 -1
- package/lib/module/classes/HMSIOSAudioMode.js +15 -0
- package/lib/module/classes/HMSIOSAudioMode.js.map +1 -1
- package/lib/module/classes/HMSInteractivityCenter.js +166 -0
- package/lib/module/classes/HMSInteractivityCenter.js.map +1 -0
- package/lib/module/classes/HMSInteractivityEncoder.js +76 -0
- package/lib/module/classes/HMSInteractivityEncoder.js.map +1 -0
- package/lib/module/classes/HMSLayer.js.map +1 -1
- package/lib/module/classes/HMSLocalAudioStats.js +3 -3
- package/lib/module/classes/HMSLocalAudioStats.js.map +1 -1
- package/lib/module/classes/HMSLocalAudioTrack.js +3 -3
- package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSLocalPeer.js +3 -3
- package/lib/module/classes/HMSLocalPeer.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoStats.js +3 -3
- package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoTrack.js +3 -3
- package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSLogAlarmManager.js +12 -0
- package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/module/classes/HMSLogLevel.js +12 -0
- package/lib/module/classes/HMSLogLevel.js.map +1 -1
- package/lib/module/classes/HMSLogSettings.js +17 -3
- package/lib/module/classes/HMSLogSettings.js.map +1 -1
- package/lib/module/classes/HMSLogger.js +3 -3
- package/lib/module/classes/HMSLogger.js.map +1 -1
- package/lib/module/classes/HMSMessage.js +3 -3
- package/lib/module/classes/HMSMessage.js.map +1 -1
- package/lib/module/classes/HMSMessageRecipient.js +3 -3
- package/lib/module/classes/HMSMessageRecipient.js.map +1 -1
- package/lib/module/classes/HMSMessageRecipientType.js.map +1 -1
- package/lib/module/classes/HMSMicNode.js.map +1 -1
- package/lib/module/classes/HMSNativeEventEmitter.js +4 -6
- package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/module/classes/HMSNativeEventListener.js +1 -1
- package/lib/module/classes/HMSNativeEventListener.js.map +1 -1
- package/lib/module/classes/HMSNetworkQuality.js +14 -3
- package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
- package/lib/module/classes/HMSNoiseCancellationPlugin.js +152 -0
- package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -0
- package/lib/module/classes/HMSPIPConfig.js +2 -0
- package/lib/module/classes/HMSPIPConfig.js.map +1 -0
- package/lib/module/classes/HMSPIPListenerActions.js +9 -0
- package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +187 -5
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerListIterator.js +24 -6
- package/lib/module/classes/HMSPeerListIterator.js.map +1 -1
- package/lib/module/classes/HMSPeerListIteratorOptions.js.map +1 -1
- package/lib/module/classes/HMSPeerType.js +18 -0
- package/lib/module/classes/HMSPeerType.js.map +1 -0
- package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/module/classes/HMSPeersCache.js +4 -4
- package/lib/module/classes/HMSPeersCache.js.map +1 -1
- package/lib/module/classes/HMSPermissions.js +11 -3
- package/lib/module/classes/HMSPermissions.js.map +1 -1
- package/lib/module/classes/HMSPollsListenerActions.js +5 -0
- package/lib/module/classes/HMSPollsListenerActions.js.map +1 -0
- package/lib/module/classes/HMSPublishSettings.js +3 -3
- package/lib/module/classes/HMSPublishSettings.js.map +1 -1
- package/lib/module/classes/HMSQualityLimitationReason.js.map +1 -1
- package/lib/module/classes/HMSQualityLimitationReasons.js +3 -3
- package/lib/module/classes/HMSQualityLimitationReasons.js.map +1 -1
- package/lib/module/classes/HMSRTCStats.js +3 -3
- package/lib/module/classes/HMSRTCStats.js.map +1 -1
- package/lib/module/classes/HMSRTCStatsReport.js +3 -3
- package/lib/module/classes/HMSRTCStatsReport.js.map +1 -1
- package/lib/module/classes/HMSRTMPConfig.js +17 -3
- package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/module/classes/HMSRecordingState.js +11 -0
- package/lib/module/classes/HMSRecordingState.js.map +1 -0
- package/lib/module/classes/HMSRemoteAudioStats.js +3 -3
- package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioTrack.js +3 -3
- package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSRemotePeer.js +3 -3
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoStats.js +3 -3
- package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js +3 -3
- package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSRole.js +20 -3
- package/lib/module/classes/HMSRole.js.map +1 -1
- package/lib/module/classes/HMSRoleChangeRequest.js +3 -3
- package/lib/module/classes/HMSRoleChangeRequest.js.map +1 -1
- package/lib/module/classes/HMSRoom.js +17 -4
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSRoomCache.js +11 -4
- package/lib/module/classes/HMSRoomCache.js.map +1 -1
- package/lib/module/classes/HMSRoomUpdate.js +1 -0
- package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/module/classes/HMSRtmpStreamingState.js +5 -5
- package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
- package/lib/module/classes/HMSRtmpVideoResolution.js +16 -3
- package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +1314 -328
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
- package/lib/module/classes/HMSServerRecordingState.js +5 -3
- package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +19 -22
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/classes/HMSSimulcastLayerDefinition.js +3 -3
- package/lib/module/classes/HMSSimulcastLayerDefinition.js.map +1 -1
- package/lib/module/classes/HMSSimulcastLayerSettings.js +3 -3
- package/lib/module/classes/HMSSimulcastLayerSettings.js.map +1 -1
- package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js +3 -3
- package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -1
- package/lib/module/classes/HMSSimulcastSettings.js +3 -3
- package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/module/classes/HMSSimulcastSettingsPolicy.js +3 -3
- package/lib/module/classes/HMSSimulcastSettingsPolicy.js.map +1 -1
- package/lib/module/classes/HMSSpeaker.js +3 -3
- package/lib/module/classes/HMSSpeaker.js.map +1 -1
- package/lib/module/classes/HMSStreamingState.js +9 -0
- package/lib/module/classes/HMSStreamingState.js.map +1 -0
- package/lib/module/classes/HMSSubscribeDegradationPolicy.js +3 -3
- package/lib/module/classes/HMSSubscribeDegradationPolicy.js.map +1 -1
- package/lib/module/classes/HMSSubscribeSettings.js +3 -3
- package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/module/classes/HMSTrack.js +16 -3
- package/lib/module/classes/HMSTrack.js.map +1 -1
- package/lib/module/classes/HMSTrackSettings.js +13 -3
- package/lib/module/classes/HMSTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSTrackSettingsInitState.js +9 -0
- package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/module/classes/HMSTrackSource.js +10 -0
- package/lib/module/classes/HMSTrackSource.js.map +1 -1
- package/lib/module/classes/HMSTrackType.js +7 -0
- package/lib/module/classes/HMSTrackType.js.map +1 -1
- package/lib/module/classes/HMSTrackUpdate.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +43 -3
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HMSVideoCodec.js.map +1 -1
- package/lib/module/classes/HMSVideoResolution.js +3 -3
- package/lib/module/classes/HMSVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSVideoSettings.js +3 -3
- package/lib/module/classes/HMSVideoSettings.js.map +1 -1
- package/lib/module/classes/HMSVideoTrack.js +20 -3
- package/lib/module/classes/HMSVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +18 -7
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSVideoViewMode.js.map +1 -1
- package/lib/module/classes/HmsView.js +77 -25
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js +2 -0
- package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
- package/lib/module/classes/polls/HMSPoll.js +2 -0
- package/lib/module/classes/polls/HMSPoll.js.map +1 -0
- package/lib/module/classes/polls/HMSPollCategory.js +6 -0
- package/lib/module/classes/polls/HMSPollCategory.js.map +1 -0
- package/lib/module/classes/polls/HMSPollCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollLeaderboardEntry.js +2 -0
- package/lib/module/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
- package/lib/module/classes/polls/HMSPollLeaderboardSummary.js +2 -0
- package/lib/module/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestion.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestion.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionAnswer.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionAnswer.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionOption.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionOption.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionOptionCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionOptionCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionQuizOptionCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionQuizOptionCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResponse.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResponse.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseCreateParams.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseCreateParams.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseResult.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResponseResult.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionResult.js +2 -0
- package/lib/module/classes/polls/HMSPollQuestionResult.js.map +1 -0
- package/lib/module/classes/polls/HMSPollQuestionType.js +8 -0
- package/lib/module/classes/polls/HMSPollQuestionType.js.map +1 -0
- package/lib/module/classes/polls/HMSPollResponsePeerInfo.js +2 -0
- package/lib/module/classes/polls/HMSPollResponsePeerInfo.js.map +1 -0
- package/lib/module/classes/polls/HMSPollResult.js +2 -0
- package/lib/module/classes/polls/HMSPollResult.js.map +1 -0
- package/lib/module/classes/polls/HMSPollState.js +7 -0
- package/lib/module/classes/polls/HMSPollState.js.map +1 -0
- package/lib/module/classes/polls/HMSPollType.js +6 -0
- package/lib/module/classes/polls/HMSPollType.js.map +1 -0
- package/lib/module/classes/polls/HMSPollUpdateType.js +7 -0
- package/lib/module/classes/polls/HMSPollUpdateType.js.map +1 -0
- package/lib/module/classes/polls/HMSPollUserTrackingMode.js +7 -0
- package/lib/module/classes/polls/HMSPollUserTrackingMode.js.map +1 -0
- package/lib/module/classes/polls/PollLeaderboardResponse.js +2 -0
- package/lib/module/classes/polls/PollLeaderboardResponse.js.map +1 -0
- package/lib/module/classes/transcriptions/HMSTranscript.js +2 -0
- package/lib/module/classes/transcriptions/HMSTranscript.js.map +1 -0
- package/lib/module/classes/transcriptions/OnTranscriptionError.js +2 -0
- package/lib/module/classes/transcriptions/OnTranscriptionError.js.map +1 -0
- package/lib/module/classes/transcriptions/TranscriptionState.js +8 -0
- package/lib/module/classes/transcriptions/TranscriptionState.js.map +1 -0
- package/lib/module/classes/transcriptions/Transcriptions.js +2 -0
- package/lib/module/classes/transcriptions/Transcriptions.js.map +1 -0
- package/lib/module/classes/transcriptions/TranscriptionsMode.js +6 -0
- package/lib/module/classes/transcriptions/TranscriptionsMode.js.map +1 -0
- package/lib/module/classes/transcriptions/index.js +6 -0
- package/lib/module/classes/transcriptions/index.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboard.js +2 -0
- package/lib/module/classes/whiteboard/HMSWhiteboard.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js +5 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardState.js +6 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js +6 -0
- package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
- package/lib/module/classes/whiteboard/index.js +4 -0
- package/lib/module/classes/whiteboard/index.js.map +1 -0
- package/lib/module/classes/whiteboard/registerCallbacks.js +18 -0
- package/lib/module/classes/whiteboard/registerCallbacks.js.map +1 -0
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +157 -49
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +3 -3
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/hooks.js +16 -4
- package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/index.js +1 -1
- package/lib/module/components/HMSHLSPlayer/index.js.map +1 -1
- package/lib/module/hooks/hmsviews.js +12 -0
- package/lib/module/hooks/hmsviews.js.map +1 -0
- package/lib/module/hooks/polls.js +12 -0
- package/lib/module/hooks/polls.js.map +1 -0
- package/lib/module/hooks/useHMSPeerUpdates.js +1 -2
- package/lib/module/hooks/useHMSPeerUpdates.js.map +1 -1
- package/lib/module/index.js +29 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/HMSManagerModule.js +3 -0
- package/lib/module/modules/HMSManagerModule.js.map +1 -0
- package/lib/module/specs/HMSHLSPlayerNativeComponent.js +69 -0
- package/lib/module/specs/HMSHLSPlayerNativeComponent.js.map +1 -0
- package/lib/module/specs/HMSViewNativeComponent.js +49 -0
- package/lib/module/specs/HMSViewNativeComponent.js.map +1 -0
- package/lib/module/specs/NativeHMSManager.js +33 -0
- package/lib/module/specs/NativeHMSManager.js.map +1 -0
- package/lib/module/stores/hls-player-playback-slice.js +10 -0
- package/lib/module/stores/hls-player-playback-slice.js.map +1 -1
- package/lib/module/stores/hls-player-stats-store.js +27 -15
- package/lib/module/stores/hls-player-stats-store.js.map +1 -1
- package/lib/module/stores/hms-interactivity-store.js +15 -0
- package/lib/module/stores/hms-interactivity-store.js.map +1 -0
- package/lib/module/stores/hms-polls-slice.js +12 -0
- package/lib/module/stores/hms-polls-slice.js.map +1 -0
- package/lib/module/stores/hms-store.js +5 -5
- package/lib/module/stores/hms-store.js.map +1 -1
- package/lib/module/stores/hmsviews-slice.js +12 -0
- package/lib/module/stores/hmsviews-slice.js.map +1 -0
- package/lib/module/stores/types.js.map +1 -1
- package/lib/module/types.js +3 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/emitter/EventEmitter.js +23 -7
- package/lib/module/utils/emitter/EventEmitter.js.map +1 -1
- package/lib/module/utils/emitter/_EmitterSubscription.js +3 -3
- package/lib/module/utils/emitter/_EmitterSubscription.js.map +1 -1
- package/lib/module/utils/emitter/_EventSubscription.js +3 -3
- package/lib/module/utils/emitter/_EventSubscription.js.map +1 -1
- package/lib/module/utils/emitter/_EventSubscriptionVendor.js +3 -4
- package/lib/module/utils/emitter/_EventSubscriptionVendor.js.map +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/keyboard.js +38 -0
- package/lib/module/utils/keyboard.js.map +1 -0
- package/lib/module/utils/notification.js +5 -0
- package/lib/module/utils/notification.js.map +1 -0
- package/lib/module/utils/windowController.js +22 -0
- package/lib/module/utils/windowController.js.map +1 -0
- package/lib/typescript/classes/HMSAudioDevice.d.ts +14 -0
- package/lib/typescript/classes/HMSAudioMixingMode.d.ts +11 -0
- package/lib/typescript/classes/HMSAudioTrack.d.ts +9 -0
- package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +9 -0
- package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +3 -0
- package/lib/typescript/classes/HMSCameraFacing.d.ts +11 -0
- package/lib/typescript/classes/HMSConfig.d.ts +27 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +5 -0
- package/lib/typescript/classes/HMSException.d.ts +18 -0
- package/lib/typescript/classes/HMSHLSPlaylistType.d.ts +4 -0
- package/lib/typescript/classes/HMSHLSRecordingState.d.ts +6 -4
- package/lib/typescript/classes/HMSHLSStreamingState.d.ts +8 -0
- package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +16 -0
- package/lib/typescript/classes/HMSHLSVariant.d.ts +3 -0
- package/lib/typescript/classes/HMSIOSAudioMode.d.ts +15 -0
- package/lib/typescript/classes/HMSInteractivityCenter.d.ts +62 -0
- package/lib/typescript/classes/HMSInteractivityEncoder.d.ts +9 -0
- package/lib/typescript/classes/HMSLogAlarmManager.d.ts +12 -0
- package/lib/typescript/classes/HMSLogLevel.d.ts +12 -0
- package/lib/typescript/classes/HMSLogSettings.d.ts +14 -0
- package/lib/typescript/classes/HMSNetworkQuality.d.ts +11 -0
- package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +87 -0
- package/lib/typescript/classes/HMSPIPConfig.d.ts +47 -0
- package/lib/typescript/classes/HMSPIPListenerActions.d.ts +17 -0
- package/lib/typescript/classes/HMSPeer.d.ts +144 -1
- package/lib/typescript/classes/HMSPeerListIterator.d.ts +3 -1
- package/lib/typescript/classes/HMSPeerListIteratorOptions.d.ts +19 -0
- package/lib/typescript/classes/HMSPeerType.d.ts +16 -0
- package/lib/typescript/classes/HMSPeersCache.d.ts +2 -0
- package/lib/typescript/classes/HMSPermissions.d.ts +18 -0
- package/lib/typescript/classes/HMSPollsListenerActions.d.ts +3 -0
- package/lib/typescript/classes/HMSRTMPConfig.d.ts +14 -0
- package/lib/typescript/classes/HMSRecordingState.d.ts +9 -0
- package/lib/typescript/classes/HMSRole.d.ts +17 -0
- package/lib/typescript/classes/HMSRoom.d.ts +3 -0
- package/lib/typescript/classes/HMSRoomUpdate.d.ts +2 -1
- package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +3 -2
- package/lib/typescript/classes/HMSRtmpVideoResolution.d.ts +13 -0
- package/lib/typescript/classes/HMSSDK.d.ts +1123 -249
- package/lib/typescript/classes/HMSServerRecordingState.d.ts +3 -0
- package/lib/typescript/classes/HMSSessionStore.d.ts +23 -22
- package/lib/typescript/classes/HMSStreamingState.d.ts +7 -0
- package/lib/typescript/classes/HMSTrack.d.ts +13 -0
- package/lib/typescript/classes/HMSTrackSettings.d.ts +10 -0
- package/lib/typescript/classes/HMSTrackSettingsInitState.d.ts +11 -0
- package/lib/typescript/classes/HMSTrackSource.d.ts +10 -0
- package/lib/typescript/classes/HMSTrackType.d.ts +7 -0
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +290 -3
- package/lib/typescript/classes/HMSVideoTrack.d.ts +17 -0
- package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +23 -2
- package/lib/typescript/classes/HmsView.d.ts +16 -0
- package/lib/typescript/classes/polls/DecodedPollLeaderboardResponse.d.ts +37 -0
- package/lib/typescript/classes/polls/HMSPoll.d.ts +73 -0
- package/lib/typescript/classes/polls/HMSPollCategory.d.ts +10 -0
- package/lib/typescript/classes/polls/HMSPollCreateParams.d.ts +6 -0
- package/lib/typescript/classes/polls/HMSPollLeaderboardEntry.d.ts +9 -0
- package/lib/typescript/classes/polls/HMSPollLeaderboardSummary.d.ts +7 -0
- package/lib/typescript/classes/polls/HMSPollQuestion.d.ts +61 -0
- package/lib/typescript/classes/polls/HMSPollQuestionAnswer.d.ts +17 -0
- package/lib/typescript/classes/polls/HMSPollQuestionCreateParams.d.ts +25 -0
- package/lib/typescript/classes/polls/HMSPollQuestionOption.d.ts +21 -0
- package/lib/typescript/classes/polls/HMSPollQuestionOptionCreateParams.d.ts +3 -0
- package/lib/typescript/classes/polls/HMSPollQuestionQuizOptionCreateParams.d.ts +4 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResponse.d.ts +47 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResponseCreateParams.d.ts +2 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResponseResult.d.ts +17 -0
- package/lib/typescript/classes/polls/HMSPollQuestionResult.d.ts +29 -0
- package/lib/typescript/classes/polls/HMSPollQuestionType.d.ts +18 -0
- package/lib/typescript/classes/polls/HMSPollResponsePeerInfo.d.ts +21 -0
- package/lib/typescript/classes/polls/HMSPollResult.d.ts +22 -0
- package/lib/typescript/classes/polls/HMSPollState.d.ts +14 -0
- package/lib/typescript/classes/polls/HMSPollType.d.ts +4 -0
- package/lib/typescript/classes/polls/HMSPollUpdateType.d.ts +5 -0
- package/lib/typescript/classes/polls/HMSPollUserTrackingMode.d.ts +14 -0
- package/lib/typescript/classes/polls/PollLeaderboardResponse.d.ts +7 -0
- package/lib/typescript/classes/transcriptions/HMSTranscript.d.ts +8 -0
- package/lib/typescript/classes/transcriptions/OnTranscriptionError.d.ts +4 -0
- package/lib/typescript/classes/transcriptions/TranscriptionState.d.ts +6 -0
- package/lib/typescript/classes/transcriptions/Transcriptions.d.ts +12 -0
- package/lib/typescript/classes/transcriptions/TranscriptionsMode.d.ts +4 -0
- package/lib/typescript/classes/transcriptions/index.d.ts +5 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboard.d.ts +10 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardListenerActions.d.ts +3 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardState.d.ts +4 -0
- package/lib/typescript/classes/whiteboard/HMSWhiteboardUpdateType.d.ts +4 -0
- package/lib/typescript/classes/whiteboard/index.d.ts +3 -0
- package/lib/typescript/classes/whiteboard/registerCallbacks.d.ts +8 -0
- package/lib/typescript/components/HMSHLSPlayer/HMSHLSPlayer.d.ts +6 -0
- package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +11 -9
- package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +5 -0
- package/lib/typescript/components/HMSHLSPlayer/index.d.ts +1 -1
- package/lib/typescript/hooks/hmsviews.d.ts +3 -0
- package/lib/typescript/hooks/polls.d.ts +3 -0
- package/lib/typescript/index.d.ts +29 -2
- package/lib/typescript/specs/HMSHLSPlayerNativeComponent.d.ts +115 -0
- package/lib/typescript/specs/HMSViewNativeComponent.d.ts +97 -0
- package/lib/typescript/specs/NativeHMSManager.d.ts +147 -0
- package/lib/typescript/stores/hls-player-stats-store.d.ts +4 -3
- package/lib/typescript/stores/hms-interactivity-store.d.ts +9 -0
- package/lib/typescript/stores/hms-polls-slice.d.ts +5 -0
- package/lib/typescript/stores/hms-store.d.ts +4 -3
- package/lib/typescript/stores/hmsviews-slice.d.ts +5 -0
- package/lib/typescript/stores/types.d.ts +27 -3
- package/lib/typescript/types.d.ts +18 -5
- package/lib/typescript/utils/emitter/EventEmitter.d.ts +7 -0
- package/lib/typescript/utils/keyboard.d.ts +16 -0
- package/lib/typescript/utils/notification.d.ts +5 -0
- package/lib/typescript/utils/windowController.d.ts +10 -0
- package/package.json +49 -7
- package/react-native-hms.podspec +56 -2
- package/sdk-versions.json +4 -3
- package/src/classes/HMSAudioDevice.ts +18 -0
- package/src/classes/HMSAudioMixingMode.ts +11 -0
- package/src/classes/HMSAudioTrack.ts +9 -0
- package/src/classes/HMSAudioTrackSettings.ts +11 -0
- package/src/classes/HMSBrowserRecordingState.ts +4 -0
- package/src/classes/HMSCameraControl.ts +1 -1
- package/src/classes/HMSCameraFacing.ts +11 -0
- package/src/classes/HMSConfig.ts +27 -0
- package/src/classes/HMSEncoder.ts +57 -4
- package/src/classes/HMSException.ts +18 -0
- package/src/classes/HMSHLSPlaylistType.ts +4 -0
- package/src/classes/HMSHLSRecordingState.ts +9 -7
- package/src/classes/HMSHLSStreamingState.ts +15 -1
- package/src/classes/HMSHLSTimedMetadata.ts +16 -0
- package/src/classes/HMSHLSVariant.ts +5 -0
- package/src/classes/HMSIOSAudioMode.ts +15 -0
- package/src/classes/HMSInteractivityCenter.ts +246 -0
- package/src/classes/HMSInteractivityEncoder.ts +92 -0
- package/src/classes/HMSLogAlarmManager.ts +12 -0
- package/src/classes/HMSLogLevel.ts +12 -0
- package/src/classes/HMSLogSettings.ts +14 -0
- package/src/classes/HMSNativeEventEmitter.ts +1 -7
- package/src/classes/HMSNativeEventListener.ts +1 -1
- package/src/classes/HMSNetworkQuality.ts +11 -0
- package/src/classes/HMSNoiseCancellationPlugin.ts +162 -0
- package/src/classes/HMSPIPConfig.ts +54 -0
- package/src/classes/HMSPIPListenerActions.ts +18 -0
- package/src/classes/HMSPeer.ts +193 -3
- package/src/classes/HMSPeerListIterator.ts +29 -7
- package/src/classes/HMSPeerListIteratorOptions.ts +21 -0
- package/src/classes/HMSPeerType.ts +20 -0
- package/src/classes/HMSPeersCache.ts +3 -1
- package/src/classes/HMSPermissions.ts +25 -0
- package/src/classes/HMSPollsListenerActions.ts +3 -0
- package/src/classes/HMSRTMPConfig.ts +14 -0
- package/src/classes/HMSRecordingState.ts +9 -0
- package/src/classes/HMSRole.ts +17 -0
- package/src/classes/HMSRoom.ts +27 -0
- package/src/classes/HMSRoomCache.ts +10 -1
- package/src/classes/HMSRoomUpdate.ts +1 -0
- package/src/classes/HMSRtmpStreamingState.ts +4 -3
- package/src/classes/HMSRtmpVideoResolution.ts +13 -0
- package/src/classes/HMSSDK.tsx +1379 -345
- package/src/classes/HMSServerRecordingState.ts +4 -0
- package/src/classes/HMSSessionStore.ts +34 -45
- package/src/classes/HMSStreamingState.ts +7 -0
- package/src/classes/HMSTrack.ts +13 -0
- package/src/classes/HMSTrackSettings.ts +10 -0
- package/src/classes/HMSTrackSettingsInitState.ts +11 -0
- package/src/classes/HMSTrackSource.ts +10 -0
- package/src/classes/HMSTrackType.ts +7 -0
- package/src/classes/HMSUpdateListenerActions.ts +313 -3
- package/src/classes/HMSVideoTrack.ts +17 -0
- package/src/classes/HMSVideoTrackSettings.ts +27 -2
- package/src/classes/HmsView.tsx +92 -57
- package/src/classes/polls/DecodedPollLeaderboardResponse.ts +43 -0
- package/src/classes/polls/HMSPoll.ts +99 -0
- package/src/classes/polls/HMSPollCategory.ts +11 -0
- package/src/classes/polls/HMSPollCreateParams.ts +19 -0
- package/src/classes/polls/HMSPollLeaderboardEntry.ts +10 -0
- package/src/classes/polls/HMSPollLeaderboardSummary.ts +7 -0
- package/src/classes/polls/HMSPollQuestion.ts +92 -0
- package/src/classes/polls/HMSPollQuestionAnswer.ts +29 -0
- package/src/classes/polls/HMSPollQuestionCreateParams.ts +36 -0
- package/src/classes/polls/HMSPollQuestionOption.ts +24 -0
- package/src/classes/polls/HMSPollQuestionOptionCreateParams.ts +8 -0
- package/src/classes/polls/HMSPollQuestionQuizOptionCreateParams.ts +6 -0
- package/src/classes/polls/HMSPollQuestionResponse.ts +72 -0
- package/src/classes/polls/HMSPollQuestionResponseCreateParams.ts +6 -0
- package/src/classes/polls/HMSPollQuestionResponseResult.ts +19 -0
- package/src/classes/polls/HMSPollQuestionResult.ts +41 -0
- package/src/classes/polls/HMSPollQuestionType.ts +21 -0
- package/src/classes/polls/HMSPollResponsePeerInfo.ts +24 -0
- package/src/classes/polls/HMSPollResult.ts +26 -0
- package/src/classes/polls/HMSPollState.ts +16 -0
- package/src/classes/polls/HMSPollType.ts +4 -0
- package/src/classes/polls/HMSPollUpdateType.ts +5 -0
- package/src/classes/polls/HMSPollUserTrackingMode.ts +16 -0
- package/src/classes/polls/PollLeaderboardResponse.ts +8 -0
- package/src/classes/transcriptions/HMSTranscript.ts +13 -0
- package/src/classes/transcriptions/OnTranscriptionError.ts +5 -0
- package/src/classes/transcriptions/TranscriptionState.ts +6 -0
- package/src/classes/transcriptions/Transcriptions.ts +19 -0
- package/src/classes/transcriptions/TranscriptionsMode.ts +4 -0
- package/src/classes/transcriptions/index.ts +5 -0
- package/src/classes/whiteboard/HMSWhiteboard.tsx +16 -0
- package/src/classes/whiteboard/HMSWhiteboardListenerActions.ts +3 -0
- package/src/classes/whiteboard/HMSWhiteboardState.tsx +4 -0
- package/src/classes/whiteboard/HMSWhiteboardUpdateType.tsx +4 -0
- package/src/classes/whiteboard/index.ts +3 -0
- package/src/classes/whiteboard/registerCallbacks.ts +34 -0
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +176 -92
- package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +20 -13
- package/src/components/HMSHLSPlayer/hooks.ts +22 -4
- package/src/components/HMSHLSPlayer/index.ts +3 -0
- package/src/hooks/hmsviews.ts +15 -0
- package/src/hooks/polls.ts +14 -0
- package/src/index.ts +38 -3
- package/src/modules/HMSManagerModule.ts +5 -0
- package/src/specs/HMSHLSPlayerNativeComponent.ts +203 -0
- package/src/specs/HMSViewNativeComponent.ts +119 -0
- package/src/specs/NativeHMSManager.ts +307 -0
- package/src/stores/hls-player-playback-slice.ts +11 -0
- package/src/stores/hls-player-stats-store.ts +28 -18
- package/src/stores/hms-interactivity-store.ts +18 -0
- package/src/stores/hms-polls-slice.ts +20 -0
- package/src/stores/hms-store.ts +2 -0
- package/src/stores/hmsviews-slice.ts +20 -0
- package/src/stores/types.ts +50 -4
- package/src/types.ts +28 -3
- package/src/utils/emitter/EventEmitter.ts +26 -0
- package/src/utils/keyboard.ts +37 -0
- package/src/utils/notification.ts +10 -0
- package/src/utils/windowController.ts +23 -0
- package/android/.gradle/6.7.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.7.1/gc.properties +0 -0
- package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.9/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/6.9/gc.properties +0 -0
- package/android/.gradle/6.9/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/6.9/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/6.9/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/6.9/javaCompile/taskHistory.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/jarRepositories.xml +0 -45
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +0 -114
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +0 -115
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/commonjs/classes/HMSManagerModule.js +0 -18
- package/lib/commonjs/classes/HMSManagerModule.js.map +0 -1
- package/lib/module/classes/HMSManagerModule.js +0 -11
- package/lib/module/classes/HMSManagerModule.js.map +0 -1
- package/src/classes/HMSManagerModule.ts +0 -18
- /package/lib/typescript/{classes → modules}/HMSManagerModule.d.ts +0 -0
package/src/classes/HMSSDK.tsx
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
3
|
import { HMSEncoder } from './HMSEncoder';
|
|
4
4
|
import { HMSHelper } from './HMSHelper';
|
|
5
5
|
import { getLogger, logger, setLogger } from './HMSLogger';
|
|
6
|
-
import { HMSTrackType } from './HMSTrackType';
|
|
7
6
|
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
8
7
|
import { HmsViewComponent } from './HmsView';
|
|
9
|
-
import type { HmsComponentProps } from './HmsView';
|
|
10
8
|
|
|
11
|
-
import HMSManager from '
|
|
9
|
+
import HMSManager from '../modules/HMSManagerModule';
|
|
12
10
|
|
|
11
|
+
import type { HMSTrackType } from './HMSTrackType';
|
|
12
|
+
import type { HmsComponentProps } from './HmsView';
|
|
13
13
|
import type { HMSConfig } from './HMSConfig';
|
|
14
14
|
import type { HMSLocalPeer } from './HMSLocalPeer';
|
|
15
15
|
import type { HMSRemotePeer } from './HMSRemotePeer';
|
|
@@ -18,7 +18,6 @@ import type { HMSRole } from './HMSRole';
|
|
|
18
18
|
import type { HMSTrack } from './HMSTrack';
|
|
19
19
|
import type { HMSLogger } from './HMSLogger';
|
|
20
20
|
import type { HMSPeer } from './HMSPeer';
|
|
21
|
-
import type { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
22
21
|
import type { HMSTrackSettings } from './HMSTrackSettings';
|
|
23
22
|
import type { HMSRTMPConfig } from './HMSRTMPConfig';
|
|
24
23
|
import type { HMSHLSConfig } from './HMSHLSConfig';
|
|
@@ -41,33 +40,45 @@ import {
|
|
|
41
40
|
HMSRoomCache,
|
|
42
41
|
setHmsRoomCache,
|
|
43
42
|
} from './HMSRoomCache';
|
|
44
|
-
import { HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
|
|
43
|
+
import { HMSPeerUpdate, HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
|
|
45
44
|
import { HMSSessionStore } from './HMSSessionStore';
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
import type { HMSPeerListIteratorOptions } from './HMSPeerListIteratorOptions';
|
|
46
|
+
import { HMSPeerListIterator } from './HMSPeerListIterator';
|
|
47
|
+
import type { HMSPIPConfig } from './HMSPIPConfig';
|
|
48
|
+
import { HMSInteractivityCenter } from './HMSInteractivityCenter';
|
|
49
|
+
import type { HMSHLSTimedMetadata } from './HMSHLSTimedMetadata';
|
|
50
|
+
import type { HMSVideoTrack } from './HMSVideoTrack';
|
|
51
|
+
import type { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
|
|
52
|
+
import type { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
|
|
48
53
|
|
|
49
54
|
type HmsViewProps = Omit<HmsComponentProps, 'id'>;
|
|
50
55
|
|
|
51
|
-
// TODO: Rename to HMSPIPConfig & to be moved to a separate file
|
|
52
|
-
interface PIPConfig {
|
|
53
|
-
autoEnterPipMode?: boolean;
|
|
54
|
-
aspectRatio?: [number, number];
|
|
55
|
-
endButton?: boolean;
|
|
56
|
-
audioButton?: boolean;
|
|
57
|
-
videoButton?: boolean;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
56
|
const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersion');
|
|
61
57
|
|
|
62
58
|
let HmsSdk: HMSSDK | undefined;
|
|
63
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Represents the main SDK class for the 100ms (HMS) video conferencing service in a React Native application.
|
|
62
|
+
* This class provides methods to manage the video conferencing lifecycle including joining a room, leaving a room,
|
|
63
|
+
* managing streams, and handling events.
|
|
64
|
+
*
|
|
65
|
+
* @export
|
|
66
|
+
* @class HMSSDK
|
|
67
|
+
* @example
|
|
68
|
+
* const hmsInstance = await HMSSDK.build();
|
|
69
|
+
* await hmsInstance.join({ authToken: 'your_auth_token', username: 'John Appleseed' });
|
|
70
|
+
* @see https://www.100ms.live/docs/react-native/v2/quickstart/quickstart
|
|
71
|
+
*/
|
|
64
72
|
export class HMSSDK {
|
|
65
73
|
id: string;
|
|
66
|
-
private
|
|
74
|
+
private _interactivityCenter: HMSInteractivityCenter | null = null;
|
|
75
|
+
|
|
67
76
|
private appStateSubscription?: any;
|
|
68
77
|
private onPreviewDelegate?: any;
|
|
69
78
|
private onJoinDelegate?: any;
|
|
79
|
+
private onPermissionsRequestedDelegate?: any;
|
|
70
80
|
private onRoomDelegate?: any;
|
|
81
|
+
private onTranscriptsDelegate?: any;
|
|
71
82
|
private onPeerDelegate?: any;
|
|
72
83
|
private onPeerListUpdatedDelegate?: any;
|
|
73
84
|
private onTrackDelegate?: any;
|
|
@@ -101,24 +112,45 @@ export class HMSSDK {
|
|
|
101
112
|
}
|
|
102
113
|
|
|
103
114
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
115
|
+
* Asynchronously builds and returns an instance of the HMSSDK class.
|
|
116
|
+
*
|
|
117
|
+
* This method initializes the HMSSDK with optional configuration parameters and returns the initialized instance.
|
|
118
|
+
* It is responsible for setting up the SDK with specific settings for track management, app groups, extensions for iOS screen sharing,
|
|
119
|
+
* logging configurations, etc.
|
|
106
120
|
*
|
|
107
|
-
* Regular Usage:
|
|
108
121
|
*
|
|
122
|
+
* @param {Object} params - Optional configuration parameters for initializing the HMSSDK.
|
|
123
|
+
* @param {trackSettings} params.trackSettings is an optional value only required to enable features like iOS Screen/Audio Share, Android Software Echo Cancellation, etc
|
|
124
|
+
* @param {appGroup} params.appGroup is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS.
|
|
125
|
+
* @param {preferredExtension} params.preferredExtension is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS.
|
|
126
|
+
* @param {boolean} params.haltPreviewJoinForPermissionsRequestOnAndroid - Optional flag to halt the preview/join process until permissions are explicitly granted by the user. Android only. This is particularly useful when you might want to request permissions before proceeding with the preview or join operation.
|
|
127
|
+
* @param {HMSLogSettings} params.logSettings - Optional settings for logging.
|
|
128
|
+
*
|
|
129
|
+
* @returns {Promise<HMSSDK>} A promise that resolves to an instance of HMSSDK.
|
|
130
|
+
* @throws {Error} If the HMSSDK instance cannot be created.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* // Regular usage:
|
|
109
134
|
* const hmsInstance = await HMSSDK.build();
|
|
110
135
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
136
|
+
* @example
|
|
137
|
+
* // Advanced Usage:
|
|
138
|
+
* const hmsInstance = await HMSSDK.build({
|
|
139
|
+
* trackSettings: {...},
|
|
140
|
+
* appGroup: 'group.example',
|
|
141
|
+
* preferredExtension: 'com.example.extension',
|
|
142
|
+
* logSettings: {...},
|
|
143
|
+
* });
|
|
115
144
|
*
|
|
145
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/install-the-sdk/hmssdk
|
|
116
146
|
* @static
|
|
117
|
-
* @
|
|
147
|
+
* @async
|
|
148
|
+
* @function build
|
|
118
149
|
* @memberof HMSSDK
|
|
119
150
|
*/
|
|
120
151
|
static async build(params?: {
|
|
121
152
|
trackSettings?: HMSTrackSettings;
|
|
153
|
+
haltPreviewJoinForPermissionsRequestOnAndroid?: boolean;
|
|
122
154
|
appGroup?: String;
|
|
123
155
|
preferredExtension?: String;
|
|
124
156
|
logSettings?: HMSLogSettings;
|
|
@@ -128,6 +160,8 @@ export class HMSSDK {
|
|
|
128
160
|
const { major, minor, patch } = ReactNativeVersion.version;
|
|
129
161
|
let id = await HMSManager.build({
|
|
130
162
|
trackSettings: params?.trackSettings,
|
|
163
|
+
haltPreviewJoinForPermissionsRequest:
|
|
164
|
+
params?.haltPreviewJoinForPermissionsRequestOnAndroid, // required for Android Permissions, not required for iOS
|
|
131
165
|
appGroup: params?.appGroup, // required for iOS Screenshare, not required for Android
|
|
132
166
|
preferredExtension: params?.preferredExtension, // required for iOS Screenshare, not required for Android
|
|
133
167
|
frameworkInfo: {
|
|
@@ -142,7 +176,20 @@ export class HMSSDK {
|
|
|
142
176
|
}
|
|
143
177
|
|
|
144
178
|
/**
|
|
145
|
-
*
|
|
179
|
+
* Asynchronously destroys the HMSSDK instance.
|
|
180
|
+
*
|
|
181
|
+
* - This method performs a series of cleanup actions before destroying the HMSSDK instance.
|
|
182
|
+
* - It logs the destruction process, clears both the HMS peers and room caches, removes all event listeners to prevent memory leaks, and finally calls the native
|
|
183
|
+
* `destroy` method on the `HMSManager` with the instance's ID.
|
|
184
|
+
* - This is typically used to ensure that all resources are properly released when the HMSSDK instance is no longer needed, such as when a user leaves a room or the application is shutting down.
|
|
185
|
+
*
|
|
186
|
+
* @returns {Promise<void>} A promise that resolves when the destruction process has completed.
|
|
187
|
+
* @throws {Error} If the HMSSDK instance cannot be destroyed.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* await hmsInstance.destroy();
|
|
191
|
+
*
|
|
192
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/install-the-sdk/hmssdk
|
|
146
193
|
*
|
|
147
194
|
* @memberof HMSSDK
|
|
148
195
|
*/
|
|
@@ -155,10 +202,23 @@ export class HMSSDK {
|
|
|
155
202
|
};
|
|
156
203
|
|
|
157
204
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
205
|
+
* Asynchronously retrieves an authentication token using the room code, user ID, and endpoint.
|
|
206
|
+
*
|
|
207
|
+
* This method is responsible for fetching an authentication token that is required to join a room in the HMS ecosystem.
|
|
208
|
+
* It makes a call to the HMSManager's `getAuthTokenByRoomCode` method, passing in the necessary parameters.
|
|
209
|
+
* The function logs the attempt and returns the token as a string.
|
|
210
|
+
*
|
|
211
|
+
* @param {string} roomCode - The unique code of the room for which the token is being requested.
|
|
212
|
+
* @param {string} [userId] - Optional. The user ID of the participant requesting the token. This can be used for identifying the user in the backend.
|
|
213
|
+
* @param {string} [endpoint] - Optional. The endpoint URL to which the token request is sent. This can be used to specify a different authentication server if needed.
|
|
214
|
+
* @returns {Promise<string>} A promise that resolves to the authentication token as a string.
|
|
215
|
+
* @throws {Error} If the authentication token cannot be retrieved.
|
|
216
|
+
* @example
|
|
217
|
+
* const authToken = await hmsInstance.getAuthTokenByRoomCode('room-code');
|
|
218
|
+
*
|
|
219
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods#getauthtokenbyroomcode
|
|
220
|
+
* @async
|
|
221
|
+
* @function getAuthTokenByRoomCode
|
|
162
222
|
* @memberof HMSSDK
|
|
163
223
|
*/
|
|
164
224
|
getAuthTokenByRoomCode = async (
|
|
@@ -182,44 +242,83 @@ export class HMSSDK {
|
|
|
182
242
|
};
|
|
183
243
|
|
|
184
244
|
/**
|
|
185
|
-
*
|
|
186
|
-
* after joining the room user will start receiving the events and updates of the room.
|
|
245
|
+
* Asynchronously joins a room with the provided configuration
|
|
187
246
|
*
|
|
188
|
-
*
|
|
247
|
+
* This method is responsible for initiating the process of joining a room in the HMS ecosystem. It performs several key actions:
|
|
248
|
+
* - Logs the attempt to join with the provided configuration and instance ID.
|
|
249
|
+
* - Initializes the peers and room caches for the current session.
|
|
250
|
+
* - Calls the `join` method on the `HMSManager` with the provided configuration and the instance ID.
|
|
189
251
|
*
|
|
190
|
-
* @param {HMSConfig} config
|
|
252
|
+
* @param {HMSConfig} config - The configuration object required to join a room. This includes credentials, room details, and user information.
|
|
253
|
+
* @returns {Promise<void>} A promise that resolves when the join operation has been successfully initiated.
|
|
254
|
+
* @throws {Error} If the join operation cannot be completed.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* await hmsInstance.join(hmsConfig);
|
|
258
|
+
*
|
|
259
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join
|
|
260
|
+
* @async
|
|
261
|
+
* @function join
|
|
191
262
|
* @memberof HMSSDK
|
|
192
263
|
*/
|
|
193
264
|
join = async (config: HMSConfig) => {
|
|
194
265
|
logger?.verbose('#Function join', { config, id: this.id });
|
|
195
|
-
this.addAppStateListener();
|
|
196
266
|
setHmsPeersCache(new HMSPeersCache(this.id));
|
|
197
267
|
setHmsRoomCache(new HMSRoomCache(this.id));
|
|
198
268
|
await HMSManager.join({ ...config, id: this.id });
|
|
199
269
|
};
|
|
200
270
|
|
|
201
271
|
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
272
|
+
* Initiates a preview for the local peer.
|
|
273
|
+
*
|
|
274
|
+
* This function triggers the preview process for the local peer, allowing the application to display
|
|
275
|
+
* preview tracks (e.g., video or audio tracks) before joining a room. The response from the previewListener
|
|
276
|
+
* will contain the preview tracks for the local peer, which can be used to render a preview UI.
|
|
277
|
+
*
|
|
278
|
+
* @param {HMSConfig} config - The configuration object required for previewing, including credentials and user details.
|
|
279
|
+
* @example
|
|
280
|
+
* // Example usage of the preview function
|
|
281
|
+
* const previewConfig = {
|
|
282
|
+
* authToken: "your_auth_token",
|
|
283
|
+
* userName: "John Doe",
|
|
284
|
+
* roomCode: "your_room_code"
|
|
285
|
+
* };
|
|
286
|
+
* hmsInstance.preview(previewConfig);
|
|
287
|
+
*
|
|
288
|
+
* @see https://www.100ms.live/docs/react-native/v2/features/preview
|
|
289
|
+
*
|
|
290
|
+
* @async
|
|
291
|
+
* @function preview
|
|
208
292
|
* @memberof HMSSDK
|
|
209
293
|
*/
|
|
210
|
-
preview = (config: HMSConfig) => {
|
|
294
|
+
preview = async (config: HMSConfig) => {
|
|
211
295
|
logger?.verbose('#Function preview', { config, id: this.id });
|
|
212
|
-
HMSManager.preview({ ...config, id: this.id });
|
|
296
|
+
await HMSManager.preview({ ...config, id: this.id });
|
|
213
297
|
};
|
|
214
298
|
|
|
215
299
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
300
|
+
* `HmsView` is a React component that renders a video track within a view.
|
|
301
|
+
*
|
|
302
|
+
* It utilizes the `HmsViewComponent` to display the media track specified by the `trackId`.
|
|
303
|
+
* This component is designed to be used with React's `forwardRef` to allow for ref forwarding,
|
|
304
|
+
* enabling direct interaction with the DOM element.
|
|
305
|
+
*
|
|
306
|
+
* Props:
|
|
307
|
+
* - `trackId`: The unique identifier for the track to be displayed.
|
|
308
|
+
* - `style`: Custom styles to apply to the view.
|
|
309
|
+
* - `mirror`: If true, the video will be mirrored; commonly used for local video tracks.
|
|
310
|
+
* - `scaleType`: Determines how the video fits within the bounds of the view (e.g., aspect fill, aspect fit).
|
|
311
|
+
* - `setZOrderMediaOverlay`: When true, the video view will be rendered above the regular view hierarchy.
|
|
312
|
+
* - `autoSimulcast`: Enables automatic simulcast layer switching based on network conditions (if supported).
|
|
313
|
+
*
|
|
314
|
+
* @param {Object} props - The properties passed to the HmsView component.
|
|
315
|
+
* @param {React.Ref} ref - A ref provided by `forwardRef` for accessing the underlying DOM element.
|
|
316
|
+
* @returns {React.Element} A `HmsViewComponent` element configured with the provided props and ref.
|
|
317
|
+
* @memberof HMSSDK
|
|
318
|
+
* @example
|
|
319
|
+
* <HmsView trackId="track-id" style={{ width: 100, height: 100 }} mirror={true} scaleType="aspectFill" />
|
|
221
320
|
*
|
|
222
|
-
*
|
|
321
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview
|
|
223
322
|
*
|
|
224
323
|
* @param {HmsViewProps}
|
|
225
324
|
* @memberof HMSSDK
|
|
@@ -248,7 +347,6 @@ export class HMSSDK {
|
|
|
248
347
|
});
|
|
249
348
|
|
|
250
349
|
roomLeaveCleanup = () => {
|
|
251
|
-
this.muteStatus = undefined;
|
|
252
350
|
this?.appStateSubscription?.remove();
|
|
253
351
|
clearHmsPeersCache();
|
|
254
352
|
clearHmsRoomCache();
|
|
@@ -256,10 +354,23 @@ export class HMSSDK {
|
|
|
256
354
|
};
|
|
257
355
|
|
|
258
356
|
/**
|
|
259
|
-
*
|
|
357
|
+
* Asynchronously leaves the current room and performs cleanup.
|
|
358
|
+
*
|
|
359
|
+
* This method triggers the leave process for the current user, effectively disconnecting them from the room they are in.
|
|
360
|
+
* It logs the leave action with the user's ID, calls the native `leave` method in `HMSManager` with the user's ID,
|
|
361
|
+
* and then performs additional cleanup through `roomLeaveCleanup`. This cleanup includes removing app state subscriptions
|
|
362
|
+
* and clearing cached data related to peers and the room.
|
|
363
|
+
*
|
|
364
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the user has successfully left the room, or `false` otherwise.
|
|
365
|
+
* @throws {Error} If the user cannot leave the room.
|
|
366
|
+
* @memberof HMSSDK
|
|
367
|
+
* @example
|
|
368
|
+
* await hmsInstance.leave();
|
|
260
369
|
*
|
|
261
|
-
*
|
|
370
|
+
* @see https://www.100ms.live/docs/react-native/v2/features/leave
|
|
262
371
|
*
|
|
372
|
+
* @async
|
|
373
|
+
* @function leave
|
|
263
374
|
* @memberof HMSSDK
|
|
264
375
|
*/
|
|
265
376
|
leave = async () => {
|
|
@@ -274,13 +385,28 @@ export class HMSSDK {
|
|
|
274
385
|
};
|
|
275
386
|
|
|
276
387
|
/**
|
|
277
|
-
*
|
|
388
|
+
* Sends a broadcast message to all peers in the room.
|
|
278
389
|
*
|
|
279
|
-
*
|
|
390
|
+
* This asynchronous function sends a message to all peers in the room, which they can receive through the `onMessage` listener.
|
|
391
|
+
* It can be used to send chat messages or custom types of messages like emoji reactions or notifications.
|
|
280
392
|
*
|
|
393
|
+
* @param {string} message - The message to be sent to all peers.
|
|
394
|
+
* @param {string} [type='chat'] - The type of the message. Default is 'chat'. Custom types can be used for specific purposes.
|
|
395
|
+
* @returns {Promise<{messageId: string | undefined}>} A promise that resolves with the message ID of the sent message, or undefined if the message could not be sent.
|
|
396
|
+
*
|
|
397
|
+
* @example
|
|
398
|
+
* // Sending a chat message to all peers
|
|
399
|
+
* await hmsInstance.sendBroadcastMessage("Hello everyone!", "chat");
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* // Sending a custom notification to all peers
|
|
403
|
+
* await hmsInstance.sendBroadcastMessage("Meeting starts in 5 minutes", "notification");
|
|
404
|
+
*
|
|
405
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/chat
|
|
406
|
+
*
|
|
407
|
+
* @async
|
|
408
|
+
* @function sendBroadcastMessage
|
|
281
409
|
* @memberof HMSSDK
|
|
282
|
-
* @param message the message that is to be sent
|
|
283
|
-
* @param type the default type is set to CHAT. You can pass a custom type here for sending events like Emoji Reactions, Notifications, etc
|
|
284
410
|
*/
|
|
285
411
|
sendBroadcastMessage = async (message: string, type: string = 'chat') => {
|
|
286
412
|
logger?.verbose('#Function sendBroadcastMessage', {
|
|
@@ -299,11 +425,25 @@ export class HMSSDK {
|
|
|
299
425
|
};
|
|
300
426
|
|
|
301
427
|
/**
|
|
302
|
-
*
|
|
303
|
-
*
|
|
428
|
+
* Sends a message to a specific set of roles within the room.
|
|
429
|
+
*
|
|
430
|
+
* This method allows for targeted communication by sending a message to peers who have any of the specified roles.
|
|
431
|
+
* The message is received by the peers through the `onMessage` listener. This can be useful for sending announcements,
|
|
432
|
+
* instructions, or other types of messages to a subset of the room based on their roles.
|
|
433
|
+
*
|
|
434
|
+
* @param {string} message - The message to be sent.
|
|
435
|
+
* @param {HMSRole[]} roles - An array of roles to which the message will be sent. Peers with these roles will receive the message.
|
|
436
|
+
* @param {string} [type='chat'] - The type of the message. Defaults to 'chat'. Custom types can be used for specific messaging scenarios.
|
|
437
|
+
* @returns {Promise<{messageId: string | undefined}>} A promise that resolves with an object containing the `messageId` of the sent message. If the message could not be sent, `messageId` will be `undefined`.
|
|
304
438
|
*
|
|
305
|
-
*
|
|
439
|
+
* @example
|
|
440
|
+
* // Sending a message to all peers with the role of 'moderator'
|
|
441
|
+
* await hmsInstance.sendGroupMessage("Please start the meeting.", [moderator]);
|
|
306
442
|
*
|
|
443
|
+
* @see https://www.100ms.live/docs/react-native/v2/features/chat
|
|
444
|
+
*
|
|
445
|
+
* @async
|
|
446
|
+
* @function sendGroupMessage
|
|
307
447
|
* @memberof HMSSDK
|
|
308
448
|
*/
|
|
309
449
|
sendGroupMessage = async (
|
|
@@ -329,11 +469,27 @@ export class HMSSDK {
|
|
|
329
469
|
};
|
|
330
470
|
|
|
331
471
|
/**
|
|
332
|
-
*
|
|
333
|
-
*
|
|
472
|
+
* Sends a direct message to a specific peer in the room.
|
|
473
|
+
*
|
|
474
|
+
* This method allows sending a private message to a single peer, ensuring that only the specified recipient can receive and view the message.
|
|
475
|
+
* The message is delivered to the recipient through the `onMessage` listener. This functionality is useful for implementing private chat features
|
|
476
|
+
* within a larger group chat context.
|
|
477
|
+
*
|
|
478
|
+
* @param {string} message - The message text to be sent.
|
|
479
|
+
* @param {HMSPeer} peer - The peer object representing the recipient of the message.
|
|
480
|
+
* @param {string} [type='chat'] - The type of the message being sent. Defaults to 'chat'. This can be customized to differentiate between various message types (e.g., 'private', 'system').
|
|
481
|
+
* @returns {Promise<{messageId: string | undefined}>} A promise that resolves with an object containing the `messageId` of the sent message. If the message could not be sent, `messageId` will be `undefined`.
|
|
482
|
+
* @throws {Error} Throws an error if the message could not be sent.
|
|
334
483
|
*
|
|
335
|
-
*
|
|
484
|
+
* @example
|
|
485
|
+
* // Sending a private chat message to a specific peer
|
|
486
|
+
* const peer = { peerID: 'peer123', ... };
|
|
487
|
+
* await hmsInstance.sendDirectMessage("Hello, this is a private message.", peer, "chat");
|
|
336
488
|
*
|
|
489
|
+
* @see https://www.100ms.live/docs/react-native/v2/features/chat
|
|
490
|
+
*
|
|
491
|
+
* @async
|
|
492
|
+
* @function sendDirectMessage
|
|
337
493
|
* @memberof HMSSDK
|
|
338
494
|
*/
|
|
339
495
|
sendDirectMessage = async (
|
|
@@ -359,15 +515,24 @@ export class HMSSDK {
|
|
|
359
515
|
};
|
|
360
516
|
|
|
361
517
|
/**
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
* @
|
|
518
|
+
* Asynchronously changes the metadata for the local peer.
|
|
519
|
+
*
|
|
520
|
+
* This method updates the metadata field of the local peer in the room. The metadata is a versatile field that can be used
|
|
521
|
+
* to store various information such as the peer's current status (e.g., raising hand, be right back, etc.). It is recommended
|
|
522
|
+
* to use a JSON object in string format to store multiple data points within the metadata. This allows for a structured and
|
|
523
|
+
* easily parseable format for metadata management.
|
|
524
|
+
*
|
|
525
|
+
* @param {string} metadata - The new metadata in string format. It is advised to use a JSON string for structured data.
|
|
526
|
+
* @returns {Promise<void>} A promise that resolves when the metadata has been successfully changed.
|
|
527
|
+
* @throws {Error} Throws an error if the metadata change operation fails.
|
|
528
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-metadata
|
|
529
|
+
* @example
|
|
530
|
+
* // Changing metadata to indicate the peer is raising their hand
|
|
531
|
+
* const newMetadata = JSON.stringify({ status: 'raiseHand' });
|
|
532
|
+
* await hmsInstance.changeMetadata(newMetadata);
|
|
533
|
+
*
|
|
534
|
+
* @async
|
|
535
|
+
* @function changeMetadata
|
|
371
536
|
* @memberof HMSSDK
|
|
372
537
|
*/
|
|
373
538
|
changeMetadata = async (metadata: string) => {
|
|
@@ -376,12 +541,28 @@ export class HMSSDK {
|
|
|
376
541
|
};
|
|
377
542
|
|
|
378
543
|
/**
|
|
379
|
-
*
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
544
|
+
* Initiates RTMP streaming or recording based on the provided configuration.
|
|
545
|
+
*
|
|
546
|
+
* This method starts RTMP streaming or recording by taking a configuration object of type HMSRTMPConfig.
|
|
547
|
+
* The configuration specifies the URLs for streaming and whether recording should be enabled. The response to this
|
|
548
|
+
* operation can be observed in the `onRoomUpdate` event, specifically when the `RTMP_STREAMING_STATE_UPDATED` action is triggered.
|
|
549
|
+
*
|
|
550
|
+
* @param {HMSRTMPConfig} data - The configuration object for RTMP streaming or recording. It includes streaming URLs and recording settings.
|
|
551
|
+
* @returns {Promise<any>} A promise that resolves with the operation result when the streaming or recording starts successfully.
|
|
552
|
+
* @throws {Error} Throws an error if the operation fails or the configuration is invalid.
|
|
553
|
+
*
|
|
554
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording
|
|
555
|
+
*
|
|
556
|
+
* @example
|
|
557
|
+
* const rtmpConfig = {
|
|
558
|
+
* meetingURL: "https://meet.example.com/myMeeting",
|
|
559
|
+
* rtmpURLs: ["rtmp://live.twitch.tv/app", "rtmp://a.rtmp.youtube.com/live2"],
|
|
560
|
+
* record: true,
|
|
561
|
+
* resolution: { width: 1280, height: 720 }
|
|
562
|
+
* };
|
|
563
|
+
* await hmsInstance.startRTMPOrRecording(rtmpConfig);
|
|
564
|
+
* @async
|
|
565
|
+
* @function startRTMPOrRecording
|
|
385
566
|
* @memberof HMSSDK
|
|
386
567
|
*/
|
|
387
568
|
startRTMPOrRecording = async (data: HMSRTMPConfig) => {
|
|
@@ -395,12 +576,19 @@ export class HMSSDK {
|
|
|
395
576
|
};
|
|
396
577
|
|
|
397
578
|
/**
|
|
398
|
-
*
|
|
399
|
-
* - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
|
|
579
|
+
* Stops all ongoing RTMP streaming and recording.
|
|
400
580
|
*
|
|
401
|
-
*
|
|
581
|
+
* This function is responsible for halting any active RTMP streaming or recording sessions.
|
|
582
|
+
* It communicates with the native `HMSManager` module to execute the stop operation.
|
|
583
|
+
* The completion or status of this operation can be monitored through the `onRoomUpdate` event, specifically when the `RTMP_STREAMING_STATE_UPDATED` action is triggered, indicating that the streaming or recording has been successfully stopped.
|
|
402
584
|
*
|
|
585
|
+
* @async
|
|
586
|
+
* @function stopRtmpAndRecording
|
|
587
|
+
* @returns {Promise<any>} A promise that resolves when the RTMP streaming and recording have been successfully stopped.
|
|
588
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording
|
|
403
589
|
* @memberof HMSSDK
|
|
590
|
+
* @example
|
|
591
|
+
* await hmsInstance.stopRtmpAndRecording();
|
|
404
592
|
*/
|
|
405
593
|
stopRtmpAndRecording = async () => {
|
|
406
594
|
logger?.verbose('#Function stopRtmpAndRecording', {});
|
|
@@ -409,13 +597,21 @@ export class HMSSDK {
|
|
|
409
597
|
};
|
|
410
598
|
|
|
411
599
|
/**
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
600
|
+
* Initiates HLS (HTTP Live Streaming) based on the provided configuration.
|
|
601
|
+
*
|
|
602
|
+
* This asynchronous function starts HLS streaming, allowing for live video content to be delivered over the internet in a scalable manner.
|
|
603
|
+
* The function takes an optional `HMSHLSConfig` object as a parameter, which includes settings such as the meeting URL, HLS variant parameters, and recording settings.
|
|
604
|
+
* The operation's response can be observed through the `onRoomUpdate` event, specifically when the `HLS_STREAMING_STATE_UPDATED` action is triggered, indicating the streaming state has been updated.
|
|
605
|
+
*
|
|
606
|
+
* @param {HMSHLSConfig} [data] - Optional configuration object for HLS streaming. Defines parameters such as meeting URL, HLS variants, and recording options.
|
|
607
|
+
* @returns {Promise<any>} A promise that resolves when the HLS streaming starts successfully. The promise resolves with the operation result.
|
|
608
|
+
* @throws {Error} Throws an error if the operation fails or if the provided configuration is invalid.
|
|
609
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/hls
|
|
610
|
+
* @async
|
|
611
|
+
* @function startHLSStreaming
|
|
418
612
|
* @memberof HMSSDK
|
|
613
|
+
* @example
|
|
614
|
+
* await hmsInstance.startHLSStreaming();
|
|
419
615
|
*/
|
|
420
616
|
startHLSStreaming = async (data?: HMSHLSConfig) => {
|
|
421
617
|
logger?.verbose('#Function startHLSStreaming', {
|
|
@@ -426,12 +622,19 @@ export class HMSSDK {
|
|
|
426
622
|
};
|
|
427
623
|
|
|
428
624
|
/**
|
|
429
|
-
*
|
|
430
|
-
* - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
|
|
625
|
+
* Stops the ongoing HLS (HTTP Live Streaming) streams.
|
|
431
626
|
*
|
|
432
|
-
*
|
|
627
|
+
* This asynchronous function is responsible for stopping any active HLS streaming sessions.
|
|
628
|
+
* It communicates with the native `HMSManager` module to execute the stop operation.
|
|
629
|
+
* The completion or status of this operation can be observed through the `onRoomUpdate` event, specifically when the `HLS_STREAMING_STATE_UPDATED` action is triggered, indicating that the HLS streaming has been successfully stopped.
|
|
433
630
|
*
|
|
631
|
+
* @async
|
|
632
|
+
* @function stopHLSStreaming
|
|
633
|
+
* @returns {Promise<void>} A promise that resolves when the HLS streaming has been successfully stopped.
|
|
634
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/hls for more details on HLS streaming.
|
|
434
635
|
* @memberof HMSSDK
|
|
636
|
+
* @example
|
|
637
|
+
* await hmsInstance.stopHLSStreaming();
|
|
435
638
|
*/
|
|
436
639
|
stopHLSStreaming = async () => {
|
|
437
640
|
logger?.verbose('#Function stopHLSStreaming', {});
|
|
@@ -439,19 +642,55 @@ export class HMSSDK {
|
|
|
439
642
|
};
|
|
440
643
|
|
|
441
644
|
/**
|
|
442
|
-
*
|
|
443
|
-
*
|
|
444
|
-
*
|
|
445
|
-
*
|
|
446
|
-
*
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
*
|
|
645
|
+
* Sends timed metadata for HLS (HTTP Live Streaming) playback.
|
|
646
|
+
*
|
|
647
|
+
* This asynchronous function is designed to send metadata that can be synchronized with the HLS video playback.
|
|
648
|
+
* The metadata is sent to all viewers of the HLS stream, allowing for a variety of use cases such as displaying
|
|
649
|
+
* song titles, ads, or other information at specific times during the stream.
|
|
650
|
+
* The metadata should be an array of HMSHLSTimedMetadata objects, each specifying the content and timing for the metadata display.
|
|
651
|
+
*
|
|
652
|
+
* @async
|
|
653
|
+
* @function sendHLSTimedMetadata
|
|
654
|
+
* @param {HMSHLSTimedMetadata[]} metadata - An array of metadata objects to be sent.
|
|
655
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the metadata was successfully sent, or `false` otherwise.
|
|
656
|
+
* @example
|
|
657
|
+
* const metadata = [
|
|
658
|
+
* { time: 10, data: "Song: Example Song Title" },
|
|
659
|
+
* { time: 20, data: "Advertisement: Buy Now!" }
|
|
660
|
+
* ];
|
|
661
|
+
* await hmsInstance.sendHLSTimedMetadata(metadata);
|
|
662
|
+
*
|
|
663
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/hls-player#how-to-use-hls-timed-metadata-with-100ms-hls-player
|
|
664
|
+
*/
|
|
665
|
+
sendHLSTimedMetadata = async (
|
|
666
|
+
metadata: HMSHLSTimedMetadata[]
|
|
667
|
+
): Promise<boolean> => {
|
|
668
|
+
const data = { metadata, id: this.id };
|
|
669
|
+
logger?.verbose('#Function sendHLSTimedMetadata', data);
|
|
670
|
+
return await HMSManager.sendHLSTimedMetadata(data);
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Deprecated. Changes the role of a specified peer within the room.
|
|
675
|
+
*
|
|
676
|
+
* This function is marked as deprecated and should not be used in new implementations. Use `changeRoleOfPeer` instead.
|
|
677
|
+
* It allows for the dynamic adjustment of a peer's permissions and capabilities within the room by changing their role.
|
|
678
|
+
* The role change can be enforced immediately or offered to the peer as a request, depending on the `force` parameter.
|
|
679
|
+
*
|
|
680
|
+
* @deprecated Since version 1.1.0. Use `changeRoleOfPeer` instead.
|
|
681
|
+
* @param {HMSPeer} peer - The peer whose role is to be changed.
|
|
682
|
+
* @param {HMSRole} role - The new role to be assigned to the peer.
|
|
683
|
+
* @param {boolean} [force=false] - If `true`, the role change is applied immediately without the peer's consent. If `false`, the peer receives a role change request.
|
|
684
|
+
* @returns {Promise<void>} A promise that resolves when the role change operation is complete.
|
|
685
|
+
* @throws {Error} Throws an error if the operation fails.
|
|
686
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role
|
|
687
|
+
* @example
|
|
688
|
+
* // Change the role of a peer to 'viewer' forcefully
|
|
689
|
+
* const peer = { peerID: 'peer123', ... };
|
|
690
|
+
* const newRole = { name: 'viewer', ... };
|
|
691
|
+
* await hmsInstance.changeRole(peer, newRole, true);
|
|
692
|
+
* @async
|
|
693
|
+
* @function changeRole
|
|
455
694
|
* @memberof HMSSDK
|
|
456
695
|
*/
|
|
457
696
|
changeRole = async (peer: HMSPeer, role: HMSRole, force: boolean = false) => {
|
|
@@ -466,24 +705,36 @@ export class HMSSDK {
|
|
|
466
705
|
};
|
|
467
706
|
|
|
468
707
|
/**
|
|
469
|
-
*
|
|
470
|
-
*
|
|
471
|
-
*
|
|
472
|
-
* the role or
|
|
473
|
-
*
|
|
474
|
-
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
*
|
|
708
|
+
* Asynchronously changes the role of a specified peer within the room.
|
|
709
|
+
*
|
|
710
|
+
* This function is designed to dynamically adjust a peer's permissions and capabilities within the room by changing their role.
|
|
711
|
+
* It can enforce the role change immediately or offer it to the peer as a request, depending on the `force` parameter.
|
|
712
|
+
* If the role change is forced, it is applied immediately without the peer's consent. Otherwise, the peer receives a role change request,
|
|
713
|
+
* which can be accepted or declined. This functionality supports flexible room management and control over participant permissions.
|
|
714
|
+
*
|
|
715
|
+
* @async
|
|
716
|
+
* @function changeRoleOfPeer
|
|
717
|
+
* @param {HMSPeer} peer - The peer whose role is to be changed.
|
|
718
|
+
* @param {HMSRole} role - The new role to be assigned to the peer.
|
|
719
|
+
* @param {boolean} [force=false] - Determines whether the role change should be applied immediately (`true`) or sent as a request (`false`).
|
|
720
|
+
* @returns {Promise<void>} A promise that resolves to `true` if the role change operation is successful, or `false` otherwise.
|
|
721
|
+
* @throws {Error} Throws an error if the operation fails.
|
|
722
|
+
* @see https://www.100ms.live/docs/react-native/v2/features/change-role
|
|
723
|
+
* @example
|
|
724
|
+
* // Change the role of a peer to 'viewer' forcefully
|
|
725
|
+
* const peer = { peerID: 'peer123', ... };
|
|
726
|
+
* const newRole = { name: 'viewer', ... };
|
|
727
|
+
* await hmsInstance.changeRoleOfPeer(peer, newRole, true);
|
|
728
|
+
*
|
|
729
|
+
* @async
|
|
730
|
+
* @function changeRoleOfPeer
|
|
480
731
|
* @memberof HMSSDK
|
|
481
732
|
*/
|
|
482
733
|
changeRoleOfPeer = async (
|
|
483
734
|
peer: HMSPeer,
|
|
484
735
|
role: HMSRole,
|
|
485
736
|
force: boolean = false
|
|
486
|
-
) => {
|
|
737
|
+
): Promise<void> => {
|
|
487
738
|
const data = {
|
|
488
739
|
peerId: peer.peerID,
|
|
489
740
|
role: role.name,
|
|
@@ -495,19 +746,32 @@ export class HMSSDK {
|
|
|
495
746
|
};
|
|
496
747
|
|
|
497
748
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
749
|
+
* Asynchronously changes the roles of multiple peers within the room.
|
|
750
|
+
*
|
|
751
|
+
* This function is designed to batch update the roles of peers based on their current roles. It is particularly useful
|
|
752
|
+
* in scenarios where a group of users need to be granted or restricted permissions en masse, such as promoting all viewers
|
|
753
|
+
* to participants or demoting all speakers to viewers. The function updates the roles of all peers that have any of the specified
|
|
754
|
+
* `ofRoles` to the new `toRole` without requiring individual consent, bypassing the `roleChangeRequest` listener on the peer's end.
|
|
755
|
+
*
|
|
756
|
+
* @async
|
|
757
|
+
* @function changeRoleOfPeersWithRoles
|
|
758
|
+
* @param {HMSRole[]} ofRoles - An array of roles to identify the peers whose roles are to be changed.
|
|
759
|
+
* @param {HMSRole} toRole - The new role to be assigned to the identified peers.
|
|
760
|
+
* @returns {Promise<void>} A promise that resolves when the role change operation is complete.
|
|
761
|
+
* @throws {Error} Throws an error if the operation fails.
|
|
762
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role
|
|
763
|
+
* @example
|
|
764
|
+
* // Change the role of all peers with 'viewer' role to 'participant'
|
|
765
|
+
* const viewerRole = { name: 'viewer', ... };
|
|
766
|
+
* const participantRole = { name: 'participant', ... };
|
|
767
|
+
* await hmsInstance.changeRoleOfPeersWithRoles([viewerRole], participantRole);
|
|
507
768
|
*
|
|
508
769
|
* @memberof HMSSDK
|
|
509
770
|
*/
|
|
510
|
-
changeRoleOfPeersWithRoles = async (
|
|
771
|
+
changeRoleOfPeersWithRoles = async (
|
|
772
|
+
ofRoles: HMSRole[],
|
|
773
|
+
toRole: HMSRole
|
|
774
|
+
): Promise<void> => {
|
|
511
775
|
const data = {
|
|
512
776
|
ofRoles: ofRoles.map((ofRole) => ofRole.name).filter(Boolean),
|
|
513
777
|
toRole: toRole.name,
|
|
@@ -518,15 +782,35 @@ export class HMSSDK {
|
|
|
518
782
|
};
|
|
519
783
|
|
|
520
784
|
/**
|
|
521
|
-
*
|
|
522
|
-
*
|
|
785
|
+
* Asynchronously changes the mute state of a specified track.
|
|
786
|
+
*
|
|
787
|
+
* This function is designed to control the mute state of any track (audio or video) within the room.
|
|
788
|
+
* When invoked, it sends a request to the HMSManager to change the mute state of the specified track.
|
|
789
|
+
* The targeted peer, whose track is being manipulated, will receive a callback on the `onChangeTrackStateRequestListener`,
|
|
790
|
+
* allowing for custom handling or UI updates based on the mute state change.
|
|
791
|
+
*
|
|
792
|
+
* @async
|
|
793
|
+
* @function changeTrackState
|
|
794
|
+
* @param {HMSTrack} track - The track object whose mute state is to be changed.
|
|
795
|
+
* @param {boolean} mute - The desired mute state of the track. `true` to mute the track, `false` to unmute.
|
|
796
|
+
* @returns {Promise<void>} A promise that resolves when the operation to change the track's mute state is complete.
|
|
797
|
+
* @throws {Error} Throws an error if the operation fails or the track cannot be found.
|
|
798
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/remote-mute
|
|
799
|
+
* @async
|
|
800
|
+
* @function changeTrackState
|
|
801
|
+
* @memberof HMSSDK
|
|
523
802
|
*
|
|
524
|
-
*
|
|
803
|
+
* @example
|
|
804
|
+
* // Mute a specific track
|
|
805
|
+
* const trackToMute = { trackId: 'track123', ... };
|
|
806
|
+
* await hmsInstance.changeTrackState(trackToMute, true);
|
|
525
807
|
*
|
|
526
|
-
* @
|
|
527
|
-
*
|
|
808
|
+
* @example
|
|
809
|
+
* // Unmute a specific track
|
|
810
|
+
* const trackToUnmute = { trackId: 'track456', ... };
|
|
811
|
+
* await hmsInstance.changeTrackState(trackToUnmute, false);
|
|
528
812
|
*/
|
|
529
|
-
changeTrackState = async (track: HMSTrack, mute: boolean) => {
|
|
813
|
+
changeTrackState = async (track: HMSTrack, mute: boolean): Promise<void> => {
|
|
530
814
|
logger?.verbose('#Function changeTrackState', {
|
|
531
815
|
track,
|
|
532
816
|
mute,
|
|
@@ -542,19 +826,37 @@ export class HMSSDK {
|
|
|
542
826
|
};
|
|
543
827
|
|
|
544
828
|
/**
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
*
|
|
829
|
+
* Asynchronously changes the mute state of tracks for peers with specified roles.
|
|
830
|
+
*
|
|
831
|
+
* This method extends the functionality of `changeTrackState` by allowing the mute state of all tracks (audio, video, etc.)
|
|
832
|
+
* belonging to peers with certain roles to be changed in a single operation. It is particularly useful for managing the audio
|
|
833
|
+
* and video state of groups of users, such as muting all participants except the speaker in a conference call.
|
|
834
|
+
*
|
|
835
|
+
* The peers whose track states are being changed will receive a callback on `onChangeTrackStateRequestListener`, allowing for
|
|
836
|
+
* custom handling or UI updates based on the mute state change.
|
|
837
|
+
*
|
|
838
|
+
* @async
|
|
839
|
+
* @function changeTrackStateForRoles
|
|
840
|
+
* @param {boolean} mute - The desired mute state of the tracks. `true` to mute, `false` to unmute.
|
|
841
|
+
* @param {HMSTrackType} [type] - Optional. The type of the tracks to be muted/unmuted (e.g., audio, video).
|
|
842
|
+
* @param {string} [source] - Optional. The source of the track (e.g., camera, screen).
|
|
843
|
+
* @param {Array<HMSRole>} [roles] - The roles of the peers whose tracks are to be muted/unmuted. If not specified, affects all roles.
|
|
844
|
+
* @returns {Promise<void>} A promise that resolves when the operation to change the track's mute state is complete.
|
|
845
|
+
* @throws {Error} Throws an error if the operation fails.
|
|
846
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/change-track-state-roles
|
|
550
847
|
* @memberof HMSSDK
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* // Mute all audio tracks for peers with the role of 'viewer'
|
|
851
|
+
* const viewerRole = { name: 'viewer', ... };
|
|
852
|
+
* await hmsInstance.changeTrackStateForRoles(true, 'audio', undefined, [viewerRole]);
|
|
551
853
|
*/
|
|
552
854
|
changeTrackStateForRoles = async (
|
|
553
855
|
mute: boolean,
|
|
554
856
|
type?: HMSTrackType,
|
|
555
857
|
source?: string,
|
|
556
858
|
roles?: Array<HMSRole>
|
|
557
|
-
) => {
|
|
859
|
+
): Promise<void> => {
|
|
558
860
|
let roleNames = null;
|
|
559
861
|
if (roles) {
|
|
560
862
|
roleNames = HMSHelper.getRoleNames(roles);
|
|
@@ -578,14 +880,30 @@ export class HMSSDK {
|
|
|
578
880
|
};
|
|
579
881
|
|
|
580
882
|
/**
|
|
581
|
-
*
|
|
582
|
-
*
|
|
883
|
+
* Asynchronously removes a peer from the room.
|
|
884
|
+
*
|
|
885
|
+
* This method forcefully disconnects a specified peer from the room.
|
|
886
|
+
* Upon successful removal, the removed peer will receive a callback through the `onRemovedFromRoomListener`, indicating
|
|
887
|
+
* they have been removed from the room.
|
|
888
|
+
* This can be used for managing room participants, such as removing disruptive users or managing room capacity.
|
|
583
889
|
*
|
|
584
|
-
*
|
|
890
|
+
* @param {HMSPeer} peer - The peer object representing the participant to be removed.
|
|
891
|
+
* @param {string} reason - A string detailing the reason for the removal. This reason is communicated
|
|
892
|
+
* to the removed peer, providing context for the action.
|
|
893
|
+
* @returns {Promise<void>} A promise that resolves when the peer has been successfully removed.
|
|
894
|
+
* If the operation fails, the promise will reject with an error.
|
|
585
895
|
*
|
|
896
|
+
* @example
|
|
897
|
+
* // Assuming `peer` is an instance of HMSPeer representing the participant to remove
|
|
898
|
+
* await hmsInstance.removePeer(peer, "Violation of room rules");
|
|
899
|
+
*
|
|
900
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/remove-peer
|
|
901
|
+
*
|
|
902
|
+
* @async
|
|
903
|
+
* @function removePeer
|
|
586
904
|
* @memberof HMSSDK
|
|
587
905
|
*/
|
|
588
|
-
removePeer = async (peer: HMSPeer, reason: string) => {
|
|
906
|
+
removePeer = async (peer: HMSPeer, reason: string): Promise<void> => {
|
|
589
907
|
logger?.verbose('#Function removePeer', {
|
|
590
908
|
peerId: peer.peerID,
|
|
591
909
|
reason,
|
|
@@ -601,15 +919,28 @@ export class HMSSDK {
|
|
|
601
919
|
};
|
|
602
920
|
|
|
603
921
|
/**
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
*
|
|
922
|
+
* Asynchronously ends the current room session for all participants.
|
|
923
|
+
*
|
|
924
|
+
* This method is used to programmatically end the current room session, effectively disconnecting all participants.
|
|
925
|
+
* It can also optionally lock the room to prevent new participants from joining. This is particularly useful for
|
|
926
|
+
* managing the end of scheduled events or meetings, ensuring that all participants are removed at the same time.
|
|
927
|
+
* Upon successful execution, all participants will receive a notification through the `onRemovedFromRoomListener`
|
|
928
|
+
* indicating that they have been removed from the room.
|
|
607
929
|
*
|
|
608
|
-
*
|
|
930
|
+
* @param {string} reason - A descriptive reason for ending the room session. This reason is communicated to all participants.
|
|
931
|
+
* @param {boolean} [lock=false] - Optional. Specifies whether the room should be locked after ending the session. Default is `false`.
|
|
932
|
+
* @returns {Promise<void>} A promise that resolves when the room has been successfully ended and, optionally, locked.
|
|
609
933
|
*
|
|
934
|
+
* @example
|
|
935
|
+
* // End the room and lock it to prevent rejoining
|
|
936
|
+
* await hmsInstance.endRoom("Meeting concluded", true);
|
|
937
|
+
*
|
|
938
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/end-room
|
|
939
|
+
* @async
|
|
940
|
+
* @function endRoom
|
|
610
941
|
* @memberof HMSSDK
|
|
611
942
|
*/
|
|
612
|
-
endRoom = async (reason: string, lock: boolean = false) => {
|
|
943
|
+
endRoom = async (reason: string, lock: boolean = false): Promise<void> => {
|
|
613
944
|
logger?.verbose('#Function endRoom', { lock, reason, id: this.id });
|
|
614
945
|
const data = {
|
|
615
946
|
lock,
|
|
@@ -621,13 +952,25 @@ export class HMSSDK {
|
|
|
621
952
|
};
|
|
622
953
|
|
|
623
954
|
/**
|
|
624
|
-
*
|
|
955
|
+
* Asynchronously changes the name of the local peer.
|
|
956
|
+
*
|
|
957
|
+
* This function updates the name of the local peer in the room. It is useful for scenarios where a user's display name needs to be updated during a session, such as when a user decides to change their nickname or when correcting a typo in the user's name. The updated name is reflected across all participants in the room.
|
|
625
958
|
*
|
|
626
|
-
*
|
|
959
|
+
* Once the name change is successful, all the peers receive HMSUpdateListenerActions.ON_PEER_UPDATE event with HMSPeerUpdate.NAME_CHANGED as update type. When this event is received, the UI for that peer should be updated.
|
|
627
960
|
*
|
|
961
|
+
* @param {string} name - The new name to be set for the local peer.
|
|
962
|
+
* @returns {Promise<void>} A promise that resolves when the name change operation has been successfully completed.
|
|
963
|
+
* @throws {Error} Throws an error if the name change operation fails.
|
|
964
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-name for more information on changing the peer's name.
|
|
965
|
+
* @async
|
|
966
|
+
* @function changeName
|
|
628
967
|
* @memberof HMSSDK
|
|
968
|
+
*
|
|
969
|
+
* @example
|
|
970
|
+
* // Change the name of the local peer to 'Alice'
|
|
971
|
+
* await hmsInstance.changeName("Alice");
|
|
629
972
|
*/
|
|
630
|
-
changeName = async (name: string) => {
|
|
973
|
+
changeName = async (name: string): Promise<void> => {
|
|
631
974
|
logger?.verbose('#Function changeName', { name, id: this.id });
|
|
632
975
|
const data = {
|
|
633
976
|
name,
|
|
@@ -638,13 +981,22 @@ export class HMSSDK {
|
|
|
638
981
|
};
|
|
639
982
|
|
|
640
983
|
/**
|
|
641
|
-
*
|
|
984
|
+
* Asynchronously previews the audio and video tracks for a specific role before applying the role change.
|
|
985
|
+
*
|
|
986
|
+
* This method allows users to preview the expected audio and video tracks that will be visible to other peers in the room
|
|
987
|
+
* after changing their role. It is useful for scenarios where a user wants to understand the impact of a role change on their
|
|
988
|
+
* media tracks before making the change. This can help in ensuring that the right media settings are applied for the new role.
|
|
642
989
|
*
|
|
643
|
-
*
|
|
990
|
+
* @param {string} role - The role for which the preview is requested. The role should be defined within the room's role configurations.
|
|
991
|
+
* @returns {Promise<any>} A promise that resolves with the preview tracks information. The resolved object contains details about the audio and video tracks that would be available to the user if the role were changed to the specified role.
|
|
644
992
|
*
|
|
645
|
-
*
|
|
993
|
+
* @example
|
|
994
|
+
* // Preview the tracks for the 'speaker' role
|
|
995
|
+
* const previewTracks = await hmsInstance.previewForRole('speaker');
|
|
996
|
+
* console.log(previewTracks);
|
|
646
997
|
*
|
|
647
|
-
* @
|
|
998
|
+
* @async
|
|
999
|
+
* @function previewForRole
|
|
648
1000
|
* @memberof HMSSDK
|
|
649
1001
|
*/
|
|
650
1002
|
previewForRole = async (role: string) => {
|
|
@@ -666,19 +1018,28 @@ export class HMSSDK {
|
|
|
666
1018
|
};
|
|
667
1019
|
|
|
668
1020
|
/**
|
|
669
|
-
*
|
|
670
|
-
*
|
|
671
|
-
* If a [previewForRole] call was performed previously then calling this method clears the tracks created anticipating a Change of Role
|
|
1021
|
+
* Asynchronously cancels the preview for a role change.
|
|
672
1022
|
*
|
|
673
|
-
*
|
|
1023
|
+
* This method is intended to be used after a `previewForRole` invocation. It cancels the ongoing preview operation,
|
|
1024
|
+
* effectively clearing any tracks that were created in anticipation of a role change. This is useful in scenarios where
|
|
1025
|
+
* a role change preview was initiated but needs to be aborted before the actual role change occurs, allowing for clean
|
|
1026
|
+
* state management and resource cleanup.
|
|
674
1027
|
*
|
|
1028
|
+
* @async
|
|
1029
|
+
* @function cancelPreview
|
|
675
1030
|
* @memberof HMSSDK
|
|
1031
|
+
* @returns {Promise<{data: string}>} A promise that resolves with an object containing a data string.
|
|
1032
|
+
*
|
|
1033
|
+
* @example
|
|
1034
|
+
* // Cancel a previously initiated role change preview
|
|
1035
|
+
* await hmsInstance.cancelPreview();
|
|
1036
|
+
*
|
|
676
1037
|
*/
|
|
677
|
-
cancelPreview = async () => {
|
|
1038
|
+
cancelPreview = async (): Promise<{ success: boolean }> => {
|
|
678
1039
|
logger?.verbose('#Function cancelPreview', {
|
|
679
1040
|
id: this.id,
|
|
680
1041
|
});
|
|
681
|
-
const data
|
|
1042
|
+
const data = await HMSManager.cancelPreview({
|
|
682
1043
|
id: this.id,
|
|
683
1044
|
});
|
|
684
1045
|
|
|
@@ -686,49 +1047,99 @@ export class HMSSDK {
|
|
|
686
1047
|
};
|
|
687
1048
|
|
|
688
1049
|
/**
|
|
689
|
-
*
|
|
1050
|
+
* Asynchronously accepts a role change request for the local peer.
|
|
1051
|
+
*
|
|
1052
|
+
* This method is used when a role change request has been made to the local peer, typically by an admin or moderator of the room.
|
|
1053
|
+
* Invoking this method signals acceptance of the new role, and the role change is applied to the local peer. This can affect the peer's
|
|
1054
|
+
* permissions and capabilities within the room, such as the ability to send video, audio, or chat messages.
|
|
690
1055
|
*
|
|
691
|
-
*
|
|
1056
|
+
* The successful execution of this method triggers an update across the room, notifying other peers of the role change.
|
|
1057
|
+
* It is important to handle this method's response to ensure the local UI reflects the new role's permissions and capabilities.
|
|
692
1058
|
*
|
|
1059
|
+
* @async
|
|
1060
|
+
* @function acceptRoleChange
|
|
693
1061
|
* @memberof HMSSDK
|
|
1062
|
+
* @returns {Promise<void>} A promise that resolves when the role change has been successfully accepted and applied.
|
|
1063
|
+
* @throws {Error} Throws an error if the role change acceptance operation fails.
|
|
1064
|
+
* @example
|
|
1065
|
+
* // Accept a role change request to become a 'moderator'
|
|
1066
|
+
* await hmsInstance.acceptRoleChange();
|
|
1067
|
+
*
|
|
1068
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role
|
|
694
1069
|
*/
|
|
695
|
-
acceptRoleChange = async () => {
|
|
1070
|
+
acceptRoleChange = async (): Promise<void> => {
|
|
696
1071
|
logger?.verbose('#Function acceptRoleChange', { id: this.id });
|
|
697
1072
|
return await HMSManager.acceptRoleChange({ id: this.id });
|
|
698
1073
|
};
|
|
699
1074
|
|
|
700
1075
|
/**
|
|
701
|
-
*
|
|
702
|
-
* HMSRemoteAudioTrack. It sets mute status for all peers in the room only for the local peer.
|
|
1076
|
+
* Sets the mute status for all remote audio tracks in the room for the local peer.
|
|
703
1077
|
*
|
|
704
|
-
*
|
|
1078
|
+
* This method allows the local user to mute or unmute the playback of all remote audio tracks in the room.
|
|
1079
|
+
* It affects only the local peer's audio playback and does not impact other peers. This can be useful in scenarios
|
|
1080
|
+
* where a user needs to quickly mute all incoming audio without affecting the audio state for other participants in the room.
|
|
705
1081
|
*
|
|
1082
|
+
* @param {boolean} mute - A boolean value indicating whether to mute (`true`) or unmute (`false`) all remote audio tracks for the local peer.
|
|
1083
|
+
* @returns {Promise<boolean>} A promise that resolves with a boolean value indicating the success of the operation.
|
|
1084
|
+
* @throws {Error} Throws an error if the operation fails.
|
|
1085
|
+
* @async
|
|
1086
|
+
* @function setPlaybackForAllAudio
|
|
706
1087
|
* @memberof HMSSDK
|
|
1088
|
+
* @example
|
|
1089
|
+
* // Mute all remote audio tracks for the local peer
|
|
1090
|
+
* hmsInstance.setPlaybackForAllAudio(true);
|
|
1091
|
+
*
|
|
1092
|
+
* @example
|
|
1093
|
+
* // Unmute all remote audio tracks for the local peer
|
|
1094
|
+
* hmsInstance.setPlaybackForAllAudio(false);
|
|
1095
|
+
*
|
|
1096
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/playback-allowed
|
|
707
1097
|
*/
|
|
708
|
-
setPlaybackForAllAudio = (mute: boolean) => {
|
|
1098
|
+
setPlaybackForAllAudio = async (mute: boolean): Promise<boolean> => {
|
|
709
1099
|
logger?.verbose('#Function setPlaybackForAllAudio', { mute, id: this.id });
|
|
710
|
-
this.
|
|
711
|
-
HMSManager.setPlaybackForAllAudio({ mute, id: this.id });
|
|
1100
|
+
return await HMSManager.setPlaybackForAllAudio({ mute, id: this.id });
|
|
712
1101
|
};
|
|
713
1102
|
|
|
714
1103
|
/**
|
|
715
|
-
*
|
|
1104
|
+
* Mutes the audio for all peers in the room.
|
|
716
1105
|
*
|
|
1106
|
+
* This asynchronous function communicates with the native `HMSManager` module to mute the audio tracks of all remote peers in the room.
|
|
1107
|
+
* It is particularly useful in scenarios where a moderator needs to quickly mute all participants to prevent background noise or interruptions during a session.
|
|
1108
|
+
*
|
|
1109
|
+
* @async
|
|
1110
|
+
* @function remoteMuteAllAudio
|
|
717
1111
|
* @memberof HMSSDK
|
|
1112
|
+
* @returns {Promise<{success: boolean}>} A promise that resolves with a boolean value indicating the success of the operation.
|
|
1113
|
+
* @throws {Error} Throws an error if the operation fails.
|
|
1114
|
+
* @example
|
|
1115
|
+
* // Mute all remote audio tracks in the room
|
|
1116
|
+
* await hmsInstance.remoteMuteAllAudio();
|
|
1117
|
+
*
|
|
1118
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/remote-mute
|
|
718
1119
|
*/
|
|
719
|
-
remoteMuteAllAudio = async () => {
|
|
1120
|
+
remoteMuteAllAudio = async (): Promise<{ success: boolean }> => {
|
|
720
1121
|
logger?.verbose('#Function remoteMuteAllAudio', { id: this.id });
|
|
721
1122
|
return await HMSManager.remoteMuteAllAudio({ id: this.id });
|
|
722
1123
|
};
|
|
723
1124
|
|
|
724
1125
|
/**
|
|
725
|
-
*
|
|
726
|
-
* current room object which is of type {@link HMSRoom}
|
|
1126
|
+
* Retrieves the current room's details.
|
|
727
1127
|
*
|
|
728
|
-
*
|
|
1128
|
+
* This method acts as a wrapper around the native `getRoom` function, providing an easy way to obtain the current room's state and details,
|
|
1129
|
+
* including participants, tracks, and other relevant information. The room object is fetched from the native module and then processed
|
|
1130
|
+
* to match the expected format in the React Native layer. This method is useful for getting the room's state at any point in time, such as
|
|
1131
|
+
* when needing to display current room information or for debugging purposes.
|
|
729
1132
|
*
|
|
1133
|
+
* @async
|
|
1134
|
+
* @function getRoom
|
|
730
1135
|
* @memberof HMSSDK
|
|
731
|
-
* @
|
|
1136
|
+
* @returns {Promise<HMSRoom>} A promise that resolves to the current room object.
|
|
1137
|
+
* @example
|
|
1138
|
+
* // Fetch the current room details
|
|
1139
|
+
* const roomDetails = await hmsInstance.getRoom();
|
|
1140
|
+
* console.log(roomDetails);
|
|
1141
|
+
*
|
|
1142
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods
|
|
732
1143
|
*/
|
|
733
1144
|
getRoom = async (): Promise<HMSRoom> => {
|
|
734
1145
|
logger?.verbose('#Function getRoom', {
|
|
@@ -743,11 +1154,23 @@ export class HMSSDK {
|
|
|
743
1154
|
};
|
|
744
1155
|
|
|
745
1156
|
/**
|
|
746
|
-
*
|
|
747
|
-
*
|
|
1157
|
+
* Retrieves the current local peer's details.
|
|
1158
|
+
*
|
|
1159
|
+
* This asynchronous method wraps around the native `getLocalPeer` function, providing a straightforward way to obtain the current local peer's details,
|
|
1160
|
+
* including their ID, name, role, and any tracks they may be publishing. The local peer object is fetched from the native module and then processed
|
|
1161
|
+
* to match the expected format in the React Native layer. This method is particularly useful for operations that require information about the local user,
|
|
1162
|
+
* such as updating UI elements to reflect the current user's status or for debugging purposes.
|
|
748
1163
|
*
|
|
1164
|
+
* @async
|
|
1165
|
+
* @function getLocalPeer
|
|
749
1166
|
* @memberof HMSSDK
|
|
750
|
-
* @
|
|
1167
|
+
* @returns {Promise<HMSLocalPeer>} A promise that resolves to the current local peer object.
|
|
1168
|
+
* @example
|
|
1169
|
+
* // Fetch the current local peer's details
|
|
1170
|
+
* const localPeerDetails = await hmsInstance.getLocalPeer();
|
|
1171
|
+
* console.log(localPeerDetails);
|
|
1172
|
+
*
|
|
1173
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods
|
|
751
1174
|
*/
|
|
752
1175
|
getLocalPeer = async (): Promise<HMSLocalPeer> => {
|
|
753
1176
|
logger?.verbose('#Function getLocalPeer', {
|
|
@@ -760,11 +1183,22 @@ export class HMSSDK {
|
|
|
760
1183
|
};
|
|
761
1184
|
|
|
762
1185
|
/**
|
|
763
|
-
*
|
|
764
|
-
* remote peers array which is of type {@link HMSRemotePeer}
|
|
1186
|
+
* Retrieves an array of remote peers currently in the room.
|
|
765
1187
|
*
|
|
1188
|
+
* This asynchronous method serves as a wrapper around the native `getRemotePeers` function, facilitating the retrieval of remote peers' details.
|
|
1189
|
+
* It fetches an array of `HMSRemotePeer` objects, each representing a remote participant in the room. The method processes the fetched data
|
|
1190
|
+
* to conform to the expected format in the React Native layer, making it suitable for UI rendering or further processing.
|
|
1191
|
+
*
|
|
1192
|
+
* @async
|
|
1193
|
+
* @function getRemotePeers
|
|
766
1194
|
* @memberof HMSSDK
|
|
767
|
-
* @
|
|
1195
|
+
* @returns {Promise<HMSRemotePeer[]>} A promise that resolves with an array of `HMSRemotePeer` objects, representing the remote peers in the room.
|
|
1196
|
+
* @example
|
|
1197
|
+
* // Fetch the list of remote peers in the room
|
|
1198
|
+
* const remotePeers = await hmsInstance.getRemotePeers();
|
|
1199
|
+
* console.log(remotePeers);
|
|
1200
|
+
*
|
|
1201
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods
|
|
768
1202
|
*/
|
|
769
1203
|
getRemotePeers = async (): Promise<HMSRemotePeer[]> => {
|
|
770
1204
|
logger?.verbose('#Function getRemotePeers', {
|
|
@@ -780,11 +1214,22 @@ export class HMSSDK {
|
|
|
780
1214
|
};
|
|
781
1215
|
|
|
782
1216
|
/**
|
|
783
|
-
*
|
|
784
|
-
* array of all present roles which is of type {@link HMSRole}
|
|
1217
|
+
* Retrieves a list of all roles currently available in the room.
|
|
785
1218
|
*
|
|
1219
|
+
* This asynchronous method calls the native `getRoles` function to fetch an array of `HMSRole` objects, representing the roles defined for the room.
|
|
1220
|
+
* Each `HMSRole` object includes details such as the role name, permissions, and other role-specific settings. The roles are then processed
|
|
1221
|
+
* to match the expected format in the React Native layer. This method is useful for operations that require a comprehensive list of roles,
|
|
1222
|
+
* such as displaying role options in a UI dropdown for role assignment or for role-based access control checks.
|
|
1223
|
+
*
|
|
1224
|
+
* @async
|
|
1225
|
+
* @function getRoles
|
|
786
1226
|
* @memberof HMSSDK
|
|
787
|
-
* @
|
|
1227
|
+
* @returns {Promise<HMSRole[]>} A promise that resolves with an array of `HMSRole` objects, representing the available roles in the room.
|
|
1228
|
+
*
|
|
1229
|
+
* @example
|
|
1230
|
+
* // Fetch the list of available roles in the room
|
|
1231
|
+
* const roles = await hmsInstance.getRoles();
|
|
1232
|
+
* console.log(roles);
|
|
788
1233
|
*/
|
|
789
1234
|
getRoles = async (): Promise<HMSRole[]> => {
|
|
790
1235
|
logger?.verbose('#Function getRoles', {
|
|
@@ -797,55 +1242,57 @@ export class HMSSDK {
|
|
|
797
1242
|
};
|
|
798
1243
|
|
|
799
1244
|
/**
|
|
800
|
-
*
|
|
1245
|
+
* Sets the volume for a specific track of any peer in the room.
|
|
1246
|
+
*
|
|
1247
|
+
* This function allows the adjustment of the playback volume for any given audio track of a peer within the room.
|
|
1248
|
+
* It is particularly useful for controlling the audio levels of individual participants in a conference call or meeting.
|
|
1249
|
+
* The volume level is specified as a number. Volume level can vary from 0(min) to 10(max). The default value for volume is 1.0.
|
|
801
1250
|
*
|
|
802
|
-
*
|
|
1251
|
+
* @param {HMSTrack} track - The track object whose volume is to be set. This object must include a valid `trackId`.
|
|
1252
|
+
* @param {number} volume - The volume level to set for the specified track.
|
|
1253
|
+
* @returns {Promise<void>} A promise that resolves when the operation to set the track's volume is complete.
|
|
1254
|
+
* @throws {Error} Throws an error if the operation fails or the track cannot be found.
|
|
803
1255
|
*
|
|
1256
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/set-volume
|
|
1257
|
+
*
|
|
1258
|
+
* @async
|
|
804
1259
|
* @memberof HMSSDK
|
|
1260
|
+
*
|
|
1261
|
+
* @example
|
|
1262
|
+
* // Assuming `track` is an instance of HMSTrack representing the participant's audio track
|
|
1263
|
+
* hmsInstance.setVolume(track, 10);
|
|
805
1264
|
*/
|
|
806
|
-
setVolume = (track: HMSTrack, volume: number) => {
|
|
1265
|
+
setVolume = async (track: HMSTrack, volume: number): Promise<void> => {
|
|
807
1266
|
logger?.verbose('#Function setVolume', {
|
|
808
1267
|
track,
|
|
809
1268
|
volume,
|
|
810
1269
|
id: this.id,
|
|
811
1270
|
});
|
|
812
|
-
HMSManager.setVolume({
|
|
1271
|
+
return await HMSManager.setVolume({
|
|
813
1272
|
id: this.id,
|
|
814
1273
|
trackId: track.trackId,
|
|
815
1274
|
volume,
|
|
816
1275
|
});
|
|
817
1276
|
};
|
|
818
1277
|
|
|
819
|
-
resetVolume = () => {
|
|
820
|
-
logger?.verbose('#Function resetVolume', { id: this.id });
|
|
821
|
-
if (Platform.OS === 'android') HMSManager.resetVolume({ id: this.id });
|
|
822
|
-
};
|
|
823
|
-
|
|
824
1278
|
/**
|
|
825
|
-
*
|
|
826
|
-
* user returns to the app with no mic access. It will re-acquire the mic by setting the volume
|
|
827
|
-
* from native side
|
|
1279
|
+
* Initiates screen sharing in the room.
|
|
828
1280
|
*
|
|
829
|
-
*
|
|
830
|
-
|
|
831
|
-
addAppStateListener = () => {
|
|
832
|
-
logger?.verbose('#Function addAppStateListener', { id: this.id });
|
|
833
|
-
this.appStateSubscription = AppState.addEventListener(
|
|
834
|
-
'change',
|
|
835
|
-
(nextAppState) => {
|
|
836
|
-
if (nextAppState === 'active' && Platform.OS === 'android') {
|
|
837
|
-
this.resetVolume();
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
);
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
/**
|
|
844
|
-
* - This function is used to start screenshare, currently available only for android
|
|
1281
|
+
* This asynchronous function triggers the screen sharing feature, allowing the local peer to share their screen with other participants in the room.
|
|
1282
|
+
* Upon successful execution, other participants in the room will be able to see the shared screen as part of the video conference.
|
|
845
1283
|
*
|
|
846
|
-
*
|
|
1284
|
+
* Note: Proper permissions must be granted by the user for screen sharing to work. Ensure to handle permission requests appropriately in your application.
|
|
847
1285
|
*
|
|
1286
|
+
* @async
|
|
1287
|
+
* @function startScreenshare
|
|
848
1288
|
* @memberof HMSSDK
|
|
1289
|
+
* @returns {Promise<void>} A promise that resolves when the screen sharing has successfully started.
|
|
1290
|
+
* @throws {Error} Throws an error if the operation fails or screen sharing cannot be initiated.
|
|
1291
|
+
*
|
|
1292
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
|
|
1293
|
+
* @example
|
|
1294
|
+
* // Start screen sharing
|
|
1295
|
+
* await hmsInstance.startScreenshare();
|
|
849
1296
|
*/
|
|
850
1297
|
startScreenshare = async () => {
|
|
851
1298
|
logger?.verbose('#Function startScreenshare', { id: this.id });
|
|
@@ -853,46 +1300,115 @@ export class HMSSDK {
|
|
|
853
1300
|
};
|
|
854
1301
|
|
|
855
1302
|
/**
|
|
856
|
-
*
|
|
1303
|
+
* Checks if the screen sharing is currently active in the room.
|
|
857
1304
|
*
|
|
858
|
-
*
|
|
1305
|
+
* This asynchronous method queries the native `HMSManager` module to determine if the screen is currently being shared by the local peer in the room.
|
|
1306
|
+
* It returns a promise that resolves to a boolean value, indicating the screen sharing status. `true` signifies that the screen sharing is active,
|
|
1307
|
+
* while `false` indicates that it is not. This method can be used to toggle UI elements or to decide whether to start or stop screen sharing based on the current state.
|
|
859
1308
|
*
|
|
1309
|
+
* @async
|
|
1310
|
+
* @function isScreenShared
|
|
860
1311
|
* @memberof HMSSDK
|
|
1312
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the screen is currently shared.
|
|
1313
|
+
* @example
|
|
1314
|
+
* // Check if the screen is currently shared
|
|
1315
|
+
* const isShared = await hmsInstance.isScreenShared();
|
|
1316
|
+
* console.log(isShared ? "Screen is being shared" : "Screen is not being shared");
|
|
1317
|
+
*
|
|
1318
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
|
|
861
1319
|
*/
|
|
862
|
-
isScreenShared = async () => {
|
|
1320
|
+
isScreenShared = async (): Promise<boolean> => {
|
|
863
1321
|
logger?.verbose('#Function isScreenShared', { id: this.id });
|
|
864
1322
|
return await HMSManager.isScreenShared({ id: this.id });
|
|
865
1323
|
};
|
|
866
1324
|
|
|
867
1325
|
/**
|
|
868
|
-
*
|
|
1326
|
+
* Asynchronously stops the screen sharing session.
|
|
1327
|
+
*
|
|
1328
|
+
* This method communicates with the native `HMSManager` module to stop the ongoing screen sharing session initiated by the local peer.
|
|
1329
|
+
* Upon successful execution, the screen sharing session is terminated, and other participants
|
|
1330
|
+
* in the room will no longer be able to see the shared screen. This method can be used to programmatically control the end of a screen sharing session,
|
|
1331
|
+
* providing flexibility in managing the screen sharing feature within your application.
|
|
869
1332
|
*
|
|
870
|
-
*
|
|
1333
|
+
* Note: Ensure that the necessary permissions and conditions for screen sharing are managed appropriately in your application.
|
|
871
1334
|
*
|
|
1335
|
+
* @async
|
|
1336
|
+
* @function stopScreenshare
|
|
872
1337
|
* @memberof HMSSDK
|
|
1338
|
+
* @returns {Promise<void>} A promise that resolves when the screen sharing has successfully stopped.
|
|
1339
|
+
* @throws {Error} Throws an error if the operation fails or the screen sharing cannot be stopped.
|
|
1340
|
+
*
|
|
1341
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
|
|
1342
|
+
* @example
|
|
1343
|
+
* // Stop screen sharing
|
|
1344
|
+
* await hmsInstance.stopScreenshare();
|
|
873
1345
|
*/
|
|
874
1346
|
stopScreenshare = async () => {
|
|
875
1347
|
logger?.verbose('#Function stopScreenshare', { id: this.id });
|
|
876
1348
|
return await HMSManager.stopScreenshare({ id: this.id });
|
|
877
1349
|
};
|
|
878
1350
|
|
|
1351
|
+
/**
|
|
1352
|
+
* Enables network quality updates for the local peer.
|
|
1353
|
+
*
|
|
1354
|
+
* This method activates the network quality monitoring feature, which periodically assesses and reports the network quality of peers in a room.
|
|
1355
|
+
* The network quality updates are useful for providing feedback to the user about their current connection status, potentially prompting them to improve their network environment if necessary.
|
|
1356
|
+
* Upon enabling, network quality updates are emitted through the appropriate event listeners - `HMSPeerUpdate.NETWORK_QUALITY_UPDATED` allowing the application to react or display the network status dynamically.
|
|
1357
|
+
*
|
|
1358
|
+
* @function enableNetworkQualityUpdates
|
|
1359
|
+
* @memberof HMSSDK
|
|
1360
|
+
* @example
|
|
1361
|
+
* // Enable network quality updates
|
|
1362
|
+
* hmsInstance.enableNetworkQualityUpdates();
|
|
1363
|
+
*
|
|
1364
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
|
|
1365
|
+
*/
|
|
879
1366
|
enableNetworkQualityUpdates = () => {
|
|
880
1367
|
logger?.verbose('#Function enableNetworkQualityUpdates', { id: this.id });
|
|
881
1368
|
HMSManager.enableNetworkQualityUpdates({ id: this.id });
|
|
882
1369
|
};
|
|
883
1370
|
|
|
1371
|
+
/**
|
|
1372
|
+
* Disables network quality updates for the local peer.
|
|
1373
|
+
*
|
|
1374
|
+
* This method deactivates the network quality monitoring feature, which stops the periodic assessment and reporting of the network quality of peers in a room.
|
|
1375
|
+
* Disabling network quality updates can be useful in scenarios where network quality information is no longer needed, or to reduce the computational overhead associated with monitoring network quality.
|
|
1376
|
+
* Once disabled, network quality updates will no longer be emitted through the event listeners, allowing the application to cease reacting to or displaying network status information.
|
|
1377
|
+
*
|
|
1378
|
+
* @function disableNetworkQualityUpdates
|
|
1379
|
+
* @memberof HMSSDK
|
|
1380
|
+
* @example
|
|
1381
|
+
* // Disable network quality updates
|
|
1382
|
+
* hmsInstance.disableNetworkQualityUpdates();
|
|
1383
|
+
*
|
|
1384
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
|
|
1385
|
+
*/
|
|
884
1386
|
disableNetworkQualityUpdates = () => {
|
|
885
1387
|
logger?.verbose('#Function disableNetworkQualityUpdates', { id: this.id });
|
|
886
1388
|
HMSManager.disableNetworkQualityUpdates({ id: this.id });
|
|
887
1389
|
};
|
|
888
1390
|
|
|
889
1391
|
/**
|
|
890
|
-
*
|
|
1392
|
+
* Starts streaming device audio, available only on Android devices.
|
|
891
1393
|
*
|
|
892
|
-
*
|
|
1394
|
+
* This method allows the application to share device audio, such as music or system sounds, with other participants in a video conference.
|
|
1395
|
+
* It leverages the native HMSManager's `startAudioshare` method to initiate audio sharing. The function takes an `HMSAudioMixingMode` parameter,
|
|
1396
|
+
* which specifies the audio mixing mode to be used during the audio share session.
|
|
893
1397
|
*
|
|
894
|
-
*
|
|
895
|
-
*
|
|
1398
|
+
* Note: This feature is currently supported only on Android. Attempting to use this feature on iOS will result in a console log indicating
|
|
1399
|
+
* that the API is not available for iOS.
|
|
1400
|
+
*
|
|
1401
|
+
* @async
|
|
1402
|
+
* @function startAudioshare
|
|
1403
|
+
* @param {HMSAudioMixingMode} audioMixingMode - The audio mixing mode to be used for the audio share session.
|
|
1404
|
+
* @returns {Promise} A promise that resolves to a success if the audio share is started successfully
|
|
1405
|
+
* @throws {Error} Throws an error if the operation fails or the audio share cannot be started.
|
|
1406
|
+
*
|
|
1407
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
|
|
1408
|
+
*
|
|
1409
|
+
* @example
|
|
1410
|
+
* // Start audio sharing with the default mixing mode
|
|
1411
|
+
* await hmsInstance.startAudioshare(HMSAudioMixingMode.DEFAULT);
|
|
896
1412
|
*/
|
|
897
1413
|
startAudioshare = async (audioMixingMode: HMSAudioMixingMode) => {
|
|
898
1414
|
logger?.verbose('#Function startAudioshare', {
|
|
@@ -908,64 +1424,114 @@ export class HMSSDK {
|
|
|
908
1424
|
};
|
|
909
1425
|
|
|
910
1426
|
/**
|
|
911
|
-
*
|
|
1427
|
+
* Checks if audio sharing is currently active.
|
|
912
1428
|
*
|
|
913
|
-
*
|
|
1429
|
+
* This asynchronous method determines whether audio sharing is currently active, with support limited to Android devices.
|
|
1430
|
+
* On Android, it queries the native `HMSManager` module to check the audio sharing status and returns a promise that resolves to a boolean value.
|
|
914
1431
|
*
|
|
1432
|
+
* @async
|
|
1433
|
+
* @function isAudioShared
|
|
915
1434
|
* @memberof HMSSDK
|
|
1435
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether audio sharing is currently active.
|
|
1436
|
+
* @example
|
|
1437
|
+
* // Check if audio is being shared on an Android device
|
|
1438
|
+
* const isSharing = await hmsInstance.isAudioShared();
|
|
1439
|
+
* console.log(isSharing); // true or false based on the sharing status, or a message for iOS
|
|
1440
|
+
*
|
|
1441
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
|
|
916
1442
|
*/
|
|
917
|
-
isAudioShared = async () => {
|
|
1443
|
+
isAudioShared = async (): Promise<boolean> => {
|
|
918
1444
|
logger?.verbose('#Function isAudioShared', { id: this.id });
|
|
919
1445
|
if (Platform.OS === 'android') {
|
|
920
1446
|
return await HMSManager.isAudioShared({ id: this.id });
|
|
921
1447
|
} else {
|
|
922
1448
|
console.log('API currently not available for iOS');
|
|
923
|
-
return
|
|
1449
|
+
return Promise.resolve(false);
|
|
924
1450
|
}
|
|
925
1451
|
};
|
|
926
1452
|
|
|
927
1453
|
/**
|
|
928
|
-
*
|
|
1454
|
+
* Stops the streaming of device audio, with functionality currently limited to Android devices.
|
|
929
1455
|
*
|
|
930
|
-
*
|
|
1456
|
+
* This asynchronous method communicates with the native `HMSManager` module to stop the audio sharing session that was previously started.
|
|
1457
|
+
* It is primarily used when the application needs to cease sharing device audio, such as music or system sounds, with other participants in a video conference.
|
|
1458
|
+
* On Android devices, it successfully terminates the audio share session. On iOS devices, since the feature is not supported, it logs a message indicating the unavailability of the API.
|
|
931
1459
|
*
|
|
1460
|
+
* @async
|
|
1461
|
+
* @function stopAudioshare
|
|
932
1462
|
* @memberof HMSSDK
|
|
1463
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating the success of the operation.
|
|
1464
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
|
|
1465
|
+
*
|
|
1466
|
+
* @example
|
|
1467
|
+
* // Stop audio sharing
|
|
1468
|
+
* await hmsInstance.stopAudioshare();
|
|
933
1469
|
*/
|
|
934
|
-
stopAudioshare = async () => {
|
|
1470
|
+
stopAudioshare = async (): Promise<boolean> => {
|
|
935
1471
|
logger?.verbose('#Function stopAudioshare', { id: this.id });
|
|
936
1472
|
if (Platform.OS === 'android') {
|
|
937
1473
|
return await HMSManager.stopAudioshare({ id: this.id });
|
|
938
1474
|
} else {
|
|
939
1475
|
console.log('API currently not available for iOS');
|
|
940
|
-
return
|
|
1476
|
+
return Promise.resolve(false);
|
|
941
1477
|
}
|
|
942
1478
|
};
|
|
943
1479
|
|
|
944
1480
|
/**
|
|
945
|
-
*
|
|
1481
|
+
* Asynchronously retrieves the current audio mixing mode, with functionality currently limited to Android devices.
|
|
1482
|
+
*
|
|
1483
|
+
* This method queries the native `HMSManager` module to obtain the current audio mixing mode used in the audio share session.
|
|
1484
|
+
* The audio mixing mode determines how local and remote audio tracks are mixed together during an audio share session.
|
|
946
1485
|
*
|
|
1486
|
+
* Note: This feature is only supported on Android. Attempting to use this feature on iOS will result in a console log indicating
|
|
1487
|
+
* that the API is not available for iOS devices.
|
|
1488
|
+
*
|
|
1489
|
+
* @async
|
|
1490
|
+
* @function getAudioMixingMode
|
|
947
1491
|
* @memberof HMSSDK
|
|
948
|
-
* @
|
|
1492
|
+
* @returns {Promise<string>} A promise that resolves to a string indicating the current audio mixing mode.
|
|
1493
|
+
*
|
|
1494
|
+
* @throws {Error} Throws an error if the operation fails or the audio mixing mode cannot be retrieved.
|
|
1495
|
+
*
|
|
1496
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
|
|
1497
|
+
* @example
|
|
1498
|
+
* // Get the current audio mixing mode on an Android device
|
|
1499
|
+
* const mixingMode = await hmsInstance.getAudioMixingMode();
|
|
1500
|
+
* console.log(mixingMode); // Outputs the current audio mixing mode or a message for iOS
|
|
949
1501
|
*/
|
|
950
|
-
getAudioMixingMode = async () => {
|
|
1502
|
+
getAudioMixingMode = async (): Promise<string> => {
|
|
951
1503
|
logger?.verbose('#Function getAudioMixingMode', { id: this.id });
|
|
952
1504
|
if (Platform.OS === 'android') {
|
|
953
1505
|
return await HMSManager.getAudioMixingMode({ id: this.id });
|
|
954
1506
|
} else {
|
|
955
1507
|
console.log('API currently not available for iOS');
|
|
956
|
-
return 'API currently not available for iOS';
|
|
1508
|
+
return Promise.reject('API currently not available for iOS');
|
|
957
1509
|
}
|
|
958
1510
|
};
|
|
959
1511
|
|
|
960
1512
|
/**
|
|
961
|
-
*
|
|
1513
|
+
* Sets the audio mixing mode for the current session. Android only.
|
|
1514
|
+
*
|
|
1515
|
+
* This asynchronous function is used to change the mode of audio mixing during a session. It is currently
|
|
1516
|
+
* available only for Android. The function logs the action with the instance ID and the specified audio mixing mode,
|
|
1517
|
+
* then calls the native `setAudioMixingMode` method in `HMSManager` with the provided parameters.
|
|
1518
|
+
*
|
|
1519
|
+
* If the platform is not Android, it logs a message indicating that the API is not available for iOS.
|
|
1520
|
+
*
|
|
1521
|
+
* @param {HMSAudioMixingMode} audioMixingMode - The audio mixing mode to be set.
|
|
1522
|
+
* @returns {Promise<boolean>} A promise that resolves to a boolean indicating the success of the operation.
|
|
1523
|
+
* @throws {Error} Throws an error if the operation fails or the audio mixing mode cannot be set.
|
|
962
1524
|
*
|
|
963
|
-
*
|
|
1525
|
+
* @example
|
|
1526
|
+
* await hmsInstance.setAudioMixingMode(HMSAudioMixingMode.TALK_AND_MUSIC);
|
|
1527
|
+
*
|
|
1528
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
|
|
964
1529
|
*
|
|
965
|
-
* @param {HMSAudioMixingMode}
|
|
966
1530
|
* @memberof HMSSDK
|
|
967
1531
|
*/
|
|
968
|
-
setAudioMixingMode = async (
|
|
1532
|
+
setAudioMixingMode = async (
|
|
1533
|
+
audioMixingMode: HMSAudioMixingMode
|
|
1534
|
+
): Promise<boolean> => {
|
|
969
1535
|
logger?.verbose('#Function setAudioMixingMode', {
|
|
970
1536
|
id: this.id,
|
|
971
1537
|
audioMixingMode,
|
|
@@ -977,20 +1543,27 @@ export class HMSSDK {
|
|
|
977
1543
|
});
|
|
978
1544
|
} else {
|
|
979
1545
|
console.log('API currently not available for iOS');
|
|
980
|
-
return 'API currently not available for iOS';
|
|
1546
|
+
return Promise.reject('API currently not available for iOS');
|
|
981
1547
|
}
|
|
982
1548
|
};
|
|
983
1549
|
|
|
984
1550
|
/**
|
|
985
|
-
*
|
|
986
|
-
*
|
|
1551
|
+
* Retrieves a list of audio output devices. Android only.
|
|
1552
|
+
*
|
|
1553
|
+
* This method asynchronously fetches and returns an array of audio output devices available on the device.
|
|
1554
|
+
* It is designed to work specifically on Android platforms. For iOS, it will reject the promise with a message
|
|
1555
|
+
* indicating that the API is not available. This can be useful for applications that need to display or allow
|
|
1556
|
+
* the user to select from available audio output options, such as speakers, headphones, or Bluetooth devices.
|
|
987
1557
|
*
|
|
988
|
-
*
|
|
1558
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-output-routing
|
|
989
1559
|
*
|
|
990
1560
|
* @memberof HMSSDK
|
|
991
|
-
* @
|
|
1561
|
+
* @returns {Promise<HMSAudioDevice[]>} A promise that resolves to an array of `HMSAudioDevice` objects on Android. On iOS, the promise is rejected.
|
|
1562
|
+
* @example
|
|
1563
|
+
* // Get the list of audio output devices
|
|
1564
|
+
* const audioDevices = await hmsInstance.getAudioDevicesList();
|
|
992
1565
|
*/
|
|
993
|
-
getAudioDevicesList = async () => {
|
|
1566
|
+
getAudioDevicesList = async (): Promise<HMSAudioDevice[]> => {
|
|
994
1567
|
logger?.verbose('#Function getAudioDevicesList', {
|
|
995
1568
|
id: this.id,
|
|
996
1569
|
});
|
|
@@ -998,20 +1571,28 @@ export class HMSSDK {
|
|
|
998
1571
|
return await HMSManager.getAudioDevicesList({ id: this.id });
|
|
999
1572
|
} else {
|
|
1000
1573
|
console.log('API currently not available for iOS');
|
|
1001
|
-
return 'API currently not available for iOS';
|
|
1574
|
+
return Promise.reject('API currently not available for iOS');
|
|
1002
1575
|
}
|
|
1003
1576
|
};
|
|
1004
1577
|
|
|
1005
1578
|
/**
|
|
1006
|
-
*
|
|
1007
|
-
*
|
|
1579
|
+
* Retrieves the current audio output device type on Android devices.
|
|
1580
|
+
*
|
|
1581
|
+
* This method is a wrapper function that returns the type of the current audio output device.
|
|
1582
|
+
* The return type is a `HMSAudioDevice`, which is an enumeration representing different types of audio output devices.
|
|
1583
|
+
*
|
|
1584
|
+
* Note: This API is not available for iOS devices. If invoked on iOS, it logs a message indicating the unavailability and rejects the promise.
|
|
1008
1585
|
*
|
|
1009
|
-
*
|
|
1586
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-output-routing
|
|
1010
1587
|
*
|
|
1011
1588
|
* @memberof HMSSDK
|
|
1012
|
-
* @
|
|
1589
|
+
* @returns {Promise<HMSAudioDevice>} A promise that resolves to the current audio output device type if the platform is Android. If the platform is iOS, the promise is rejected.
|
|
1590
|
+
*
|
|
1591
|
+
* @example
|
|
1592
|
+
* // Get the current audio output device type
|
|
1593
|
+
* const currentAudioOutputDevice = await hmsInstance.getAudioOutputRouteType();
|
|
1013
1594
|
*/
|
|
1014
|
-
getAudioOutputRouteType = async () => {
|
|
1595
|
+
getAudioOutputRouteType = async (): Promise<HMSAudioDevice> => {
|
|
1015
1596
|
logger?.verbose('#Function getAudioOutputRouteType', {
|
|
1016
1597
|
id: this.id,
|
|
1017
1598
|
});
|
|
@@ -1019,30 +1600,32 @@ export class HMSSDK {
|
|
|
1019
1600
|
return await HMSManager.getAudioOutputRouteType({ id: this.id });
|
|
1020
1601
|
} else {
|
|
1021
1602
|
console.log('API currently not available for iOS');
|
|
1022
|
-
return 'API currently not available for iOS';
|
|
1603
|
+
return Promise.reject('API currently not available for iOS');
|
|
1023
1604
|
}
|
|
1024
1605
|
};
|
|
1025
1606
|
|
|
1026
1607
|
/**
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1608
|
+
* Switches the audio output device to a specified device.
|
|
1609
|
+
* This function is a wrapper around the native module's method to change the audio output route.
|
|
1610
|
+
* It allows for changing the audio output to a device other than the default one, such as a Bluetooth headset or speaker.
|
|
1611
|
+
*
|
|
1612
|
+
* @param {HMSAudioDevice} audioDevice - The audio device to switch the output to. This should be one of the devices available in `HMSAudioDevice`.
|
|
1029
1613
|
*
|
|
1030
|
-
*
|
|
1614
|
+
* @returns {Promise<void>} A promise that resolves when the audio output device is successfully switched. Rejected if the operation fails.
|
|
1615
|
+
*
|
|
1616
|
+
* @example
|
|
1617
|
+
* // To switch audio output to a Bluetooth device
|
|
1618
|
+
* hmsSDK.switchAudioOutput(HMSAudioDevice.Bluetooth);
|
|
1031
1619
|
*
|
|
1032
1620
|
* @memberof HMSSDK
|
|
1033
|
-
* @param audioDevice
|
|
1034
1621
|
*/
|
|
1035
|
-
switchAudioOutput = (audioDevice: HMSAudioDevice) => {
|
|
1622
|
+
switchAudioOutput = (audioDevice: HMSAudioDevice): Promise<void> => {
|
|
1036
1623
|
logger?.verbose('#Function switchAudioOutput', {
|
|
1037
1624
|
id: this.id,
|
|
1038
1625
|
audioDevice,
|
|
1039
1626
|
});
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
} else {
|
|
1043
|
-
console.log('API currently not available for iOS');
|
|
1044
|
-
return 'API currently not available for iOS';
|
|
1045
|
-
}
|
|
1627
|
+
|
|
1628
|
+
return HMSManager.switchAudioOutput({ id: this.id, audioDevice });
|
|
1046
1629
|
};
|
|
1047
1630
|
|
|
1048
1631
|
switchAudioOutputUsingIOSUI = () => {
|
|
@@ -1061,7 +1644,7 @@ export class HMSSDK {
|
|
|
1061
1644
|
/**
|
|
1062
1645
|
* - This wrapper function used to change Audio Mode manually, currently available only for android.
|
|
1063
1646
|
*
|
|
1064
|
-
*
|
|
1647
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-mode-change
|
|
1065
1648
|
*
|
|
1066
1649
|
* @param {HMSAudioMode}
|
|
1067
1650
|
* @memberof HMSSDK
|
|
@@ -1080,12 +1663,16 @@ export class HMSSDK {
|
|
|
1080
1663
|
};
|
|
1081
1664
|
|
|
1082
1665
|
/**
|
|
1083
|
-
*
|
|
1666
|
+
* Adds a listener for changes in the audio output device.
|
|
1667
|
+
* This function is platform-specific and currently only implemented for Android devices.
|
|
1668
|
+
* When the audio output device changes (e.g., switching from the phone speaker to a Bluetooth headset), the specified callback function is triggered.
|
|
1669
|
+
* This can be useful for applications that need to react to changes in audio routing, such as updating the UI to reflect the current output device.
|
|
1084
1670
|
*
|
|
1085
|
-
*
|
|
1671
|
+
* Note: This API is not available on iOS as of the current implementation. Attempting to use it on iOS will result in a rejected promise with an appropriate error message.
|
|
1086
1672
|
*
|
|
1087
|
-
* @param {Function}
|
|
1673
|
+
* @param {Function} callback - The function to be called when the audio output device changes. This function does not receive any parameters.
|
|
1088
1674
|
* @memberof HMSSDK
|
|
1675
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-output-routing
|
|
1089
1676
|
*/
|
|
1090
1677
|
setAudioDeviceChangeListener = (callback: Function) => {
|
|
1091
1678
|
logger?.verbose('#Function setAudioDeviceChangeListener', {
|
|
@@ -1099,11 +1686,19 @@ export class HMSSDK {
|
|
|
1099
1686
|
return HMSManager.setAudioDeviceChangeListener({ id: this.id });
|
|
1100
1687
|
} else {
|
|
1101
1688
|
console.log('API currently not available for iOS');
|
|
1102
|
-
return 'API currently not available for iOS';
|
|
1689
|
+
return Promise.reject('API currently not available for iOS');
|
|
1103
1690
|
}
|
|
1104
1691
|
};
|
|
1105
1692
|
|
|
1106
|
-
|
|
1693
|
+
/**
|
|
1694
|
+
* Asynchronously retrieves a remote video track by its track ID.
|
|
1695
|
+
*
|
|
1696
|
+
* @param {string} trackId - The unique identifier for the remote video track to be retrieved.
|
|
1697
|
+
* @returns {Promise<HMSRemoteVideoTrack>} A promise that resolves to the encoded remote video track data.
|
|
1698
|
+
*/
|
|
1699
|
+
getRemoteVideoTrackFromTrackId = async (
|
|
1700
|
+
trackId: string
|
|
1701
|
+
): Promise<HMSRemoteVideoTrack> => {
|
|
1107
1702
|
logger?.verbose('#Function getRemoteVideoTrackFromTrackId', {
|
|
1108
1703
|
id: this.id,
|
|
1109
1704
|
trackId,
|
|
@@ -1117,20 +1712,37 @@ export class HMSSDK {
|
|
|
1117
1712
|
return HMSEncoder.encodeHmsRemoteVideoTrack(remoteVideoTrackData, this.id);
|
|
1118
1713
|
};
|
|
1119
1714
|
|
|
1120
|
-
|
|
1715
|
+
/**
|
|
1716
|
+
* Retrieves a remote audio track by its track ID.
|
|
1717
|
+
*
|
|
1718
|
+
* @param {string} trackId - The unique identifier for the remote audio track to be retrieved.
|
|
1719
|
+
* @returns {Promise<HMSRemoteAudioTrack>} A promise that resolves to the encoded remote audio track data.
|
|
1720
|
+
*/
|
|
1721
|
+
getRemoteAudioTrackFromTrackId = async (
|
|
1722
|
+
trackId: string
|
|
1723
|
+
): Promise<HMSRemoteAudioTrack> => {
|
|
1724
|
+
// Log the function call with the track ID for debugging purposes.
|
|
1121
1725
|
logger?.verbose('#Function getRemoteAudioTrackFromTrackId', {
|
|
1122
1726
|
id: this.id,
|
|
1123
1727
|
trackId,
|
|
1124
1728
|
});
|
|
1125
1729
|
|
|
1730
|
+
// Fetch the remote audio track data from the native HMSManager.
|
|
1126
1731
|
const remoteAudioTrackData =
|
|
1127
1732
|
await HMSManager.getRemoteAudioTrackFromTrackId({
|
|
1128
1733
|
id: this.id,
|
|
1129
1734
|
trackId,
|
|
1130
1735
|
});
|
|
1736
|
+
// Encode and return the remote audio track data.
|
|
1131
1737
|
return HMSEncoder.encodeHmsRemoteAudioTrack(remoteAudioTrackData, this.id);
|
|
1132
1738
|
};
|
|
1133
1739
|
|
|
1740
|
+
/**
|
|
1741
|
+
* Retrieves a peer object based on the provided peer ID.
|
|
1742
|
+
*
|
|
1743
|
+
* @param {string} peerId - The ID of the peer to retrieve.
|
|
1744
|
+
* @returns {HMSPeer | undefined} An encoded HMSPeer object if the peer is found otherwise `undefined`.
|
|
1745
|
+
*/
|
|
1134
1746
|
getPeerFromPeerId = (peerId: string) => {
|
|
1135
1747
|
logger?.verbose('#Function getPeerFromPeerId', {
|
|
1136
1748
|
id: this.id,
|
|
@@ -1187,37 +1799,99 @@ export class HMSSDK {
|
|
|
1187
1799
|
return HMSManager.lowerRemotePeerHand(data);
|
|
1188
1800
|
};
|
|
1189
1801
|
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1802
|
+
/**
|
|
1803
|
+
* `getPeerListIterator` method returns an instance of `HMSPeerListIterator` class
|
|
1804
|
+
*
|
|
1805
|
+
* @param options options for configuring iterator
|
|
1806
|
+
* @returns instance of HMSPeerListIterator class
|
|
1807
|
+
*
|
|
1808
|
+
* Example usage:
|
|
1809
|
+
* ```
|
|
1810
|
+
* const peerListIterator = hmsInstance.getPeerListIterator();
|
|
1811
|
+
* ```
|
|
1812
|
+
* OR
|
|
1813
|
+
* ```
|
|
1814
|
+
* const peerListIterator = hmsInstance.getPeerListIterator({
|
|
1815
|
+
* limit: 10,
|
|
1816
|
+
* byRoleName: 'viewer-realtime',
|
|
1817
|
+
* });
|
|
1818
|
+
* ```
|
|
1819
|
+
*/
|
|
1820
|
+
getPeerListIterator = (
|
|
1821
|
+
options?: HMSPeerListIteratorOptions
|
|
1822
|
+
): HMSPeerListIterator => {
|
|
1823
|
+
logger?.verbose('#Function getPeerListIterator', {
|
|
1824
|
+
id: this.id,
|
|
1825
|
+
options,
|
|
1826
|
+
});
|
|
1197
1827
|
|
|
1198
|
-
|
|
1828
|
+
const uniqueId = Math.random().toString(16).slice(2);
|
|
1199
1829
|
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1830
|
+
const data: null | {
|
|
1831
|
+
sucess: boolean;
|
|
1832
|
+
uniqueId: string;
|
|
1833
|
+
totalCount: number;
|
|
1834
|
+
} = HMSManager.getPeerListIterator({
|
|
1835
|
+
id: this.id,
|
|
1836
|
+
...options,
|
|
1837
|
+
limit: options?.limit ?? 10,
|
|
1838
|
+
uniqueId,
|
|
1839
|
+
});
|
|
1207
1840
|
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1841
|
+
if (!data) {
|
|
1842
|
+
throw new Error('Unable to create PeerListIterator');
|
|
1843
|
+
}
|
|
1211
1844
|
|
|
1212
|
-
|
|
1213
|
-
|
|
1845
|
+
return new HMSPeerListIterator(data.uniqueId, data.totalCount);
|
|
1846
|
+
};
|
|
1214
1847
|
|
|
1215
1848
|
/**
|
|
1216
|
-
* - This
|
|
1849
|
+
* - This function allows the user to set the screen on always.
|
|
1850
|
+
* - This is useful when the user wants to keep the screen on while the app is in the foreground.
|
|
1851
|
+
* @param enabled boolean value to enable or disable the always screen on
|
|
1852
|
+
*/
|
|
1853
|
+
setAlwaysScreenOn = async (enabled: boolean) => {
|
|
1854
|
+
logger?.verbose('#Function toggleAlwaysScreenOn', {
|
|
1855
|
+
id: this.id,
|
|
1856
|
+
enabled,
|
|
1857
|
+
});
|
|
1858
|
+
return HMSManager.setAlwaysScreenOn({ id: this.id, enabled });
|
|
1859
|
+
};
|
|
1860
|
+
|
|
1861
|
+
setPermissionsAcceptedOnAndroid = async () => {
|
|
1862
|
+
if (Platform.OS === 'ios') {
|
|
1863
|
+
Promise.reject(
|
|
1864
|
+
'setPermissionsAcceptedOnAndroid API not available for iOS'
|
|
1865
|
+
);
|
|
1866
|
+
return;
|
|
1867
|
+
}
|
|
1868
|
+
logger?.verbose('#Function setPermissionsAcceptedOnAndroid', {
|
|
1869
|
+
id: this.id,
|
|
1870
|
+
});
|
|
1871
|
+
return await HMSManager.setPermissionsAccepted({ id: this.id });
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Registers an event listener for various HMS SDK events.
|
|
1876
|
+
*
|
|
1877
|
+
* This method allows the registration of callbacks for different types of events that can occur within the HMS SDK.
|
|
1878
|
+
* These events include but are not limited to updates about the room, peers, tracks, and errors.
|
|
1879
|
+
* The method dynamically adds listeners based on the specified action and associates them with a callback function
|
|
1880
|
+
* to handle the event. It ensures that only one subscription exists per event type to avoid duplicate listeners.
|
|
1217
1881
|
*
|
|
1218
|
-
* @param {
|
|
1219
|
-
* @param {
|
|
1882
|
+
* @param {HMSUpdateListenerActions | HMSPIPListenerActions} action - The specific action/event to listen for.
|
|
1883
|
+
* @param {Function} callback - The callback function to execute when the event occurs. The specifics of the callback parameters depend on the event type.
|
|
1220
1884
|
* @memberof HMSSDK
|
|
1885
|
+
*
|
|
1886
|
+
* @example
|
|
1887
|
+
* hmsInstance.addEventListener(HMSUpdateListenerActions.ON_JOIN, (event) => {
|
|
1888
|
+
* console.log('Joined the room:', event);
|
|
1889
|
+
* });
|
|
1890
|
+
*
|
|
1891
|
+
* @example
|
|
1892
|
+
* hmsInstance.addEventListener(HMSUpdateListenerActions.ON_PEER_UPDATE, (event) => {
|
|
1893
|
+
* console.log('Peer update:', event);
|
|
1894
|
+
* });
|
|
1221
1895
|
*/
|
|
1222
1896
|
addEventListener = (
|
|
1223
1897
|
action: HMSUpdateListenerActions | HMSPIPListenerActions,
|
|
@@ -1260,6 +1934,28 @@ export class HMSSDK {
|
|
|
1260
1934
|
this.onJoinDelegate = callback;
|
|
1261
1935
|
break;
|
|
1262
1936
|
}
|
|
1937
|
+
case HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED: {
|
|
1938
|
+
// Checking if we already have ON_PERMISSIONS_REQUESTED subscription
|
|
1939
|
+
if (
|
|
1940
|
+
!this.emitterSubscriptions[
|
|
1941
|
+
HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED
|
|
1942
|
+
]
|
|
1943
|
+
) {
|
|
1944
|
+
// Adding ON_PERMISSIONS_REQUESTED native listener
|
|
1945
|
+
const permissionsRequestedSubscription =
|
|
1946
|
+
HMSNativeEventListener.addListener(
|
|
1947
|
+
this.id,
|
|
1948
|
+
HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED,
|
|
1949
|
+
this.onPermissionsRequestedListener
|
|
1950
|
+
);
|
|
1951
|
+
this.emitterSubscriptions[
|
|
1952
|
+
HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED
|
|
1953
|
+
] = permissionsRequestedSubscription;
|
|
1954
|
+
}
|
|
1955
|
+
// Adding App Delegate listener
|
|
1956
|
+
this.onPermissionsRequestedDelegate = callback;
|
|
1957
|
+
break;
|
|
1958
|
+
}
|
|
1263
1959
|
case HMSUpdateListenerActions.ON_ROOM_UPDATE: {
|
|
1264
1960
|
// Checking if we already have ON_ROOM_UPDATE subscription
|
|
1265
1961
|
if (
|
|
@@ -1278,6 +1974,24 @@ export class HMSSDK {
|
|
|
1278
1974
|
this.onRoomDelegate = callback;
|
|
1279
1975
|
break;
|
|
1280
1976
|
}
|
|
1977
|
+
case HMSUpdateListenerActions.ON_TRANSCRIPTS: {
|
|
1978
|
+
// Checking if we already have ON_TRANSCRIPTS subscription
|
|
1979
|
+
if (
|
|
1980
|
+
!this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS]
|
|
1981
|
+
) {
|
|
1982
|
+
// Adding ON_TRANSCRIPTS native listener
|
|
1983
|
+
const transcriptsSubscription = HMSNativeEventListener.addListener(
|
|
1984
|
+
this.id,
|
|
1985
|
+
HMSUpdateListenerActions.ON_TRANSCRIPTS,
|
|
1986
|
+
this.onTranscriptsListener
|
|
1987
|
+
);
|
|
1988
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS] =
|
|
1989
|
+
transcriptsSubscription;
|
|
1990
|
+
}
|
|
1991
|
+
// Adding App Delegate listener
|
|
1992
|
+
this.onTranscriptsDelegate = callback;
|
|
1993
|
+
break;
|
|
1994
|
+
}
|
|
1281
1995
|
case HMSUpdateListenerActions.ON_PEER_UPDATE: {
|
|
1282
1996
|
// Checking if we already have ON_PEER_UPDATE subscription
|
|
1283
1997
|
if (
|
|
@@ -1644,22 +2358,21 @@ export class HMSSDK {
|
|
|
1644
2358
|
break;
|
|
1645
2359
|
}
|
|
1646
2360
|
case HMSPIPListenerActions.ON_PIP_MODE_CHANGED: {
|
|
1647
|
-
if
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
pipModeChangedSubscription;
|
|
1659
|
-
}
|
|
1660
|
-
// Adding PIP mode changed Delegate listener
|
|
1661
|
-
this.onPIPModeChangedDelegate = callback;
|
|
2361
|
+
// Checking if we already have ON_PIP_MODE_CHANGED subscription
|
|
2362
|
+
if (
|
|
2363
|
+
!this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED]
|
|
2364
|
+
) {
|
|
2365
|
+
const pipModeChangedSubscription = HMSNativeEventListener.addListener(
|
|
2366
|
+
this.id,
|
|
2367
|
+
HMSPIPListenerActions.ON_PIP_MODE_CHANGED,
|
|
2368
|
+
this.onPIPModeChangedListener
|
|
2369
|
+
);
|
|
2370
|
+
this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED] =
|
|
2371
|
+
pipModeChangedSubscription;
|
|
1662
2372
|
}
|
|
2373
|
+
// Adding PIP mode changed Delegate listener
|
|
2374
|
+
this.onPIPModeChangedDelegate = callback;
|
|
2375
|
+
|
|
1663
2376
|
break;
|
|
1664
2377
|
}
|
|
1665
2378
|
default:
|
|
@@ -1667,11 +2380,21 @@ export class HMSSDK {
|
|
|
1667
2380
|
};
|
|
1668
2381
|
|
|
1669
2382
|
/**
|
|
1670
|
-
*
|
|
2383
|
+
* Removes an event listener for a specified event action.
|
|
2384
|
+
*
|
|
2385
|
+
* This method allows for the deregistration of previously registered callbacks for specific event types within the HMS SDK.
|
|
2386
|
+
* By specifying the action and the callback, it ensures that the event listener associated with that action is removed,
|
|
2387
|
+
* preventing the callback from being executed when the event occurs in the future. This is useful for cleaning up resources
|
|
2388
|
+
* and avoiding potential memory leaks in applications that dynamically add and remove event listeners based on component lifecycle
|
|
2389
|
+
* or user interactions.
|
|
1671
2390
|
*
|
|
1672
|
-
* @param {
|
|
1673
|
-
* @param {
|
|
2391
|
+
* @param {HMSUpdateListenerActions | HMSPIPListenerActions} action - The specific action/event for which the listener is to be removed.
|
|
2392
|
+
* @param {Function} callback - The callback function that was originally registered for the event. This parameter is necessary to ensure
|
|
2393
|
+
* that only the specific callback associated with the action is removed.
|
|
1674
2394
|
* @memberof HMSSDK
|
|
2395
|
+
* @example
|
|
2396
|
+
* // Remove a listener for the ON_JOIN event
|
|
2397
|
+
* hmsInstance.removeEventListener(HMSUpdateListenerActions.ON_JOIN, onJoinCallback);
|
|
1675
2398
|
*/
|
|
1676
2399
|
removeEventListener = (
|
|
1677
2400
|
action: HMSUpdateListenerActions | HMSPIPListenerActions
|
|
@@ -1706,6 +2429,23 @@ export class HMSSDK {
|
|
|
1706
2429
|
this.onJoinDelegate = null;
|
|
1707
2430
|
break;
|
|
1708
2431
|
}
|
|
2432
|
+
case HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED: {
|
|
2433
|
+
const subscription =
|
|
2434
|
+
this.emitterSubscriptions[
|
|
2435
|
+
HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED
|
|
2436
|
+
];
|
|
2437
|
+
// Removing ON_PERMISSIONS_REQUESTED native listener
|
|
2438
|
+
if (subscription) {
|
|
2439
|
+
subscription.remove();
|
|
2440
|
+
|
|
2441
|
+
this.emitterSubscriptions[
|
|
2442
|
+
HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED
|
|
2443
|
+
] = undefined;
|
|
2444
|
+
}
|
|
2445
|
+
// Removing App Delegate listener
|
|
2446
|
+
this.onPermissionsRequestedDelegate = null;
|
|
2447
|
+
break;
|
|
2448
|
+
}
|
|
1709
2449
|
case HMSUpdateListenerActions.ON_ROOM_UPDATE: {
|
|
1710
2450
|
const subscription =
|
|
1711
2451
|
this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROOM_UPDATE];
|
|
@@ -1720,6 +2460,20 @@ export class HMSSDK {
|
|
|
1720
2460
|
this.onRoomDelegate = null;
|
|
1721
2461
|
break;
|
|
1722
2462
|
}
|
|
2463
|
+
case HMSUpdateListenerActions.ON_TRANSCRIPTS: {
|
|
2464
|
+
const subscription =
|
|
2465
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS];
|
|
2466
|
+
// Removing ON_TRANSCRIPTS native listener
|
|
2467
|
+
if (subscription) {
|
|
2468
|
+
subscription.remove();
|
|
2469
|
+
|
|
2470
|
+
this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS] =
|
|
2471
|
+
undefined;
|
|
2472
|
+
}
|
|
2473
|
+
// Removing App Delegate listener
|
|
2474
|
+
this.onTranscriptsDelegate = null;
|
|
2475
|
+
break;
|
|
2476
|
+
}
|
|
1723
2477
|
case HMSUpdateListenerActions.ON_PEER_UPDATE: {
|
|
1724
2478
|
const subscription =
|
|
1725
2479
|
this.emitterSubscriptions[HMSUpdateListenerActions.ON_PEER_UPDATE];
|
|
@@ -2004,13 +2758,16 @@ export class HMSSDK {
|
|
|
2004
2758
|
case HMSPIPListenerActions.ON_PIP_MODE_CHANGED: {
|
|
2005
2759
|
if (Platform.OS === 'android') {
|
|
2006
2760
|
const subscription =
|
|
2007
|
-
this.emitterSubscriptions[
|
|
2761
|
+
this.emitterSubscriptions[
|
|
2762
|
+
HMSPIPListenerActions.ON_PIP_MODE_CHANGED
|
|
2763
|
+
];
|
|
2008
2764
|
// Removing ON_PIP_MODE_CHANGED native listener
|
|
2009
2765
|
if (subscription) {
|
|
2010
2766
|
subscription.remove();
|
|
2011
2767
|
|
|
2012
|
-
this.emitterSubscriptions[
|
|
2013
|
-
|
|
2768
|
+
this.emitterSubscriptions[
|
|
2769
|
+
HMSPIPListenerActions.ON_PIP_MODE_CHANGED
|
|
2770
|
+
] = undefined;
|
|
2014
2771
|
}
|
|
2015
2772
|
// Removing App Delegate listener
|
|
2016
2773
|
this.onPIPModeChangedDelegate = null;
|
|
@@ -2055,21 +2812,6 @@ export class HMSSDK {
|
|
|
2055
2812
|
logger?.verbose('#Function REMOVE_ALL_LISTENER', { id: this.id });
|
|
2056
2813
|
};
|
|
2057
2814
|
|
|
2058
|
-
/**
|
|
2059
|
-
* - Below are all the listeners that are connected to native side.
|
|
2060
|
-
*
|
|
2061
|
-
* - All of the are connected when build function is called, we can connect them to the app by
|
|
2062
|
-
* calling {@link addEventListener} with corresponding event type.
|
|
2063
|
-
*
|
|
2064
|
-
* - Before passing the data to the eventListener of the app these listeners encode the data in
|
|
2065
|
-
* ts classes for a proper structuring of the data.
|
|
2066
|
-
*
|
|
2067
|
-
* - Even When event listeners of the app are disconnected using {@link removeEventListener} or
|
|
2068
|
-
* {@link removeAllListeners} or not even connected in first place, these functions still run to
|
|
2069
|
-
* maintain the current state of the instance of {@link HMSSDK}.
|
|
2070
|
-
*
|
|
2071
|
-
*/
|
|
2072
|
-
|
|
2073
2815
|
onPreviewListener = (data: any) => {
|
|
2074
2816
|
if (data.id !== this.id) {
|
|
2075
2817
|
return;
|
|
@@ -2104,6 +2846,19 @@ export class HMSSDK {
|
|
|
2104
2846
|
}
|
|
2105
2847
|
};
|
|
2106
2848
|
|
|
2849
|
+
onPermissionsRequestedListener = (data: {
|
|
2850
|
+
id: string;
|
|
2851
|
+
permissions: Array<string>;
|
|
2852
|
+
}) => {
|
|
2853
|
+
if (data.id !== this.id) {
|
|
2854
|
+
return;
|
|
2855
|
+
}
|
|
2856
|
+
if (this.onPermissionsRequestedDelegate) {
|
|
2857
|
+
logger?.verbose('#Listener ON_PERMISSIONS_REQUESTED_LISTENER_CALL', data);
|
|
2858
|
+
this.onPermissionsRequestedDelegate({ ...data });
|
|
2859
|
+
}
|
|
2860
|
+
};
|
|
2861
|
+
|
|
2107
2862
|
onRoomListener = (data: any) => {
|
|
2108
2863
|
if (data.id !== this.id) {
|
|
2109
2864
|
return;
|
|
@@ -2122,6 +2877,18 @@ export class HMSSDK {
|
|
|
2122
2877
|
}
|
|
2123
2878
|
};
|
|
2124
2879
|
|
|
2880
|
+
onTranscriptsListener = (data: any) => {
|
|
2881
|
+
if (data.id !== this.id) {
|
|
2882
|
+
return;
|
|
2883
|
+
}
|
|
2884
|
+
HMSEncoder.transformTranscripts(data.transcripts);
|
|
2885
|
+
|
|
2886
|
+
if (this.onTranscriptsDelegate) {
|
|
2887
|
+
logger?.verbose('#Listener ON_TRANSCRIPTS_LISTENER_CALL', data);
|
|
2888
|
+
this.onTranscriptsDelegate(data);
|
|
2889
|
+
}
|
|
2890
|
+
};
|
|
2891
|
+
|
|
2125
2892
|
onPeerListener = (peerData: any) => {
|
|
2126
2893
|
const data: { peer: any; type: any } = {
|
|
2127
2894
|
peer: peerData,
|
|
@@ -2139,8 +2906,15 @@ export class HMSSDK {
|
|
|
2139
2906
|
const peer: HMSPeer = HMSEncoder.encodeHmsPeer(data.peer);
|
|
2140
2907
|
const type = HMSEncoder.encodeHmsPeerUpdate(data.type) || data.type;
|
|
2141
2908
|
|
|
2142
|
-
|
|
2909
|
+
if (type === HMSPeerUpdate.PEER_LEFT) {
|
|
2910
|
+
this.sendPeerUpdateWhenPeerLeaves(data, peer, type);
|
|
2911
|
+
} else {
|
|
2912
|
+
getHmsPeersCache()?.updatePeerCache(data.peer.peerID, data.peer, type);
|
|
2913
|
+
this.sendPeerUpdate(peer, type);
|
|
2914
|
+
}
|
|
2915
|
+
};
|
|
2143
2916
|
|
|
2917
|
+
private sendPeerUpdate = (peer: any, type: any) => {
|
|
2144
2918
|
if (this.onPeerDelegate) {
|
|
2145
2919
|
logger?.verbose('#Listener ON_PEER_LISTENER_CALL', {
|
|
2146
2920
|
peer,
|
|
@@ -2150,6 +2924,12 @@ export class HMSSDK {
|
|
|
2150
2924
|
}
|
|
2151
2925
|
};
|
|
2152
2926
|
|
|
2927
|
+
private sendPeerUpdateWhenPeerLeaves = (data: any, peer: any, type: any) => {
|
|
2928
|
+
this.sendPeerUpdate(peer, type);
|
|
2929
|
+
|
|
2930
|
+
getHmsPeersCache()?.updatePeerCache(data.peer.peerID, data.peer, type);
|
|
2931
|
+
};
|
|
2932
|
+
|
|
2153
2933
|
onPeerListUpdatedListener = (data: any) => {
|
|
2154
2934
|
if (data.id !== this.id) {
|
|
2155
2935
|
return;
|
|
@@ -2180,14 +2960,6 @@ export class HMSSDK {
|
|
|
2180
2960
|
|
|
2181
2961
|
getHmsPeersCache()?.updatePeerCache(data.peer.peerID, { track }, data.type);
|
|
2182
2962
|
|
|
2183
|
-
if (
|
|
2184
|
-
this.muteStatus &&
|
|
2185
|
-
data?.type === 'TRACK_ADDED' &&
|
|
2186
|
-
track.type === HMSTrackType.AUDIO
|
|
2187
|
-
) {
|
|
2188
|
-
this.setPlaybackForAllAudio(this.muteStatus);
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
2963
|
if (this.onTrackDelegate) {
|
|
2192
2964
|
logger?.verbose('#Listener ON_TRACK_LISTENER_CALL', {
|
|
2193
2965
|
peer,
|
|
@@ -2437,6 +3209,15 @@ export class HMSSDK {
|
|
|
2437
3209
|
}
|
|
2438
3210
|
};
|
|
2439
3211
|
|
|
3212
|
+
/**
|
|
3213
|
+
* Listener for the `SessionStoreAvailable` event.
|
|
3214
|
+
*
|
|
3215
|
+
* This listener is triggered when the session store becomes available in the SDK. It is an important event
|
|
3216
|
+
* for developers who need to access or manipulate the session store after it has been initialized and made available.
|
|
3217
|
+
*
|
|
3218
|
+
* @param {Object} data - The event data.
|
|
3219
|
+
* @param {HMSSessionStore} data.sessionStore - The session store object that has been made available.
|
|
3220
|
+
*/
|
|
2440
3221
|
onSessionStoreAvailableListener = (data: { id: string }) => {
|
|
2441
3222
|
if (data.id !== this.id) {
|
|
2442
3223
|
return;
|
|
@@ -2453,6 +3234,21 @@ export class HMSSDK {
|
|
|
2453
3234
|
}
|
|
2454
3235
|
};
|
|
2455
3236
|
|
|
3237
|
+
/**
|
|
3238
|
+
* Listener for the `PIPRoomLeave` event. Android only.
|
|
3239
|
+
*
|
|
3240
|
+
* This listener is triggered when a room is left from the Picture in Picture (PIP) mode, which is currently supported only on Android platforms.
|
|
3241
|
+
* It is an essential event for handling cleanup or UI updates when the user exits the room while in PIP mode.
|
|
3242
|
+
* @param {Object} data - The event data.
|
|
3243
|
+
* @memberof HMSSDK
|
|
3244
|
+
* @example
|
|
3245
|
+
* // Example of handling the `PIPRoomLeave` event
|
|
3246
|
+
* hms.onPIPRoomLeave((data) => {
|
|
3247
|
+
* // Handle PIP room leave event
|
|
3248
|
+
* });
|
|
3249
|
+
*
|
|
3250
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
|
|
3251
|
+
*/
|
|
2456
3252
|
onPIPRoomLeaveListener = (data: { id: string }) => {
|
|
2457
3253
|
if (data.id !== this.id) {
|
|
2458
3254
|
return;
|
|
@@ -2468,26 +3264,127 @@ export class HMSSDK {
|
|
|
2468
3264
|
}
|
|
2469
3265
|
};
|
|
2470
3266
|
|
|
2471
|
-
|
|
3267
|
+
/**
|
|
3268
|
+
* Listener for the `PIPModeChanged` event.
|
|
3269
|
+
* This listener is triggered when the Picture in Picture (PIP) mode is toggled on or off.
|
|
3270
|
+
* It is an important event for handling UI updates or other actions when the user enters or exits PIP mode.
|
|
3271
|
+
* @param {Object} data - The event data.
|
|
3272
|
+
* @param {boolean} data.isInPictureInPictureMode - A boolean value indicating whether the user is currently in PIP mode.
|
|
3273
|
+
* @returns {void} - Returns nothing.
|
|
3274
|
+
* @memberof HMSSDK
|
|
3275
|
+
* @example
|
|
3276
|
+
* // Example of handling the `PIPModeChanged` event
|
|
3277
|
+
* hms.onPIPModeChanged((data) => {
|
|
3278
|
+
* if (data.isInPictureInPictureMode) {
|
|
3279
|
+
* // Handle PIP mode enabled
|
|
3280
|
+
* } else {
|
|
3281
|
+
* // Handle PIP mode disabled
|
|
3282
|
+
* }
|
|
3283
|
+
* });
|
|
3284
|
+
*
|
|
3285
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
|
|
3286
|
+
*/
|
|
3287
|
+
onPIPModeChangedListener = (data: {
|
|
3288
|
+
isInPictureInPictureMode: boolean;
|
|
3289
|
+
}): void => {
|
|
2472
3290
|
if (this.onPIPModeChangedDelegate) {
|
|
2473
3291
|
logger?.verbose('#Listener onPIPModeChanged_CALL', data);
|
|
2474
3292
|
|
|
2475
3293
|
this.onPIPModeChangedDelegate(data);
|
|
2476
3294
|
}
|
|
2477
|
-
}
|
|
3295
|
+
};
|
|
2478
3296
|
|
|
3297
|
+
/**
|
|
3298
|
+
* - This function is used to check if Picture in Picture mode is supported on the device
|
|
3299
|
+
* @returns {Promise<boolean>} - Returns a boolean value indicating whether Picture in Picture mode is supported on the device.
|
|
3300
|
+
* @memberof HMSSDK
|
|
3301
|
+
* @example
|
|
3302
|
+
* // Example of checking if Picture in Picture mode is supported
|
|
3303
|
+
* const isPipModeSupported = await hms.isPipModeSupported();
|
|
3304
|
+
* if (isPipModeSupported) {
|
|
3305
|
+
* // Picture in Picture mode is supported
|
|
3306
|
+
* } else {
|
|
3307
|
+
* // Picture in Picture mode is not supported
|
|
3308
|
+
* }
|
|
3309
|
+
* @example
|
|
3310
|
+
* // Example of checking if Picture in Picture mode is supported
|
|
3311
|
+
* hms.isPipModeSupported().then((isPipModeSupported) => {
|
|
3312
|
+
* if (isPipModeSupported) {
|
|
3313
|
+
* // Picture in Picture mode is supported
|
|
3314
|
+
* } else {
|
|
3315
|
+
* // Picture in Picture mode is not supported
|
|
3316
|
+
* }
|
|
3317
|
+
* });
|
|
3318
|
+
*
|
|
3319
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
|
|
3320
|
+
*/
|
|
2479
3321
|
async isPipModeSupported(): Promise<undefined | boolean> {
|
|
2480
|
-
|
|
3322
|
+
const data = { id: this.id };
|
|
3323
|
+
logger?.verbose('#Function isPipModeSupported', data);
|
|
3324
|
+
return HMSManager.handlePipActions('isPipModeSupported', data);
|
|
2481
3325
|
}
|
|
2482
3326
|
|
|
2483
|
-
|
|
3327
|
+
/**
|
|
3328
|
+
* Asynchronously enters Picture in Picture (PIP) mode with optional configuration.
|
|
3329
|
+
*
|
|
3330
|
+
* This method attempts to enter PIP mode based on the provided configuration.
|
|
3331
|
+
* It returns a promise that resolves to a boolean indicating the success of the operation.
|
|
3332
|
+
* If PIP mode is not supported or fails to activate, the promise may resolve to `undefined` or `false`.
|
|
3333
|
+
*
|
|
3334
|
+
* @param {HMSPIPConfig} [data] - Optional configuration for entering PIP mode. This can include settings such as `autoEnterPipMode` and `aspectRatio`.
|
|
3335
|
+
* @returns {Promise<boolean>} - A promise that resolves to `true` if PIP mode was successfully entered, `false` if unsuccessful or PIP mode is not supported.
|
|
3336
|
+
* @throws {Error} - Throws an error if the operation fails.
|
|
3337
|
+
* @memberof HMSSDK
|
|
3338
|
+
* @example
|
|
3339
|
+
* // Example of entering Picture in Picture mode
|
|
3340
|
+
* hms.enterPipMode().then((success) => {
|
|
3341
|
+
* if (success) {
|
|
3342
|
+
* // Picture in Picture mode entered successfully
|
|
3343
|
+
* } else {
|
|
3344
|
+
* // Picture in Picture mode could not be entered
|
|
3345
|
+
* }
|
|
3346
|
+
* });
|
|
3347
|
+
* @example
|
|
3348
|
+
* // Example of entering Picture in Picture mode with configuration
|
|
3349
|
+
* const success = await hms.enterPipMode({ autoEnterPipMode: true, aspectRatio: [16,9] });
|
|
3350
|
+
* if (success) {
|
|
3351
|
+
* // Picture in Picture mode entered successfully
|
|
3352
|
+
* } else {
|
|
3353
|
+
* // Picture in Picture mode could not be entered
|
|
3354
|
+
* }
|
|
3355
|
+
*
|
|
3356
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
|
|
3357
|
+
*/
|
|
3358
|
+
async enterPipMode(data?: HMSPIPConfig): Promise<boolean> {
|
|
3359
|
+
logger?.verbose('#Function enterPipMode', data);
|
|
2484
3360
|
return HMSManager.handlePipActions('enterPipMode', {
|
|
2485
3361
|
...data,
|
|
2486
3362
|
id: this.id,
|
|
2487
3363
|
});
|
|
2488
3364
|
}
|
|
2489
3365
|
|
|
2490
|
-
|
|
3366
|
+
/**
|
|
3367
|
+
* Asynchronously sets the parameters for Picture in Picture (PIP) mode.
|
|
3368
|
+
*
|
|
3369
|
+
* This method configures the PIP window according to the provided `HMSPIPConfig` settings. It can be used to adjust various aspects of the PIP mode, such as its size, aspect ratio, and more. The method returns a promise that resolves to a boolean indicating the success of the operation. If the PIP mode is not supported or the configuration fails, the promise may resolve to `undefined` or `false`.
|
|
3370
|
+
*
|
|
3371
|
+
* @param {HMSPIPConfig} [data] - Optional configuration for setting PIP mode parameters. This can include settings such as `aspectRatio`, `autoEnterPipMode`, etc.
|
|
3372
|
+
* @returns {Promise<boolean | undefined>} - A promise that resolves to `true` if the PIP parameters were successfully set, `false` if unsuccessful. `undefined` may be returned if PIP mode is not supported.
|
|
3373
|
+
* @throws {Error} - Throws an error if the operation fails.
|
|
3374
|
+
* @memberof HMSSDK
|
|
3375
|
+
* @example
|
|
3376
|
+
* // Example of setting Picture in Picture mode parameters
|
|
3377
|
+
* hms.setPipParams({ aspectRatio: [16, 9], autoEnterPipMode: true }).then((success) => {
|
|
3378
|
+
* if (success) {
|
|
3379
|
+
* // Picture in Picture mode parameters set successfully
|
|
3380
|
+
* } else {
|
|
3381
|
+
* // Picture in Picture mode parameters could not be set
|
|
3382
|
+
* }
|
|
3383
|
+
* });
|
|
3384
|
+
*
|
|
3385
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
|
|
3386
|
+
*/
|
|
3387
|
+
async setPipParams(data?: HMSPIPConfig): Promise<boolean | undefined> {
|
|
2491
3388
|
return HMSManager.handlePipActions('setPictureInPictureParams', {
|
|
2492
3389
|
...data,
|
|
2493
3390
|
id: this.id,
|
|
@@ -2495,18 +3392,155 @@ export class HMSSDK {
|
|
|
2495
3392
|
}
|
|
2496
3393
|
|
|
2497
3394
|
/**
|
|
2498
|
-
*
|
|
2499
|
-
*
|
|
3395
|
+
* Changes the video track used in Picture in Picture (PIP) mode on iOS devices.
|
|
3396
|
+
*
|
|
3397
|
+
* This function is specifically designed for iOS platforms to switch the video track displayed in PIP mode.
|
|
3398
|
+
* It takes a `HMSVideoTrack` object as an argument, which contains the track ID of the video track to be displayed in PIP mode.
|
|
3399
|
+
* This allows for dynamic changes to the video source in PIP mode, enhancing the flexibility of video presentation in applications that support PIP.
|
|
3400
|
+
*
|
|
3401
|
+
* @param {HMSVideoTrack} track - The video track to be used in PIP mode. Must contain a valid `trackId`.
|
|
3402
|
+
* @returns {Promise} - A promise that resolves when the video track has been successfully changed for PIP mode, or rejects with an error if the operation fails.
|
|
3403
|
+
* @throws {Error} - Throws an error if the operation fails.
|
|
3404
|
+
* @async
|
|
3405
|
+
* @function changeIOSPIPVideoTrack
|
|
3406
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
|
|
3407
|
+
* @memberof HMSSDK
|
|
3408
|
+
* @example
|
|
3409
|
+
* // Example of changing the video track for PIP mode on iOS
|
|
3410
|
+
* hms.changeIOSPIPVideoTrack(videoTrack).then(() => {
|
|
3411
|
+
* console.log('Video track for PIP mode changed successfully');
|
|
3412
|
+
* }).catch(error => {
|
|
3413
|
+
* console.error('Failed to change video track for PIP mode', error);
|
|
3414
|
+
* });
|
|
3415
|
+
*
|
|
3416
|
+
*/
|
|
3417
|
+
async changeIOSPIPVideoTrack(track: HMSVideoTrack) {
|
|
3418
|
+
if (Platform.OS === 'ios') {
|
|
3419
|
+
const data = {
|
|
3420
|
+
id: this.id,
|
|
3421
|
+
trackId: track.trackId,
|
|
3422
|
+
};
|
|
3423
|
+
logger?.verbose('#Function changeIOSPIPVideoTrack', data);
|
|
3424
|
+
return await HMSManager.changeIOSPIPVideoTrack(data);
|
|
3425
|
+
} else {
|
|
3426
|
+
return Promise.resolve(false);
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
/**
|
|
3431
|
+
* - This function is used to automatically switch the video track of the active speaker to the Picture in Picture (PIP) mode window on iOS devices.
|
|
3432
|
+
* - When enabled, the video track of the active speaker will be displayed in the PIP mode window, providing a focused view of the current speaker during a meeting or conference.
|
|
3433
|
+
* @param {boolean} enable - A boolean value indicating whether to enable or disable the automatic switching of the active speaker video track in PIP mode.
|
|
3434
|
+
* @returns {Promise} - A promise that resolves when the operation is successful, or rejects with an error if the operation fails.
|
|
3435
|
+
* @throws {Error} - Throws an error if the operation fails.
|
|
3436
|
+
* @async
|
|
3437
|
+
* @function setActiveSpeakerInIOSPIP
|
|
3438
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
|
|
3439
|
+
* @memberof HMSSDK
|
|
3440
|
+
* @example
|
|
3441
|
+
* // Example of enabling the automatic switching of the active speaker video track in PIP mode
|
|
3442
|
+
* hms.setActiveSpeakerInIOSPIP(true).then(() => {
|
|
3443
|
+
* console.log('Active speaker video track enabled in PIP mode');
|
|
3444
|
+
* }).catch(error => {
|
|
3445
|
+
* console.error('Failed to enable active speaker video track in PIP mode', error);
|
|
3446
|
+
* });
|
|
3447
|
+
*/
|
|
3448
|
+
async setActiveSpeakerInIOSPIP(enable: boolean): Promise<any> {
|
|
3449
|
+
if (Platform.OS === 'ios') {
|
|
3450
|
+
const data = {
|
|
3451
|
+
id: this.id,
|
|
3452
|
+
enable,
|
|
3453
|
+
};
|
|
3454
|
+
logger?.verbose('#Function setActiveSpeakerInIOSPIP', data);
|
|
3455
|
+
return await HMSManager.setActiveSpeakerInIOSPIP(data);
|
|
3456
|
+
} else {
|
|
3457
|
+
return Promise.resolve(false);
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3461
|
+
/**
|
|
3462
|
+
* Initiates real-time transcription services.
|
|
3463
|
+
*
|
|
3464
|
+
* This asynchronous function triggers the HMSManager to start real-time transcription services,
|
|
3465
|
+
* capturing and transcribing audio in real time.
|
|
3466
|
+
*
|
|
3467
|
+
* @async
|
|
3468
|
+
* @function startRealTimeTranscription
|
|
3469
|
+
* @memberof HMSSDK
|
|
3470
|
+
* @example
|
|
3471
|
+
* // Example of starting real-time transcription services
|
|
3472
|
+
* await hmsInstance.startRealTimeTranscription();
|
|
3473
|
+
*
|
|
3474
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/live-captions
|
|
3475
|
+
*/
|
|
3476
|
+
async startRealTimeTranscription() {
|
|
3477
|
+
const data = {
|
|
3478
|
+
id: this.id,
|
|
3479
|
+
action: 'start',
|
|
3480
|
+
};
|
|
3481
|
+
logger?.verbose('#Function startRealTimeTranscription', data);
|
|
3482
|
+
return HMSManager.handleRealTimeTranscription(data);
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
/**
|
|
3486
|
+
* Stops the real-time transcription services.
|
|
3487
|
+
*
|
|
3488
|
+
* This asynchronous function signals the HMSManager to terminate the ongoing real-time transcription services.
|
|
3489
|
+
*
|
|
3490
|
+
* @async
|
|
3491
|
+
* @function stopRealTimeTranscription
|
|
2500
3492
|
* @memberof HMSSDK
|
|
3493
|
+
* @example
|
|
3494
|
+
* await hmsInstance.stopRealTimeTranscription();
|
|
3495
|
+
*
|
|
3496
|
+
* @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/live-captions
|
|
3497
|
+
*/
|
|
3498
|
+
async stopRealTimeTranscription() {
|
|
3499
|
+
const data = {
|
|
3500
|
+
id: this.id,
|
|
3501
|
+
action: 'stop',
|
|
3502
|
+
};
|
|
3503
|
+
logger?.verbose('#Function stopRealTimeTranscription', data);
|
|
3504
|
+
return HMSManager.handleRealTimeTranscription(data);
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
get interactivityCenter() {
|
|
3508
|
+
if (!this._interactivityCenter) {
|
|
3509
|
+
this._interactivityCenter = new HMSInteractivityCenter();
|
|
3510
|
+
}
|
|
3511
|
+
return this._interactivityCenter;
|
|
3512
|
+
}
|
|
3513
|
+
|
|
3514
|
+
/**
|
|
3515
|
+
* Retrieves the current logger instance used by the HMSSDK.
|
|
3516
|
+
*
|
|
3517
|
+
* This static method provides access to the logger instance, allowing for the manipulation of log levels and the retrieval of log information. It is useful for debugging purposes, enabling developers to monitor and adjust the verbosity of logs generated by the HMS SDK.
|
|
3518
|
+
*
|
|
3519
|
+
* @returns {HMSLogger} The current logger instance.
|
|
3520
|
+
* @memberof HMSSDK
|
|
3521
|
+
* @example
|
|
3522
|
+
* const logger = HMSSDK.getLogger();
|
|
3523
|
+
* logger.setLevel('debug'); // Adjusting the log level to debug
|
|
2501
3524
|
*/
|
|
2502
3525
|
static getLogger() {
|
|
2503
3526
|
return getLogger();
|
|
2504
3527
|
}
|
|
2505
3528
|
|
|
2506
3529
|
/**
|
|
2507
|
-
*
|
|
2508
|
-
*
|
|
3530
|
+
* Updates the logger instance for this HMSSDK instance.
|
|
3531
|
+
*
|
|
3532
|
+
* This method allows for the dynamic updating of the logger instance used by the HMSSDK.
|
|
3533
|
+
* It can be used to change the logger settings or replace the logger entirely at runtime.
|
|
3534
|
+
* This is particularly useful for adjusting log levels or redirecting log output based on application state or user preferences.
|
|
3535
|
+
*
|
|
3536
|
+
* @param {HMSLogger} hmsLogger - The new logger instance to be used. If not provided, the logger will be reset to default.
|
|
2509
3537
|
* @memberof HMSSDK
|
|
3538
|
+
* @example
|
|
3539
|
+
* // Set a custom logger with a specific configuration
|
|
3540
|
+
* const customLogger = new HMSLogger();
|
|
3541
|
+
* customLogger.setLevel('verbose');
|
|
3542
|
+
* hmsInstance.setLogger(customLogger);
|
|
3543
|
+
*
|
|
2510
3544
|
*/
|
|
2511
3545
|
setLogger = (hmsLogger?: HMSLogger) => {
|
|
2512
3546
|
setLogger(this.id, hmsLogger);
|