@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/ios/HMSRNSDK.swift
CHANGED
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
import Foundation
|
|
9
9
|
import HMSSDK
|
|
10
10
|
import ReplayKit
|
|
11
|
+
import AVKit
|
|
12
|
+
import SwiftUI
|
|
11
13
|
|
|
12
|
-
class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
14
|
+
class HMSRNSDK: NSObject, HMSUpdateListener, HMSPreviewListener {
|
|
13
15
|
|
|
14
16
|
var hms: HMSSDK?
|
|
17
|
+
var interactivity: HMSRNInteractivityCenter?
|
|
15
18
|
|
|
16
19
|
var delegate: HMSManager?
|
|
17
20
|
var id: String = "12345"
|
|
@@ -26,26 +29,78 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
26
29
|
private var isScreenShared: Bool? = false
|
|
27
30
|
private var previewInProgress = false
|
|
28
31
|
private var networkQualityUpdatesAttached = false
|
|
29
|
-
|
|
32
|
+
internal var eventsEnableStatus: [String: Bool] = [:]
|
|
30
33
|
private var sessionStore: HMSSessionStore?
|
|
31
34
|
private var sessionStoreChangeObservers = [String: NSObjectProtocol]()
|
|
35
|
+
private var peerListIterators = [String: HMSPeerListIterator]()
|
|
36
|
+
private var roomMutedLocally = false
|
|
37
|
+
private var noiseCancellationPlugin: HMSNoiseCancellationPlugin?
|
|
38
|
+
private var videoFilterPlugin: HMSVideoFilterPlugin?
|
|
39
|
+
private var virtualBackgroundPlugin: HMSVideoPlugin?
|
|
32
40
|
|
|
33
41
|
// MARK: - Setup
|
|
34
42
|
init(data: NSDictionary?, delegate manager: HMSManager?, uid id: String) {
|
|
43
|
+
super.init()
|
|
35
44
|
preferredExtension = data?.value(forKey: "preferredExtension") as? String
|
|
36
|
-
|
|
45
|
+
self.delegate = manager
|
|
46
|
+
self.id = id
|
|
37
47
|
DispatchQueue.main.async { [weak self] in
|
|
48
|
+
var noiseCancellationPlugin: HMSNoiseCancellationPlugin?
|
|
49
|
+
var videoFilterPlugin: HMSVideoFilterPlugin?
|
|
50
|
+
var virtualBackgroundPlugin: HMSVideoPlugin?
|
|
51
|
+
|
|
38
52
|
self?.hms = HMSSDK.build { sdk in
|
|
39
53
|
sdk.appGroup = data?.value(forKey: "appGroup") as? String
|
|
40
54
|
sdk.frameworkInfo = HMSHelper.getFrameworkInfo(data?.value(forKey: "frameworkInfo") as? NSDictionary)
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
let trackSettingsDict = data?.value(forKey: "trackSettings") as? NSDictionary
|
|
56
|
+
|
|
57
|
+
// Video track settings
|
|
58
|
+
let videoSettingsDict = trackSettingsDict?.value(forKey: "video") as? NSDictionary
|
|
59
|
+
let videoPluginDict = videoSettingsDict?.value(forKey: "videoPlugin") as? NSDictionary
|
|
60
|
+
let videoPlugin = HMSHelper.getHMSVideoPlugin(videoPluginDict)
|
|
61
|
+
|
|
62
|
+
if let asVideoFilterPlugin = videoPlugin as? HMSVideoFilterPlugin {
|
|
63
|
+
videoFilterPlugin = asVideoFilterPlugin
|
|
64
|
+
} else if #available(iOS 15.0, *) {
|
|
65
|
+
let asVirtualBGPlugin = videoPlugin as? HMSVirtualBackgroundPlugin
|
|
66
|
+
virtualBackgroundPlugin = asVirtualBGPlugin
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
let videoSettings = HMSHelper.getLocalVideoSettings(videoSettingsDict, videoPlugin)
|
|
70
|
+
|
|
71
|
+
// Audio track settings
|
|
72
|
+
let audioSettingsDict = trackSettingsDict?.value(forKey: "audio") as? NSDictionary
|
|
73
|
+
|
|
74
|
+
let value = audioSettingsDict?.value(forKey: "noiseCancellationPlugin") as? NSDictionary
|
|
75
|
+
noiseCancellationPlugin = HMSHelper.getHMSNoiseCancellationPlugin(value)
|
|
76
|
+
|
|
77
|
+
let audioSettings = HMSHelper.getLocalAudioSettings(audioSettingsDict, noiseCancellationPlugin, sdk, self?.delegate, id)
|
|
78
|
+
|
|
79
|
+
// Track Settings
|
|
44
80
|
sdk.trackSettings = HMSTrackSettings(videoSettings: videoSettings, audioSettings: audioSettings)
|
|
45
81
|
}
|
|
82
|
+
self?.noiseCancellationPlugin = noiseCancellationPlugin
|
|
83
|
+
self?.virtualBackgroundPlugin = virtualBackgroundPlugin
|
|
84
|
+
self?.videoFilterPlugin = videoFilterPlugin
|
|
85
|
+
if let hms = self?.hms {
|
|
86
|
+
self?.interactivity = HMSRNInteractivityCenter(
|
|
87
|
+
hmssdk: hms,
|
|
88
|
+
hmsrnsdk: self
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification,
|
|
93
|
+
object: nil,
|
|
94
|
+
queue: .main) { [weak self] _ in
|
|
95
|
+
if self?.hms?.room != nil {
|
|
96
|
+
self?.hms?.leave()
|
|
97
|
+
}
|
|
98
|
+
}
|
|
46
99
|
}
|
|
47
|
-
|
|
48
|
-
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
deinit {
|
|
103
|
+
NotificationCenter.default.removeObserver(self)
|
|
49
104
|
}
|
|
50
105
|
|
|
51
106
|
// MARK: - Prebuilt
|
|
@@ -60,7 +115,7 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
60
115
|
DispatchQueue.main.async { [weak self] in
|
|
61
116
|
guard let strongSelf = self else { return }
|
|
62
117
|
|
|
63
|
-
if let endPoint = data["endpoint"] as? String,
|
|
118
|
+
if let endPoint = data["endpoint"] as? String, endPoint.contains("mockable") || endPoint.contains("nonprod") {
|
|
64
119
|
UserDefaults.standard.set(endPoint, forKey: "HMSRoomLayoutEndpointOverride")
|
|
65
120
|
} else {
|
|
66
121
|
UserDefaults.standard.removeObject(forKey: "HMSRoomLayoutEndpointOverride")
|
|
@@ -124,7 +179,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
124
179
|
guard let role = data.value(forKey: "role") as? String
|
|
125
180
|
else {
|
|
126
181
|
let errorMessage = "previewForRole: " + HMSHelper.getUnavailableRequiredKey(data, ["role"])
|
|
127
|
-
emitRequiredKeysError(errorMessage)
|
|
128
182
|
reject?(errorMessage, errorMessage, nil)
|
|
129
183
|
return
|
|
130
184
|
}
|
|
@@ -210,8 +264,8 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
210
264
|
DispatchQueue.main.async { [weak self] in
|
|
211
265
|
self?.hms?.getAuthTokenByRoomCode(roomCode, userID: userId) { token, error in
|
|
212
266
|
// error occurred
|
|
213
|
-
if error
|
|
214
|
-
reject?(error
|
|
267
|
+
if let error = error as? NSError {
|
|
268
|
+
reject?(String(error.code), error.localizedDescription, nil)
|
|
215
269
|
return
|
|
216
270
|
}
|
|
217
271
|
// no error and token is valid
|
|
@@ -228,44 +282,48 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
228
282
|
}
|
|
229
283
|
}
|
|
230
284
|
|
|
231
|
-
func setLocalMute(_ data: NSDictionary) {
|
|
285
|
+
func setLocalMute(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
232
286
|
guard let isMute = data.value(forKey: "isMute") as? Bool
|
|
233
287
|
else {
|
|
234
288
|
let errorMessage = "setLocalMute: " + HMSHelper.getUnavailableRequiredKey(data, ["isMute"])
|
|
235
|
-
|
|
289
|
+
reject?(errorMessage, errorMessage, nil)
|
|
236
290
|
return
|
|
237
291
|
}
|
|
238
292
|
|
|
239
293
|
DispatchQueue.main.async { [weak self] in
|
|
240
294
|
if let audioTrack = self?.hms?.localPeer?.localAudioTrack() {
|
|
241
295
|
audioTrack.setMute(isMute)
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
296
|
+
resolve?(true)
|
|
297
|
+
} else if let tracks = self?.previewForRoleTracks, let audioTrack = tracks.first(where: { $0.kind == HMSTrackKind.audio }) as? HMSLocalAudioTrack {
|
|
298
|
+
audioTrack.setMute(isMute)
|
|
299
|
+
resolve?(true)
|
|
246
300
|
} else {
|
|
247
|
-
|
|
301
|
+
let errorMessage = "setLocalMute: No local audio track available for setting mute state."
|
|
302
|
+
print(#function, errorMessage)
|
|
303
|
+
reject?(errorMessage, errorMessage, nil)
|
|
248
304
|
}
|
|
249
305
|
}
|
|
250
306
|
}
|
|
251
307
|
|
|
252
|
-
func setLocalVideoMute(_ data: NSDictionary) {
|
|
308
|
+
func setLocalVideoMute(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
253
309
|
guard let isMute = data.value(forKey: "isMute") as? Bool
|
|
254
310
|
else {
|
|
255
311
|
let errorMessage = "setLocalVideoMute: " + HMSHelper.getUnavailableRequiredKey(data, ["isMute"])
|
|
256
|
-
|
|
312
|
+
reject?(errorMessage, errorMessage, nil)
|
|
257
313
|
return
|
|
258
314
|
}
|
|
259
315
|
|
|
260
316
|
DispatchQueue.main.async { [weak self] in
|
|
261
317
|
if let videoTrack = self?.hms?.localPeer?.localVideoTrack() {
|
|
262
318
|
videoTrack.setMute(isMute)
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
319
|
+
resolve?(true)
|
|
320
|
+
} else if let tracks = self?.previewForRoleTracks, let videoTrack = tracks.first(where: { $0.kind == HMSTrackKind.video }) as? HMSLocalVideoTrack {
|
|
321
|
+
videoTrack.setMute(isMute)
|
|
322
|
+
resolve?(true)
|
|
267
323
|
} else {
|
|
268
|
-
|
|
324
|
+
let errorMessage = "setLocalVideoMute: No local video track available for setting mute state."
|
|
325
|
+
print(#function, errorMessage)
|
|
326
|
+
reject?(errorMessage, errorMessage, nil)
|
|
269
327
|
}
|
|
270
328
|
}
|
|
271
329
|
}
|
|
@@ -287,24 +345,27 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
287
345
|
func leave(_ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
288
346
|
DispatchQueue.main.async { [weak self] in
|
|
289
347
|
guard let strongSelf = self else {
|
|
290
|
-
|
|
348
|
+
let errorMessage = "\(#function): Could not find reference to self while executing Room leave"
|
|
349
|
+
print(#function, errorMessage)
|
|
350
|
+
reject?(errorMessage, errorMessage, nil)
|
|
291
351
|
return
|
|
292
352
|
}
|
|
293
353
|
|
|
294
354
|
strongSelf.hms?.leave { [weak self] success, error in
|
|
295
355
|
|
|
296
356
|
guard let strongSelf = self else {
|
|
297
|
-
|
|
357
|
+
let errorMessage = "\(#function): Could not find reference to self when callback is received while executing Room leave"
|
|
358
|
+
print(#function, errorMessage)
|
|
359
|
+
reject?(errorMessage, errorMessage, nil)
|
|
298
360
|
return
|
|
299
361
|
}
|
|
300
362
|
|
|
301
|
-
if
|
|
363
|
+
if let nonnilError = error {
|
|
364
|
+
reject?(nonnilError.localizedDescription, nonnilError.localizedDescription, nil)
|
|
365
|
+
} else if success {
|
|
302
366
|
resolve?(["success": success])
|
|
303
367
|
strongSelf.cleanup() // resetting states and doing data cleanup
|
|
304
368
|
} else {
|
|
305
|
-
if strongSelf.eventsEnableStatus[HMSConstants.ON_ERROR] == true {
|
|
306
|
-
strongSelf.delegate?.emitEvent(HMSConstants.ON_ERROR, ["error": HMSDecoder.getError(error), "id": strongSelf.id])
|
|
307
|
-
}
|
|
308
369
|
reject?("error in leave", "error in leave", nil)
|
|
309
370
|
}
|
|
310
371
|
}
|
|
@@ -315,7 +376,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
315
376
|
guard let message = data.value(forKey: "message") as? String
|
|
316
377
|
else {
|
|
317
378
|
let errorMessage = "sendBroadcastMessage: " + HMSHelper.getUnavailableRequiredKey(data, ["message"])
|
|
318
|
-
emitRequiredKeysError(errorMessage)
|
|
319
379
|
reject?(errorMessage, errorMessage, nil)
|
|
320
380
|
return
|
|
321
381
|
}
|
|
@@ -340,7 +400,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
340
400
|
let targetedRoles = data.value(forKey: "roles") as? [String]
|
|
341
401
|
else {
|
|
342
402
|
let errorMessage = "sendGroupMessage: " + HMSHelper.getUnavailableRequiredKey(data, ["message", "roles"])
|
|
343
|
-
emitRequiredKeysError(errorMessage)
|
|
344
403
|
reject?(errorMessage, errorMessage, nil)
|
|
345
404
|
return
|
|
346
405
|
}
|
|
@@ -365,14 +424,14 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
365
424
|
let peerId = data.value(forKey: "peerId") as? String
|
|
366
425
|
else {
|
|
367
426
|
let errorMessage = "sendDirectMessage: " + HMSHelper.getUnavailableRequiredKey(data, ["message", "peerId"])
|
|
368
|
-
emitRequiredKeysError(errorMessage)
|
|
369
427
|
reject?(errorMessage, errorMessage, nil)
|
|
370
428
|
return
|
|
371
429
|
}
|
|
372
430
|
|
|
373
431
|
let type = data.value(forKey: "type") as? String ?? "chat"
|
|
374
432
|
DispatchQueue.main.async { [weak self] in
|
|
375
|
-
guard let peer = HMSHelper.
|
|
433
|
+
guard let peer = HMSHelper.getPeerFromPeerId(peerId, remotePeers: self?.hms?.remotePeers) else { return }
|
|
434
|
+
|
|
376
435
|
self?.hms?.sendDirectMessage(type: type, message: message, peer: peer, completion: { message, error in
|
|
377
436
|
if error == nil {
|
|
378
437
|
resolve?(["messageId": message?.messageID ?? "", "data": ["sender": message?.sender?.name ?? "", "message": message?.message ?? "", "type": message?.type]] as [String: Any])
|
|
@@ -392,7 +451,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
392
451
|
guard let request = self?.recentRoleChangeRequest
|
|
393
452
|
else {
|
|
394
453
|
let errorMessage = "acceptRoleChange: recentRoleChangeRequest not found"
|
|
395
|
-
self?.emitRequiredKeysError(errorMessage)
|
|
396
454
|
reject?(errorMessage, errorMessage, nil)
|
|
397
455
|
return
|
|
398
456
|
}
|
|
@@ -415,7 +473,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
415
473
|
let role = data.value(forKey: "role") as? String
|
|
416
474
|
else {
|
|
417
475
|
let errorMessage = "changeRole: " + HMSHelper.getUnavailableRequiredKey(data, ["peerId", "role"])
|
|
418
|
-
emitRequiredKeysError(errorMessage)
|
|
419
476
|
reject?(errorMessage, errorMessage, nil)
|
|
420
477
|
return
|
|
421
478
|
}
|
|
@@ -450,7 +507,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
450
507
|
guard let toRoleString = data.object(forKey: "toRole") as? String
|
|
451
508
|
else {
|
|
452
509
|
let errorMessage = "changeRolesOfAllPeers: " + HMSHelper.getUnavailableRequiredKey(data, ["toRole"])
|
|
453
|
-
emitRequiredKeysError(errorMessage)
|
|
454
510
|
reject?(errorMessage, errorMessage, nil)
|
|
455
511
|
return
|
|
456
512
|
}
|
|
@@ -459,7 +515,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
459
515
|
|
|
460
516
|
guard let toRole = HMSHelper.getRoleFromRoleName(toRoleString, roles: self?.hms?.roles) else {
|
|
461
517
|
let errorMessage = "changeRolesOfAllPeers: " + HMSHelper.getUnavailableRequiredKey(data, ["toRole"])
|
|
462
|
-
self?.emitRequiredKeysError(errorMessage)
|
|
463
518
|
reject?(errorMessage, errorMessage, nil)
|
|
464
519
|
return
|
|
465
520
|
}
|
|
@@ -485,7 +540,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
485
540
|
guard let trackId = data.value(forKey: "trackId") as? String
|
|
486
541
|
else {
|
|
487
542
|
let errorMessage = "changeTrackState: " + HMSHelper.getUnavailableRequiredKey(data, ["trackId"])
|
|
488
|
-
emitRequiredKeysError(errorMessage)
|
|
489
543
|
reject?(errorMessage, errorMessage, nil)
|
|
490
544
|
return
|
|
491
545
|
}
|
|
@@ -515,7 +569,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
515
569
|
guard let mute = data.value(forKey: "mute") as? Bool
|
|
516
570
|
else {
|
|
517
571
|
let errorMessage = "changeTrackStateForRoles: " + HMSHelper.getUnavailableRequiredKey(data, ["mute"])
|
|
518
|
-
emitRequiredKeysError(errorMessage)
|
|
519
572
|
reject?(errorMessage, errorMessage, nil)
|
|
520
573
|
return
|
|
521
574
|
}
|
|
@@ -548,17 +601,16 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
548
601
|
guard let trackId = data.value(forKey: "trackId") as? String
|
|
549
602
|
else {
|
|
550
603
|
let errorMessage = "isMute: " + HMSHelper.getUnavailableRequiredKey(data, ["trackId"])
|
|
551
|
-
emitRequiredKeysError(errorMessage)
|
|
552
604
|
reject?(errorMessage, errorMessage, nil)
|
|
553
605
|
return
|
|
554
606
|
}
|
|
555
607
|
|
|
556
608
|
DispatchQueue.main.async { [weak self] in
|
|
557
609
|
guard let strongSelf = self else { return }
|
|
558
|
-
guard let localPeer =
|
|
610
|
+
guard let localPeer = strongSelf.hms?.localPeer,
|
|
559
611
|
let localTrack = HMSHelper.getLocalTrackFromTrackId(trackId, localPeer: localPeer)
|
|
560
612
|
else {
|
|
561
|
-
guard let remotePeers =
|
|
613
|
+
guard let remotePeers = strongSelf.hms?.remotePeers,
|
|
562
614
|
let track = HMSHelper.getTrackFromTrackId(trackId, remotePeers)
|
|
563
615
|
else {
|
|
564
616
|
reject?("Track not found", "Track not found", nil)
|
|
@@ -578,29 +630,28 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
578
630
|
guard let peerId = data.value(forKey: "peerId") as? String
|
|
579
631
|
else {
|
|
580
632
|
let errorMessage = "removePeer: " + HMSHelper.getUnavailableRequiredKey(data, ["peerId"])
|
|
581
|
-
emitRequiredKeysError(errorMessage)
|
|
582
633
|
reject?(errorMessage, errorMessage, nil)
|
|
583
634
|
return
|
|
584
635
|
}
|
|
585
636
|
|
|
586
637
|
let reason = data.value(forKey: "reason") as? String
|
|
587
638
|
|
|
588
|
-
|
|
639
|
+
HMSHelper.getRemotePeerFromPeerId(peerId, hmsSDK: self.hms) { peer in
|
|
589
640
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
return
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
self?.hms?.removePeer(peer, reason: reason ?? "Removed from room", completion: { success, error in
|
|
598
|
-
if success {
|
|
599
|
-
resolve?(["success": success])
|
|
600
|
-
} else {
|
|
601
|
-
reject?(error?.localizedDescription, error?.localizedDescription, nil)
|
|
641
|
+
DispatchQueue.main.async { [weak self] in
|
|
642
|
+
guard let nonnilPeer = peer else {
|
|
643
|
+
reject?("PEER_NOT_FOUND", "PEER_NOT_FOUND", nil)
|
|
644
|
+
return
|
|
602
645
|
}
|
|
603
|
-
|
|
646
|
+
|
|
647
|
+
self?.hms?.removePeer(nonnilPeer, reason: reason ?? "Removed from room", completion: { success, error in
|
|
648
|
+
if success {
|
|
649
|
+
resolve?(["success": success])
|
|
650
|
+
} else {
|
|
651
|
+
reject?(error?.localizedDescription, error?.localizedDescription, nil)
|
|
652
|
+
}
|
|
653
|
+
})
|
|
654
|
+
}
|
|
604
655
|
}
|
|
605
656
|
}
|
|
606
657
|
|
|
@@ -610,7 +661,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
610
661
|
let reason = data.value(forKey: "reason") as? String
|
|
611
662
|
else {
|
|
612
663
|
let errorMessage = "endRoom: " + HMSHelper.getUnavailableRequiredKey(data, ["lock", "reason"])
|
|
613
|
-
emitRequiredKeysError(errorMessage)
|
|
614
664
|
reject?(errorMessage, errorMessage, nil)
|
|
615
665
|
return
|
|
616
666
|
}
|
|
@@ -631,7 +681,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
631
681
|
guard let trackId = data.value(forKey: "trackId") as? String
|
|
632
682
|
else {
|
|
633
683
|
let errorMessage = "isPlaybackAllowed: " + HMSHelper.getUnavailableRequiredKey(data, ["trackId"])
|
|
634
|
-
emitRequiredKeysError(errorMessage)
|
|
635
684
|
reject?(errorMessage, errorMessage, nil)
|
|
636
685
|
return
|
|
637
686
|
}
|
|
@@ -658,29 +707,35 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
658
707
|
}
|
|
659
708
|
}
|
|
660
709
|
|
|
661
|
-
func setPlaybackAllowed(_ data: NSDictionary) {
|
|
710
|
+
func setPlaybackAllowed(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
662
711
|
guard let trackId = data.value(forKey: "trackId") as? String,
|
|
663
712
|
let playbackAllowed = data.value(forKey: "playbackAllowed") as? Bool
|
|
664
713
|
else {
|
|
665
714
|
let errorMessage = "setPlaybackAllowed: " + HMSHelper.getUnavailableRequiredKey(data, ["trackId", "playbackAllowed"])
|
|
666
|
-
|
|
715
|
+
reject?(errorMessage, errorMessage, nil)
|
|
667
716
|
return
|
|
668
717
|
}
|
|
718
|
+
|
|
669
719
|
DispatchQueue.main.async { [weak self] in
|
|
670
720
|
guard let remotePeers = self?.hms?.remotePeers
|
|
671
721
|
else {
|
|
722
|
+
let errorMessage = "setPlaybackAllowed: No remote peers found"
|
|
723
|
+
reject?(errorMessage, errorMessage, nil)
|
|
672
724
|
return
|
|
673
725
|
}
|
|
726
|
+
|
|
674
727
|
let remoteAudioTrack = HMSHelper.getRemoteAudioTrackFromTrackId(trackId, remotePeers)
|
|
675
728
|
let remoteVideoTrack = HMSHelper.getRemoteVideoTrackFromTrackId(trackId, remotePeers)
|
|
729
|
+
|
|
676
730
|
if remoteAudioTrack != nil {
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
} else {
|
|
680
|
-
remoteAudioTrack?.setPlaybackAllowed(playbackAllowed)
|
|
681
|
-
}
|
|
731
|
+
remoteAudioTrack?.setPlaybackAllowed(playbackAllowed)
|
|
732
|
+
resolve?(true)
|
|
682
733
|
} else if remoteVideoTrack != nil {
|
|
683
734
|
remoteVideoTrack?.setPlaybackAllowed(playbackAllowed)
|
|
735
|
+
resolve?(true)
|
|
736
|
+
} else {
|
|
737
|
+
let errorMessage = "setPlaybackAllowed: No remote audio or video track to set playback"
|
|
738
|
+
reject?(errorMessage, errorMessage, nil)
|
|
684
739
|
}
|
|
685
740
|
}
|
|
686
741
|
}
|
|
@@ -689,7 +744,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
689
744
|
guard let metadata = data.value(forKey: "metadata") as? String
|
|
690
745
|
else {
|
|
691
746
|
let errorMessage = "changeMetadata: " + HMSHelper.getUnavailableRequiredKey(data, ["metadata"])
|
|
692
|
-
emitRequiredKeysError(errorMessage)
|
|
693
747
|
reject?(errorMessage, errorMessage, nil)
|
|
694
748
|
return
|
|
695
749
|
}
|
|
@@ -705,23 +759,52 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
705
759
|
})
|
|
706
760
|
}
|
|
707
761
|
|
|
708
|
-
func setVolume(_ data: NSDictionary) {
|
|
762
|
+
func setVolume(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
709
763
|
guard let trackId = data.value(forKey: "trackId") as? String,
|
|
710
764
|
let volume = data.value(forKey: "volume") as? Double
|
|
711
765
|
else {
|
|
712
766
|
let errorMessage = "setVolume: " + HMSHelper.getUnavailableRequiredKey(data, ["trackId", "volume"])
|
|
713
|
-
|
|
767
|
+
reject?(errorMessage, errorMessage, nil)
|
|
714
768
|
return
|
|
715
769
|
}
|
|
716
770
|
|
|
717
771
|
DispatchQueue.main.async { [weak self] in
|
|
718
772
|
guard let strongSelf = self else { return }
|
|
719
|
-
let remotePeers =
|
|
773
|
+
let remotePeers = strongSelf.hms?.remotePeers
|
|
720
774
|
|
|
721
775
|
let remoteAudioTrack = HMSHelper.getRemoteAudioAuxiliaryTrackFromTrackId(trackId, remotePeers)
|
|
722
776
|
|
|
723
777
|
if remoteAudioTrack != nil {
|
|
724
778
|
remoteAudioTrack?.setVolume(volume)
|
|
779
|
+
resolve?(nil)
|
|
780
|
+
} else {
|
|
781
|
+
let errorMessage = "setVolume: No remote audio track not available"
|
|
782
|
+
reject?(errorMessage, errorMessage, nil)
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
func switchAudioOutput(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
788
|
+
|
|
789
|
+
guard let audioDevice = data["audioDevice"] as? String else {
|
|
790
|
+
let errorMessage = "\(#function)" + HMSHelper.getUnavailableRequiredKey(data, ["audioDevice"])
|
|
791
|
+
reject?("6004", errorMessage, nil)
|
|
792
|
+
return
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
DispatchQueue.main.async { [weak self] in
|
|
796
|
+
let outputDevice: HMSAudioOutputDevice
|
|
797
|
+
switch audioDevice {
|
|
798
|
+
case "EARPIECE":
|
|
799
|
+
outputDevice = HMSAudioOutputDevice.earpiece
|
|
800
|
+
default:
|
|
801
|
+
outputDevice = HMSAudioOutputDevice.speaker
|
|
802
|
+
}
|
|
803
|
+
do {
|
|
804
|
+
try self?.hms?.switchAudioOutput(to: outputDevice)
|
|
805
|
+
resolve?(nil)
|
|
806
|
+
} catch let error {
|
|
807
|
+
reject?("6004", error.localizedDescription, nil)
|
|
725
808
|
}
|
|
726
809
|
}
|
|
727
810
|
}
|
|
@@ -730,7 +813,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
730
813
|
guard let record = data.value(forKey: "record") as? Bool
|
|
731
814
|
else {
|
|
732
815
|
let errorMessage = "startRTMPOrRecording: " + HMSHelper.getUnavailableRequiredKey(data, ["record"])
|
|
733
|
-
emitRequiredKeysError(errorMessage)
|
|
734
816
|
reject?(errorMessage, errorMessage, nil)
|
|
735
817
|
return
|
|
736
818
|
}
|
|
@@ -745,6 +827,7 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
745
827
|
meetingUrl = meetLink
|
|
746
828
|
} else {
|
|
747
829
|
reject?("Invalid meeting url passed", "Invalid meeting url passed", nil)
|
|
830
|
+
return
|
|
748
831
|
}
|
|
749
832
|
}
|
|
750
833
|
|
|
@@ -774,6 +857,8 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
774
857
|
})
|
|
775
858
|
}
|
|
776
859
|
|
|
860
|
+
// MARK: - HLS Streaming
|
|
861
|
+
|
|
777
862
|
func startHLSStreaming(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
778
863
|
let recordConfig = HMSHelper.getHlsRecordingConfig(data.value(forKey: "hlsRecordingConfig") as? NSDictionary)
|
|
779
864
|
let hlsMeetingUrlVariant = HMSHelper.getHMSHLSMeetingURLVariants(data.value(forKey: "meetingURLVariants") as? [[String: Any]])
|
|
@@ -805,11 +890,42 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
805
890
|
})
|
|
806
891
|
}
|
|
807
892
|
|
|
893
|
+
func sendHLSTimedMetadata(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
894
|
+
guard let metadataArrayList = data["metadata"] as? [NSDictionary] else {
|
|
895
|
+
let errorMessage = "\(#function) metadata for sendHLSTimedMetadata was not found"
|
|
896
|
+
reject?("6004", errorMessage, nil)
|
|
897
|
+
return
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
let metadata = metadataArrayList.compactMap { (dict: NSDictionary) -> HMSHLSTimedMetadata? in
|
|
901
|
+
guard let payload = dict["payload"] as? String else {
|
|
902
|
+
return nil
|
|
903
|
+
}
|
|
904
|
+
if let duration = dict["duration"] as? Int {
|
|
905
|
+
return HMSHLSTimedMetadata(payload: payload, duration: duration)
|
|
906
|
+
} else {
|
|
907
|
+
return HMSHLSTimedMetadata(payload: payload)
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
DispatchQueue.main.async { [weak self] in
|
|
912
|
+
self?.hms?.sendHLSTimedMetadata(metadata) { success, error in
|
|
913
|
+
if let error = error as? HMSError {
|
|
914
|
+
print(#function, "Unable to send metadata: \(error)")
|
|
915
|
+
reject?("6004", error.localizedDescription, nil)
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
resolve?(success)
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// MARK: -
|
|
924
|
+
|
|
808
925
|
func changeName(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
809
926
|
guard let name = data.value(forKey: "name") as? String
|
|
810
927
|
else {
|
|
811
928
|
let errorMessage = "changeName: " + HMSHelper.getUnavailableRequiredKey(data, ["name"])
|
|
812
|
-
emitRequiredKeysError(errorMessage)
|
|
813
929
|
reject?(errorMessage, errorMessage, nil)
|
|
814
930
|
return
|
|
815
931
|
}
|
|
@@ -841,18 +957,29 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
841
957
|
}
|
|
842
958
|
}
|
|
843
959
|
|
|
844
|
-
func setPlaybackForAllAudio(_ data: NSDictionary) {
|
|
960
|
+
func setPlaybackForAllAudio(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
845
961
|
guard let mute = data.value(forKey: "mute") as? Bool
|
|
846
962
|
else {
|
|
847
|
-
let errorMessage = "setPlaybackForAllAudio: " + HMSHelper.getUnavailableRequiredKey(data, ["
|
|
848
|
-
|
|
963
|
+
let errorMessage = "setPlaybackForAllAudio: " + HMSHelper.getUnavailableRequiredKey(data, ["mute"])
|
|
964
|
+
reject?(errorMessage, errorMessage, nil)
|
|
849
965
|
return
|
|
850
966
|
}
|
|
851
967
|
|
|
852
968
|
DispatchQueue.main.async { [weak self] in
|
|
853
|
-
let
|
|
854
|
-
|
|
855
|
-
|
|
969
|
+
if let self = self, let room = self.hms?.room {
|
|
970
|
+
self.roomMutedLocally = mute
|
|
971
|
+
|
|
972
|
+
let audioTracks = HMSUtilities.getAllAudioTracks(in: room)
|
|
973
|
+
|
|
974
|
+
audioTracks.forEach { audioTrack in
|
|
975
|
+
if audioTrack is HMSRemoteAudioTrack {
|
|
976
|
+
(audioTrack as! HMSRemoteAudioTrack).setPlaybackAllowed(!mute)
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
resolve?(true)
|
|
980
|
+
} else {
|
|
981
|
+
let errorMessage = "setPlaybackForAllAudio: HMSSDK instance not available"
|
|
982
|
+
reject?(errorMessage, errorMessage, nil)
|
|
856
983
|
}
|
|
857
984
|
}
|
|
858
985
|
}
|
|
@@ -930,7 +1057,7 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
930
1057
|
return
|
|
931
1058
|
}
|
|
932
1059
|
|
|
933
|
-
guard let remotePeer = HMSHelper.
|
|
1060
|
+
guard let remotePeer = HMSHelper.getPeerFromPeerId(peerId, remotePeers: self.hms?.remotePeers) else {
|
|
934
1061
|
let errorMessage = "lowerRemotePeerHand: Could not find remote peer with peerID - " + peerId
|
|
935
1062
|
reject?(errorMessage, errorMessage, nil)
|
|
936
1063
|
return
|
|
@@ -952,7 +1079,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
952
1079
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
953
1080
|
else {
|
|
954
1081
|
let errorMessage = "playAudioShare: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode", "fileUrl"])
|
|
955
|
-
emitRequiredKeysError(errorMessage)
|
|
956
1082
|
reject?(errorMessage, errorMessage, nil)
|
|
957
1083
|
return
|
|
958
1084
|
}
|
|
@@ -974,14 +1100,14 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
974
1100
|
}
|
|
975
1101
|
}
|
|
976
1102
|
|
|
977
|
-
func setAudioShareVolume(_ data: NSDictionary) {
|
|
1103
|
+
func setAudioShareVolume(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
978
1104
|
guard let volume = data.value(forKey: "volume") as? NSNumber,
|
|
979
1105
|
let audioNodeName = data.value(forKey: "audioNode") as? String,
|
|
980
1106
|
let audioMixerSourceMap = HMSHelper.getAudioMixerSourceMap(),
|
|
981
1107
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
982
1108
|
else {
|
|
983
1109
|
let errorMessage = "setAudioShareVolume: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode", "volume"])
|
|
984
|
-
|
|
1110
|
+
reject?(errorMessage, errorMessage, nil)
|
|
985
1111
|
return
|
|
986
1112
|
}
|
|
987
1113
|
if let audioMicNode = playerNode as? HMSMicNode {
|
|
@@ -990,53 +1116,64 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
990
1116
|
if let audioFilePlayerNode = playerNode as? HMSAudioFilePlayerNode {
|
|
991
1117
|
audioFilePlayerNode.volume = volume.floatValue
|
|
992
1118
|
}
|
|
1119
|
+
resolve?(true)
|
|
993
1120
|
}
|
|
994
1121
|
|
|
995
|
-
func stopAudioShare(_ data: NSDictionary) {
|
|
1122
|
+
func stopAudioShare(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
996
1123
|
guard let audioNodeName = data.value(forKey: "audioNode") as? String,
|
|
997
1124
|
let audioMixerSourceMap = HMSHelper.getAudioMixerSourceMap(),
|
|
998
1125
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
999
1126
|
else {
|
|
1000
1127
|
let errorMessage = "stopAudioShare: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode"])
|
|
1001
|
-
|
|
1128
|
+
reject?(errorMessage, errorMessage, nil)
|
|
1002
1129
|
return
|
|
1003
1130
|
}
|
|
1004
1131
|
if let audioFilePlayerNode = playerNode as? HMSAudioFilePlayerNode {
|
|
1005
1132
|
audioFilePlayerNode.stop()
|
|
1133
|
+
resolve?(true)
|
|
1134
|
+
} else {
|
|
1135
|
+
let errorMessage = "stopAudioShare: HMSAudioFilePlayerNode not available!"
|
|
1136
|
+
reject?(errorMessage, errorMessage, nil)
|
|
1006
1137
|
}
|
|
1007
1138
|
}
|
|
1008
1139
|
|
|
1009
|
-
func resumeAudioShare(_ data: NSDictionary) {
|
|
1140
|
+
func resumeAudioShare(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
1010
1141
|
guard let audioNodeName = data.value(forKey: "audioNode") as? String,
|
|
1011
1142
|
let audioMixerSourceMap = HMSHelper.getAudioMixerSourceMap(),
|
|
1012
1143
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
1013
1144
|
else {
|
|
1014
1145
|
let errorMessage = "resumeAudioShare: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode"])
|
|
1015
|
-
|
|
1146
|
+
reject?(errorMessage, errorMessage, nil)
|
|
1016
1147
|
return
|
|
1017
1148
|
}
|
|
1018
1149
|
if let audioFilePlayerNode = playerNode as? HMSAudioFilePlayerNode {
|
|
1019
1150
|
do {
|
|
1020
1151
|
try audioFilePlayerNode.resume()
|
|
1152
|
+
resolve?(true)
|
|
1021
1153
|
} catch {
|
|
1022
|
-
|
|
1023
|
-
delegate?.emitEvent(HMSConstants.ON_ERROR, ["error": ["code": 6002, "description": error.localizedDescription, "isTerminal": false, "canRetry": true, "params": ["function": #function]] as [String: Any], "id": id])
|
|
1024
|
-
}
|
|
1154
|
+
reject?(error.localizedDescription, error.localizedDescription, nil)
|
|
1025
1155
|
}
|
|
1156
|
+
} else {
|
|
1157
|
+
let errorMessage = "resumeAudioShare: HMSAudioFilePlayerNode not available!"
|
|
1158
|
+
reject?(errorMessage, errorMessage, nil)
|
|
1026
1159
|
}
|
|
1027
1160
|
}
|
|
1028
1161
|
|
|
1029
|
-
func pauseAudioShare(_ data: NSDictionary) {
|
|
1162
|
+
func pauseAudioShare(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
1030
1163
|
guard let audioNodeName = data.value(forKey: "audioNode") as? String,
|
|
1031
1164
|
let audioMixerSourceMap = HMSHelper.getAudioMixerSourceMap(),
|
|
1032
1165
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
1033
1166
|
else {
|
|
1034
1167
|
let errorMessage = "pauseAudioShare: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode"])
|
|
1035
|
-
|
|
1168
|
+
reject?(errorMessage, errorMessage, nil)
|
|
1036
1169
|
return
|
|
1037
1170
|
}
|
|
1038
1171
|
if let audioFilePlayerNode = playerNode as? HMSAudioFilePlayerNode {
|
|
1039
1172
|
audioFilePlayerNode.pause()
|
|
1173
|
+
resolve?(true)
|
|
1174
|
+
} else {
|
|
1175
|
+
let errorMessage = "pauseAudioShare: HMSAudioFilePlayerNode not available!"
|
|
1176
|
+
reject?(errorMessage, errorMessage, nil)
|
|
1040
1177
|
}
|
|
1041
1178
|
}
|
|
1042
1179
|
|
|
@@ -1046,7 +1183,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1046
1183
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
1047
1184
|
else {
|
|
1048
1185
|
let errorMessage = "pauseAudioShare: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode"])
|
|
1049
|
-
emitRequiredKeysError(errorMessage)
|
|
1050
1186
|
reject?(errorMessage, errorMessage, nil)
|
|
1051
1187
|
return
|
|
1052
1188
|
}
|
|
@@ -1063,7 +1199,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1063
1199
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
1064
1200
|
else {
|
|
1065
1201
|
let errorMessage = "pauseAudioShare: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode"])
|
|
1066
|
-
emitRequiredKeysError(errorMessage)
|
|
1067
1202
|
reject?(errorMessage, errorMessage, nil)
|
|
1068
1203
|
return
|
|
1069
1204
|
}
|
|
@@ -1080,7 +1215,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1080
1215
|
let playerNode = audioMixerSourceMap[audioNodeName]
|
|
1081
1216
|
else {
|
|
1082
1217
|
let errorMessage = "pauseAudioShare: " + HMSHelper.getUnavailableRequiredKey(data, ["audioNode"])
|
|
1083
|
-
emitRequiredKeysError(errorMessage)
|
|
1084
1218
|
reject?(errorMessage, errorMessage, nil)
|
|
1085
1219
|
return
|
|
1086
1220
|
}
|
|
@@ -1102,7 +1236,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1102
1236
|
func enableEvent(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
1103
1237
|
guard let eventType = data.value(forKey: "eventType") as? String else {
|
|
1104
1238
|
let errorMessage = "enableEvent: " + HMSHelper.getUnavailableRequiredKey(data, ["eventType"])
|
|
1105
|
-
emitRequiredKeysError(errorMessage)
|
|
1106
1239
|
reject?(errorMessage, errorMessage, nil)
|
|
1107
1240
|
return
|
|
1108
1241
|
}
|
|
@@ -1114,7 +1247,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1114
1247
|
func disableEvent(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
1115
1248
|
guard let eventType = data.value(forKey: "eventType") as? String else {
|
|
1116
1249
|
let errorMessage = "disableEvent: " + HMSHelper.getUnavailableRequiredKey(data, ["eventType"])
|
|
1117
|
-
emitRequiredKeysError(errorMessage)
|
|
1118
1250
|
reject?(errorMessage, errorMessage, nil)
|
|
1119
1251
|
return
|
|
1120
1252
|
}
|
|
@@ -1123,14 +1255,15 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1123
1255
|
resolve?(["success": true, "message": "function call executed successfully"] as [String: Any])
|
|
1124
1256
|
}
|
|
1125
1257
|
|
|
1126
|
-
func restrictData(_ data: NSDictionary) {
|
|
1258
|
+
func restrictData(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
1127
1259
|
guard let roleName = data.value(forKey: "roleName") as? String else {
|
|
1128
1260
|
let errorMessage = "restrictData: " + HMSHelper.getUnavailableRequiredKey(data, ["roleName"])
|
|
1129
|
-
|
|
1261
|
+
reject?(errorMessage, errorMessage, nil)
|
|
1130
1262
|
return
|
|
1131
1263
|
}
|
|
1132
1264
|
|
|
1133
1265
|
HMSDecoder.setRestrictRoleData(roleName, true)
|
|
1266
|
+
resolve?(true)
|
|
1134
1267
|
}
|
|
1135
1268
|
|
|
1136
1269
|
// MARK: - HMS SDK Get APIs
|
|
@@ -1176,6 +1309,8 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1176
1309
|
return ["name": peer.name]
|
|
1177
1310
|
case "isLocal":
|
|
1178
1311
|
return ["isLocal": peer.isLocal]
|
|
1312
|
+
case "type":
|
|
1313
|
+
return ["type": HMSDecoder.getPeerType(type: peer.type)]
|
|
1179
1314
|
case "networkQuality":
|
|
1180
1315
|
if peer.networkQuality != nil {
|
|
1181
1316
|
return ["networkQuality": HMSDecoder.getHmsNetworkQuality(peer.networkQuality)]
|
|
@@ -1246,13 +1381,13 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1246
1381
|
return ["localPeer": HMSDecoder.getHmsLocalPeer(hms?.localPeer)]
|
|
1247
1382
|
|
|
1248
1383
|
case "browserRecordingState":
|
|
1249
|
-
return ["browserRecordingState": HMSDecoder.
|
|
1384
|
+
return ["browserRecordingState": HMSDecoder.getBrowserRecordingState(hmsRoom.browserRecordingState)]
|
|
1250
1385
|
|
|
1251
1386
|
case "rtmpHMSRtmpStreamingState":
|
|
1252
|
-
return ["rtmpHMSRtmpStreamingState": HMSDecoder.
|
|
1387
|
+
return ["rtmpHMSRtmpStreamingState": HMSDecoder.getRtmpStreamingState(hmsRoom.rtmpStreamingState)]
|
|
1253
1388
|
|
|
1254
1389
|
case "serverRecordingState":
|
|
1255
|
-
return ["serverRecordingState": HMSDecoder.
|
|
1390
|
+
return ["serverRecordingState": HMSDecoder.getServerRecordingState(hmsRoom.serverRecordingState)]
|
|
1256
1391
|
|
|
1257
1392
|
case "hlsStreamingState":
|
|
1258
1393
|
return ["hlsStreamingState": HMSDecoder.getHlsStreamingState(hmsRoom.hlsStreamingState)]
|
|
@@ -1260,6 +1395,12 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1260
1395
|
case "hlsRecordingState":
|
|
1261
1396
|
return ["hlsRecordingState": HMSDecoder.getHlsRecordingState(hmsRoom.hlsRecordingState)]
|
|
1262
1397
|
|
|
1398
|
+
case "isLargeRoom":
|
|
1399
|
+
return ["isLargeRoom": hmsRoom.isLarge]
|
|
1400
|
+
|
|
1401
|
+
case "transcriptions":
|
|
1402
|
+
return ["transcriptions": HMSDecoder.getTranscriptionStates(hmsRoom.transcriptionStates)]
|
|
1403
|
+
|
|
1263
1404
|
default:
|
|
1264
1405
|
return nil
|
|
1265
1406
|
}
|
|
@@ -1270,7 +1411,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1270
1411
|
guard let trackId = data.value(forKey: "trackId") as? String
|
|
1271
1412
|
else {
|
|
1272
1413
|
let errorMessage = "\(#function) " + HMSHelper.getUnavailableRequiredKey(data, ["trackId"])
|
|
1273
|
-
emitRequiredKeysError(errorMessage)
|
|
1274
1414
|
reject?(errorMessage, errorMessage, nil)
|
|
1275
1415
|
return
|
|
1276
1416
|
}
|
|
@@ -1282,7 +1422,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1282
1422
|
let remoteVideoTrack = HMSHelper.getRemoteVideoTrackFromTrackId(trackId, remotePeers)
|
|
1283
1423
|
else {
|
|
1284
1424
|
let errorMessage = "\(#function) " + "TRACK_NOT_FOUND"
|
|
1285
|
-
self?.emitRequiredKeysError(errorMessage)
|
|
1286
1425
|
reject?(errorMessage, errorMessage, nil)
|
|
1287
1426
|
return
|
|
1288
1427
|
}
|
|
@@ -1295,7 +1434,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1295
1434
|
guard let trackId = data.value(forKey: "trackId") as? String
|
|
1296
1435
|
else {
|
|
1297
1436
|
let errorMessage = "\(#function) " + HMSHelper.getUnavailableRequiredKey(data, ["trackId"])
|
|
1298
|
-
emitRequiredKeysError(errorMessage)
|
|
1299
1437
|
reject?(errorMessage, errorMessage, nil)
|
|
1300
1438
|
return
|
|
1301
1439
|
}
|
|
@@ -1307,7 +1445,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1307
1445
|
let remoteAudioTrack = HMSHelper.getRemoteAudioTrackFromTrackId(trackId, remotePeers)
|
|
1308
1446
|
else {
|
|
1309
1447
|
let errorMessage = "\(#function) " + "TRACK_NOT_FOUND"
|
|
1310
|
-
self?.emitRequiredKeysError(errorMessage)
|
|
1311
1448
|
reject?(errorMessage, errorMessage, nil)
|
|
1312
1449
|
return
|
|
1313
1450
|
}
|
|
@@ -1393,6 +1530,26 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1393
1530
|
}
|
|
1394
1531
|
}
|
|
1395
1532
|
|
|
1533
|
+
if roomMutedLocally && update == .trackAdded && track.kind == .audio && !peer.isLocal, let room = self.hms?.room {
|
|
1534
|
+
if let audioTrack = HMSUtilities.getAudioTrack(for: track.trackId, in: room) {
|
|
1535
|
+
if audioTrack is HMSRemoteAudioTrack {
|
|
1536
|
+
(audioTrack as! HMSRemoteAudioTrack).setPlaybackAllowed(!roomMutedLocally)
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
if #available(iOS 15.0, *),
|
|
1542
|
+
useActiveSpeakerInPIP,
|
|
1543
|
+
let controller = pipController,
|
|
1544
|
+
controller.isPictureInPictureActive,
|
|
1545
|
+
track.kind == .video,
|
|
1546
|
+
update == .trackRemoved,
|
|
1547
|
+
pipModel?.track == track {
|
|
1548
|
+
|
|
1549
|
+
pipModel?.text = hms?.localPeer?.name
|
|
1550
|
+
pipModel?.track = nil
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1396
1553
|
if eventsEnableStatus[HMSConstants.ON_TRACK_UPDATE] != true {
|
|
1397
1554
|
return
|
|
1398
1555
|
}
|
|
@@ -1420,6 +1577,35 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1420
1577
|
}
|
|
1421
1578
|
|
|
1422
1579
|
func on(updated speakers: [HMSSpeaker]) {
|
|
1580
|
+
|
|
1581
|
+
if #available(iOS 15.0, *),
|
|
1582
|
+
useActiveSpeakerInPIP,
|
|
1583
|
+
let controller = pipController,
|
|
1584
|
+
controller.isPictureInPictureActive,
|
|
1585
|
+
let peer = speakers.first?.peer,
|
|
1586
|
+
let track = peer.videoTrack {
|
|
1587
|
+
|
|
1588
|
+
if track.isMute() {
|
|
1589
|
+
pipModel?.text = peer.name
|
|
1590
|
+
pipModel?.track = nil
|
|
1591
|
+
} else {
|
|
1592
|
+
if peer.isLocal {
|
|
1593
|
+
if #available(iOS 16.0, *) {
|
|
1594
|
+
if AVCaptureSession().isMultitaskingCameraAccessSupported {
|
|
1595
|
+
pipModel?.text = nil
|
|
1596
|
+
pipModel?.track = track
|
|
1597
|
+
return
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
pipModel?.text = peer.name
|
|
1601
|
+
pipModel?.track = nil
|
|
1602
|
+
} else {
|
|
1603
|
+
pipModel?.text = nil
|
|
1604
|
+
pipModel?.track = track
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1423
1609
|
if eventsEnableStatus[HMSConstants.ON_SPEAKER] != true {
|
|
1424
1610
|
return
|
|
1425
1611
|
}
|
|
@@ -1545,13 +1731,21 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1545
1731
|
self.delegate?.emitEvent(HMSConstants.ON_REMOTE_VIDEO_STATS, ["remoteVideoStats": remoteStats, "track": remoteTrack, "peer": decodedPeer, "id": self.id])
|
|
1546
1732
|
}
|
|
1547
1733
|
|
|
1734
|
+
func on(transcripts: HMSTranscripts) {
|
|
1735
|
+
if eventsEnableStatus[HMSConstants.ON_TRANSCRIPTS] != true {
|
|
1736
|
+
return
|
|
1737
|
+
}
|
|
1738
|
+
let transcriptsArray = HMSDecoder.getHmsTranscripts(transcripts.transcripts)
|
|
1739
|
+
|
|
1740
|
+
self.delegate?.emitEvent(HMSConstants.ON_TRANSCRIPTS, ["id": self.id, "transcripts": transcriptsArray])
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1548
1743
|
// MARK: - Simulcast
|
|
1549
1744
|
|
|
1550
1745
|
func getVideoTrackLayerDefinition(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
1551
1746
|
guard let trackId = data.value(forKey: "trackId") as? String
|
|
1552
1747
|
else {
|
|
1553
1748
|
let errorMessage = "\(#function) " + HMSHelper.getUnavailableRequiredKey(data, ["trackId"])
|
|
1554
|
-
emitRequiredKeysError(errorMessage)
|
|
1555
1749
|
reject?(errorMessage, errorMessage, nil)
|
|
1556
1750
|
return
|
|
1557
1751
|
}
|
|
@@ -1563,7 +1757,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1563
1757
|
let remoteVideoTrack = HMSHelper.getRemoteVideoTrackFromTrackId(trackId, remotePeers)
|
|
1564
1758
|
else {
|
|
1565
1759
|
let errorMessage = "\(#function) " + "TRACK_NOT_FOUND"
|
|
1566
|
-
self?.emitRequiredKeysError(errorMessage)
|
|
1567
1760
|
reject?(errorMessage, errorMessage, nil)
|
|
1568
1761
|
return
|
|
1569
1762
|
}
|
|
@@ -1571,7 +1764,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1571
1764
|
guard let layerDefinitions = remoteVideoTrack.layerDefinitions
|
|
1572
1765
|
else {
|
|
1573
1766
|
let errorMessage = "\(#function) " + "layer definitions not available for track: '\(trackId)' !"
|
|
1574
|
-
self.emitRequiredKeysError(errorMessage)
|
|
1575
1767
|
reject?(errorMessage, errorMessage, nil)
|
|
1576
1768
|
return
|
|
1577
1769
|
}
|
|
@@ -1587,7 +1779,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1587
1779
|
guard let trackId = data.value(forKey: "trackId") as? String
|
|
1588
1780
|
else {
|
|
1589
1781
|
let errorMessage = "\(#function) " + HMSHelper.getUnavailableRequiredKey(data, ["trackId"])
|
|
1590
|
-
emitRequiredKeysError(errorMessage)
|
|
1591
1782
|
reject?(errorMessage, errorMessage, nil)
|
|
1592
1783
|
return
|
|
1593
1784
|
}
|
|
@@ -1599,7 +1790,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1599
1790
|
let remoteVideoTrack = HMSHelper.getRemoteVideoTrackFromTrackId(trackId, remotePeers)
|
|
1600
1791
|
else {
|
|
1601
1792
|
let errorMessage = "\(#function) " + "TRACK_NOT_FOUND"
|
|
1602
|
-
self?.emitRequiredKeysError(errorMessage)
|
|
1603
1793
|
reject?(errorMessage, errorMessage, nil)
|
|
1604
1794
|
return
|
|
1605
1795
|
}
|
|
@@ -1615,7 +1805,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1615
1805
|
let layer = data.value(forKey: "layer") as? String
|
|
1616
1806
|
else {
|
|
1617
1807
|
let errorMessage = "\(#function) " + HMSHelper.getUnavailableRequiredKey(data, ["trackId", "layer"])
|
|
1618
|
-
emitRequiredKeysError(errorMessage)
|
|
1619
1808
|
reject?(errorMessage, errorMessage, nil)
|
|
1620
1809
|
return
|
|
1621
1810
|
}
|
|
@@ -1627,7 +1816,6 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1627
1816
|
let remoteVideoTrack = HMSHelper.getRemoteVideoTrackFromTrackId(trackId, remotePeers)
|
|
1628
1817
|
else {
|
|
1629
1818
|
let errorMessage = "\(#function) " + "TRACK_NOT_FOUND"
|
|
1630
|
-
self?.emitRequiredKeysError(errorMessage)
|
|
1631
1819
|
reject?(errorMessage, errorMessage, nil)
|
|
1632
1820
|
return
|
|
1633
1821
|
}
|
|
@@ -1724,15 +1912,22 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1724
1912
|
return
|
|
1725
1913
|
}
|
|
1726
1914
|
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
resolve?(stringValue)
|
|
1730
|
-
} else {
|
|
1731
|
-
let errorMessage = "\(#function) Session Store value for the key: \(key) is not of String Type. Value: \(value)"
|
|
1732
|
-
reject?("6004", errorMessage, nil)
|
|
1733
|
-
}
|
|
1734
|
-
} else {
|
|
1915
|
+
switch value {
|
|
1916
|
+
case .none:
|
|
1735
1917
|
resolve?(nil)
|
|
1918
|
+
case let boolValue as Bool:
|
|
1919
|
+
resolve?(boolValue)
|
|
1920
|
+
case let doubleValue as Double:
|
|
1921
|
+
resolve?(doubleValue)
|
|
1922
|
+
case let dictValue as [AnyHashable: Any]:
|
|
1923
|
+
resolve?(dictValue)
|
|
1924
|
+
case let arrayValue as [Any]:
|
|
1925
|
+
resolve?(arrayValue)
|
|
1926
|
+
case let stringValue as String:
|
|
1927
|
+
resolve?(stringValue)
|
|
1928
|
+
default:
|
|
1929
|
+
let errorMessage = "\(#function) Session Store value for the key: \(key) is not of valid type. Value: \(String(describing: value))"
|
|
1930
|
+
reject?("6004", errorMessage, nil)
|
|
1736
1931
|
}
|
|
1737
1932
|
}
|
|
1738
1933
|
}
|
|
@@ -1759,14 +1954,13 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1759
1954
|
|
|
1760
1955
|
let valueToBeSet = data["value"] as Any
|
|
1761
1956
|
|
|
1762
|
-
store.set(valueToBeSet, forKey: key) {
|
|
1957
|
+
store.set(valueToBeSet, forKey: key) { _, error in
|
|
1763
1958
|
|
|
1764
1959
|
if let error = error {
|
|
1765
|
-
|
|
1766
|
-
reject?("6004", errorMessage, nil)
|
|
1960
|
+
reject?("6004", error.localizedDescription, nil)
|
|
1767
1961
|
return
|
|
1768
1962
|
}
|
|
1769
|
-
resolve?(["success": true
|
|
1963
|
+
resolve?(["success": true])
|
|
1770
1964
|
}
|
|
1771
1965
|
}
|
|
1772
1966
|
}
|
|
@@ -1811,13 +2005,23 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1811
2005
|
|
|
1812
2006
|
data["key"] = key
|
|
1813
2007
|
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
2008
|
+
switch value {
|
|
2009
|
+
case .none:
|
|
2010
|
+
data["value"] = nil
|
|
2011
|
+
case let boolValue as Bool:
|
|
2012
|
+
data["value"] = boolValue
|
|
2013
|
+
case let doubleValue as Double:
|
|
2014
|
+
data["value"] = doubleValue
|
|
2015
|
+
case let dictValue as [AnyHashable: Any]:
|
|
2016
|
+
data["value"] = dictValue
|
|
2017
|
+
case let arrayValue as [Any]:
|
|
2018
|
+
data["value"] = arrayValue
|
|
2019
|
+
case let stringValue as String:
|
|
2020
|
+
data["value"] = stringValue
|
|
2021
|
+
default:
|
|
2022
|
+
let message = "\(#function) Session Store value for the key: \(key) is not of valid type. Value: \(String(describing: value))"
|
|
2023
|
+
print(message)
|
|
2024
|
+
data["value"] = nil
|
|
1821
2025
|
}
|
|
1822
2026
|
self?.delegate?.emitEvent(HMSConstants.ON_SESSION_STORE_CHANGED, data)
|
|
1823
2027
|
|
|
@@ -1890,6 +2094,552 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1890
2094
|
}
|
|
1891
2095
|
}
|
|
1892
2096
|
|
|
2097
|
+
// MARK: - Peer List Iterator
|
|
2098
|
+
|
|
2099
|
+
func getPeerListIterator(_ data: NSDictionary) -> [AnyHashable: Any]? {
|
|
2100
|
+
guard let uniqueId = data["uniqueId"] as? String else {
|
|
2101
|
+
print("Error in getPeerListIterator: uniqueId is not available")
|
|
2102
|
+
return nil
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
guard let hmssdk = hms else {
|
|
2106
|
+
print("Error in getPeerListIterator: HMSSDK is not available")
|
|
2107
|
+
return nil
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
var peerListIterator: HMSPeerListIterator
|
|
2111
|
+
|
|
2112
|
+
if let peerListIteratorOptions = HMSHelper.getPeerListIteratorOptions(data) {
|
|
2113
|
+
peerListIterator = hmssdk.getPeerListIterator(options: peerListIteratorOptions)
|
|
2114
|
+
} else {
|
|
2115
|
+
peerListIterator = hmssdk.getPeerListIterator()
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
peerListIterators[uniqueId] = peerListIterator
|
|
2119
|
+
|
|
2120
|
+
return [
|
|
2121
|
+
"success": true,
|
|
2122
|
+
"uniqueId": uniqueId,
|
|
2123
|
+
"totalCount": peerListIterator.totalCount
|
|
2124
|
+
]
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
func peerListIteratorHasNext(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
2128
|
+
guard let uniqueId = data["uniqueId"] as? String else {
|
|
2129
|
+
let errorMessage = "\(#function) uniqueId is not available"
|
|
2130
|
+
reject?("6004", errorMessage, nil)
|
|
2131
|
+
return
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
guard let peerListIterator = peerListIterators[uniqueId] else {
|
|
2135
|
+
let errorMessage = "\(#function) HMSPeerListIterator is not available for uniqueId - \(uniqueId)"
|
|
2136
|
+
reject?("6004", errorMessage, nil)
|
|
2137
|
+
return
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2140
|
+
resolve?(peerListIterator.hasNext)
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
func peerListIteratorNext(_ data: NSDictionary, _ resolve: RCTPromiseResolveBlock?, _ reject: RCTPromiseRejectBlock?) {
|
|
2144
|
+
guard let uniqueId = data["uniqueId"] as? String else {
|
|
2145
|
+
let errorMessage = "\(#function) uniqueId is not available"
|
|
2146
|
+
reject?("6004", errorMessage, nil)
|
|
2147
|
+
return
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
guard let peerListIterator = peerListIterators[uniqueId] else {
|
|
2151
|
+
let errorMessage = "\(#function) HMSPeerListIterator is not available for uniqueId - \(uniqueId)"
|
|
2152
|
+
reject?("6004", errorMessage, nil)
|
|
2153
|
+
return
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
peerListIterator.next { peers, error in
|
|
2157
|
+
if let nonnilError = error {
|
|
2158
|
+
reject?("6004", nonnilError.localizedDescription, nil)
|
|
2159
|
+
return
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
if let nonnilPeers = peers {
|
|
2163
|
+
var data = [[String: Any]]()
|
|
2164
|
+
for peer in nonnilPeers {
|
|
2165
|
+
data.append(HMSDecoder.getHmsPeer(peer))
|
|
2166
|
+
}
|
|
2167
|
+
resolve?(["totalCount": peerListIterator.totalCount, "peers": data])
|
|
2168
|
+
} else {
|
|
2169
|
+
let errorMessage = "\(#function) peers is nil"
|
|
2170
|
+
reject?("6004", errorMessage, nil)
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
// MARK: - Noise Cancellation Plugin Functions
|
|
2176
|
+
|
|
2177
|
+
func enableNoiseCancellationPlugin(_ data: NSDictionary,
|
|
2178
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2179
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2180
|
+
|
|
2181
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2182
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2183
|
+
reject?("6004", errorMessage, nil)
|
|
2184
|
+
return
|
|
2185
|
+
}
|
|
2186
|
+
do {
|
|
2187
|
+
try noiseCancellationPlugin.enable()
|
|
2188
|
+
resolve?(true)
|
|
2189
|
+
} catch {
|
|
2190
|
+
reject?("6004", error.localizedDescription, nil)
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
|
|
2194
|
+
func disableNoiseCancellationPlugin(_ data: NSDictionary,
|
|
2195
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2196
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2197
|
+
|
|
2198
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2199
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2200
|
+
reject?("6004", errorMessage, nil)
|
|
2201
|
+
return
|
|
2202
|
+
}
|
|
2203
|
+
do {
|
|
2204
|
+
try noiseCancellationPlugin.disable()
|
|
2205
|
+
resolve?(true)
|
|
2206
|
+
} catch {
|
|
2207
|
+
reject?("6004", error.localizedDescription, nil)
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
func isNoiseCancellationPluginEnabled(_ data: NSDictionary,
|
|
2212
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2213
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2214
|
+
|
|
2215
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2216
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2217
|
+
reject?("6004", errorMessage, nil)
|
|
2218
|
+
return
|
|
2219
|
+
}
|
|
2220
|
+
let isEnabled = noiseCancellationPlugin.isEnabled()
|
|
2221
|
+
resolve?(isEnabled)
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
func isNoiseCancellationPluginAvailable(_ data: NSDictionary,
|
|
2225
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2226
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2227
|
+
|
|
2228
|
+
guard let noiseCancellationPlugin = self.noiseCancellationPlugin else {
|
|
2229
|
+
let errorMessage = "\(#function) noiseCancellationPlugin instance is not available!"
|
|
2230
|
+
reject?("6004", errorMessage, nil)
|
|
2231
|
+
return
|
|
2232
|
+
}
|
|
2233
|
+
let isAvailable = noiseCancellationPlugin.isNoiseCancellationAvailable
|
|
2234
|
+
resolve?(isAvailable)
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
// MARK: - Video Plugins Functions
|
|
2238
|
+
|
|
2239
|
+
func enableVideoPlugin(_ data: NSDictionary,
|
|
2240
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2241
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2242
|
+
guard let videoPluginType = data.value(forKey: "type") as? String else {
|
|
2243
|
+
let errorMessage = "\(#function) HMSVideoPlugin type not passed!"
|
|
2244
|
+
reject?("6004", errorMessage, nil)
|
|
2245
|
+
return
|
|
2246
|
+
}
|
|
2247
|
+
switch videoPluginType {
|
|
2248
|
+
case "HMSVirtualBackgroundPlugin":
|
|
2249
|
+
if #available(iOS 15.0, *) {
|
|
2250
|
+
guard let virtualBackgroundPlugin = self.virtualBackgroundPlugin as? HMSVirtualBackgroundPlugin else {
|
|
2251
|
+
let errorMessage = "\(#function) Unable to cast `var virtualBackgroundPlugin` to type `HMSVirtualBackgroundPlugin`, It is \(String(describing: virtualBackgroundPlugin))"
|
|
2252
|
+
reject?("6004", errorMessage, nil)
|
|
2253
|
+
return
|
|
2254
|
+
}
|
|
2255
|
+
virtualBackgroundPlugin.activate()
|
|
2256
|
+
resolve?(true)
|
|
2257
|
+
} else {
|
|
2258
|
+
let errorMessage = "\(#function) HMSVirtualBackgroundPlugin not available below iOS 15.0"
|
|
2259
|
+
reject?("6004", errorMessage, nil)
|
|
2260
|
+
return
|
|
2261
|
+
}
|
|
2262
|
+
case "HMSVideoFilterPlugin":
|
|
2263
|
+
guard let videoFilterPlugin = self.videoFilterPlugin else {
|
|
2264
|
+
let errorMessage = "\(#function) `videoFilterPlugin` is `nil`, Make sure you are passing `HMSVideoFilterPlugin` instance to `videoTrackSettings` in `HMSSDK.build`"
|
|
2265
|
+
reject?("6004", errorMessage, nil)
|
|
2266
|
+
return
|
|
2267
|
+
}
|
|
2268
|
+
videoFilterPlugin.activate()
|
|
2269
|
+
resolve?(true)
|
|
2270
|
+
default:
|
|
2271
|
+
let errorMessage = "\(#function) Unknown HMSVideoPlugin type passed!"
|
|
2272
|
+
reject?("6004", errorMessage, nil)
|
|
2273
|
+
return
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
func disableVideoPlugin(_ data: NSDictionary,
|
|
2278
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2279
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2280
|
+
guard let videoPluginType = data.value(forKey: "type") as? String else {
|
|
2281
|
+
let errorMessage = "\(#function) HMSVideoPlugin `type` not passed!"
|
|
2282
|
+
reject?("6004", errorMessage, nil)
|
|
2283
|
+
return
|
|
2284
|
+
}
|
|
2285
|
+
switch videoPluginType {
|
|
2286
|
+
case "HMSVirtualBackgroundPlugin":
|
|
2287
|
+
if #available(iOS 15.0, *) {
|
|
2288
|
+
guard let virtualBackgroundPlugin = self.virtualBackgroundPlugin as? HMSVirtualBackgroundPlugin else {
|
|
2289
|
+
let errorMessage = "\(#function) Unable to cast `var virtualBackgroundPlugin` to type `HMSVirtualBackgroundPlugin`, It is \(String(describing: virtualBackgroundPlugin))"
|
|
2290
|
+
reject?("6004", errorMessage, nil)
|
|
2291
|
+
return
|
|
2292
|
+
}
|
|
2293
|
+
virtualBackgroundPlugin.deactivate()
|
|
2294
|
+
resolve?(true)
|
|
2295
|
+
} else {
|
|
2296
|
+
let errorMessage = "\(#function) HMSVirtualBackgroundPlugin not available below iOS 15.0"
|
|
2297
|
+
reject?("6004", errorMessage, nil)
|
|
2298
|
+
return
|
|
2299
|
+
}
|
|
2300
|
+
case "HMSVideoFilterPlugin":
|
|
2301
|
+
guard let videoFilterPlugin = self.videoFilterPlugin else {
|
|
2302
|
+
let errorMessage = "\(#function) `videoFilterPlugin` is `nil`, Make sure you are passing `HMSVideoFilterPlugin` instance to `videoTrackSettings` in `HMSSDK.build`"
|
|
2303
|
+
reject?("6004", errorMessage, nil)
|
|
2304
|
+
return
|
|
2305
|
+
}
|
|
2306
|
+
videoFilterPlugin.deactivate()
|
|
2307
|
+
resolve?(true)
|
|
2308
|
+
default:
|
|
2309
|
+
let errorMessage = "\(#function) Unknown HMSVideoPlugin `type` passed!"
|
|
2310
|
+
reject?("6004", errorMessage, nil)
|
|
2311
|
+
return
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
|
|
2315
|
+
func changeVirtualBackground(_ data: NSDictionary,
|
|
2316
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2317
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2318
|
+
if #available(iOS 15.0, *) {
|
|
2319
|
+
guard let backgroundDict = data.value(forKey: "background") as? NSDictionary
|
|
2320
|
+
else {
|
|
2321
|
+
let errorMessage = "\(#function) No background object passed!"
|
|
2322
|
+
reject?("6004", errorMessage, nil)
|
|
2323
|
+
return
|
|
2324
|
+
}
|
|
2325
|
+
guard let backgroundType = backgroundDict.value(forKey: "type") as? String
|
|
2326
|
+
else {
|
|
2327
|
+
let errorMessage = "\(#function) No background `type` passed!"
|
|
2328
|
+
reject?("6004", errorMessage, nil)
|
|
2329
|
+
return
|
|
2330
|
+
}
|
|
2331
|
+
guard let virtualBackgroundPlugin = self.virtualBackgroundPlugin as? HMSVirtualBackgroundPlugin else {
|
|
2332
|
+
let errorMessage = "\(#function) Unable to cast `var virtualBackgroundPlugin` to type `HMSVirtualBackgroundPlugin`, It is \(String(describing: virtualBackgroundPlugin))"
|
|
2333
|
+
reject?("6004", errorMessage, nil)
|
|
2334
|
+
return
|
|
2335
|
+
}
|
|
2336
|
+
switch backgroundType {
|
|
2337
|
+
case "blur":
|
|
2338
|
+
virtualBackgroundPlugin.backgroundImage = nil
|
|
2339
|
+
resolve?(true)
|
|
2340
|
+
case "image":
|
|
2341
|
+
guard let imageSource = backgroundDict.value(forKey: "source") as? NSDictionary else {
|
|
2342
|
+
let errorMessage = "\(#function) No background `source` passed for image!"
|
|
2343
|
+
reject?("6004", errorMessage, nil)
|
|
2344
|
+
return
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
// Check if it's a remote URL
|
|
2348
|
+
if let uriString = imageSource.value(forKey: "uri") as? String,
|
|
2349
|
+
(uriString.hasPrefix("http://") || uriString.hasPrefix("https://")),
|
|
2350
|
+
let url = URL(string: uriString) {
|
|
2351
|
+
// Download remote image
|
|
2352
|
+
URLSession.shared.dataTask(with: url) { data, response, error in
|
|
2353
|
+
DispatchQueue.main.async {
|
|
2354
|
+
if let error = error {
|
|
2355
|
+
let errorMessage = "\(#function) Failed to download image: \(error.localizedDescription)"
|
|
2356
|
+
reject?("6004", errorMessage, nil)
|
|
2357
|
+
return
|
|
2358
|
+
}
|
|
2359
|
+
guard let data = data, let image = UIImage(data: data) else {
|
|
2360
|
+
let errorMessage = "\(#function) Unable to create `UIImage` from downloaded data!"
|
|
2361
|
+
reject?("6004", errorMessage, nil)
|
|
2362
|
+
return
|
|
2363
|
+
}
|
|
2364
|
+
virtualBackgroundPlugin.backgroundImage = image
|
|
2365
|
+
resolve?(true)
|
|
2366
|
+
}
|
|
2367
|
+
}.resume()
|
|
2368
|
+
} else {
|
|
2369
|
+
// Use RCTConvert for local files and bundled resources
|
|
2370
|
+
DispatchQueue.main.async {
|
|
2371
|
+
guard let image = RCTConvert.uiImage(imageSource) else {
|
|
2372
|
+
let errorMessage = "\(#function) Unable to create `UIImage` from given background `source` object!"
|
|
2373
|
+
reject?("6004", errorMessage, nil)
|
|
2374
|
+
return
|
|
2375
|
+
}
|
|
2376
|
+
virtualBackgroundPlugin.backgroundImage = image
|
|
2377
|
+
resolve?(true)
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
default:
|
|
2381
|
+
let errorMessage = "\(#function) Unknown background `type` passed!"
|
|
2382
|
+
reject?("6004", errorMessage, nil)
|
|
2383
|
+
return
|
|
2384
|
+
}
|
|
2385
|
+
} else {
|
|
2386
|
+
let errorMessage = "\(#function) HMSVirtualBackgroundPlugin not available below iOS 15.0"
|
|
2387
|
+
reject?("6004", errorMessage, nil)
|
|
2388
|
+
return
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
func setVideoFilterParameter(_ data: NSDictionary,
|
|
2393
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2394
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2395
|
+
guard let videoFilterPlugin = self.videoFilterPlugin else {
|
|
2396
|
+
let errorMessage = "\(#function) `videoFilterPlugin` is `nil`, Make sure you are passing `HMSVideoFilterPlugin` instance to `videoTrackSettings` in `HMSSDK.build`"
|
|
2397
|
+
reject?("6004", errorMessage, nil)
|
|
2398
|
+
return
|
|
2399
|
+
}
|
|
2400
|
+
guard let filterType = data.value(forKey: "filter") as? String else {
|
|
2401
|
+
let errorMessage = "\(#function) `filter` property not passed!"
|
|
2402
|
+
reject?("6004", errorMessage, nil)
|
|
2403
|
+
return
|
|
2404
|
+
}
|
|
2405
|
+
guard let filterValue = data.value(forKey: "value") as? NSNumber else {
|
|
2406
|
+
let errorMessage = "\(#function) `value` property not passed!"
|
|
2407
|
+
reject?("6004", errorMessage, nil)
|
|
2408
|
+
return
|
|
2409
|
+
}
|
|
2410
|
+
switch filterType {
|
|
2411
|
+
case "brightness":
|
|
2412
|
+
videoFilterPlugin.brightness = CGFloat(truncating: filterValue)
|
|
2413
|
+
case "contrast":
|
|
2414
|
+
videoFilterPlugin.contrast = CGFloat(truncating: filterValue)
|
|
2415
|
+
case "exposure":
|
|
2416
|
+
videoFilterPlugin.exposure = CGFloat(truncating: filterValue)
|
|
2417
|
+
case "hue":
|
|
2418
|
+
videoFilterPlugin.hue = CGFloat(truncating: filterValue)
|
|
2419
|
+
case "redness":
|
|
2420
|
+
videoFilterPlugin.redness = CGFloat(truncating: filterValue)
|
|
2421
|
+
case "saturation":
|
|
2422
|
+
videoFilterPlugin.saturation = CGFloat(truncating: filterValue)
|
|
2423
|
+
case "sharpness":
|
|
2424
|
+
videoFilterPlugin.sharpness = CGFloat(truncating: filterValue)
|
|
2425
|
+
case "smoothness":
|
|
2426
|
+
videoFilterPlugin.smoothness = CGFloat(truncating: filterValue)
|
|
2427
|
+
default:
|
|
2428
|
+
let errorMessage = "\(#function) Unknown `filter` type passed!"
|
|
2429
|
+
reject?("6004", errorMessage, nil)
|
|
2430
|
+
return
|
|
2431
|
+
}
|
|
2432
|
+
resolve?(true)
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
// MARK: - WebRTC Transcriptions
|
|
2436
|
+
|
|
2437
|
+
func handleRealTimeTranscription(_ data: NSDictionary,
|
|
2438
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2439
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2440
|
+
guard let action = data.value(forKey: "action") as? String else {
|
|
2441
|
+
reject?("\(#function): `action` key not passed", "\(#function): `action` key not passed", nil)
|
|
2442
|
+
return
|
|
2443
|
+
}
|
|
2444
|
+
switch action {
|
|
2445
|
+
case "start":
|
|
2446
|
+
startRealTimeTranscription(data, resolve, reject)
|
|
2447
|
+
case "stop":
|
|
2448
|
+
stopRealTimeTranscription(data, resolve, reject)
|
|
2449
|
+
default:
|
|
2450
|
+
reject?("\(#function): Unknown `action` key passed", "\(#function): Unknown `action` key passed", nil)
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
private func startRealTimeTranscription(_ data: NSDictionary,
|
|
2455
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2456
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2457
|
+
guard let hmssdk = hms else {
|
|
2458
|
+
reject?("\(#function): HMSSDK not available", "\(#function): HMSSDK not available", nil)
|
|
2459
|
+
return
|
|
2460
|
+
}
|
|
2461
|
+
hmssdk.startTranscription { success, error in
|
|
2462
|
+
if let error = error {
|
|
2463
|
+
reject?(error.localizedDescription, error.localizedDescription, nil)
|
|
2464
|
+
return
|
|
2465
|
+
}
|
|
2466
|
+
resolve?(success)
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
private func stopRealTimeTranscription(_ data: NSDictionary,
|
|
2471
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2472
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2473
|
+
guard let hmssdk = hms else {
|
|
2474
|
+
reject?("\(#function): HMSSDK not available", "\(#function): HMSSDK not available", nil)
|
|
2475
|
+
return
|
|
2476
|
+
}
|
|
2477
|
+
hmssdk.stopTranscription { success, error in
|
|
2478
|
+
if let error = error {
|
|
2479
|
+
reject?(error.localizedDescription, error.localizedDescription, nil)
|
|
2480
|
+
return
|
|
2481
|
+
}
|
|
2482
|
+
resolve?(success)
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
// MARK: - PIP Mode Support
|
|
2487
|
+
|
|
2488
|
+
internal var _pipVideoCallViewController: Any?
|
|
2489
|
+
|
|
2490
|
+
@available(iOS 15.0, *)
|
|
2491
|
+
internal var pipVideoCallViewController: AVPictureInPictureVideoCallViewController? {
|
|
2492
|
+
if _pipVideoCallViewController == nil {
|
|
2493
|
+
_pipVideoCallViewController = AVPictureInPictureVideoCallViewController()
|
|
2494
|
+
}
|
|
2495
|
+
return _pipVideoCallViewController as? AVPictureInPictureVideoCallViewController
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
internal var _pipModel: Any?
|
|
2499
|
+
|
|
2500
|
+
@available(iOS 15.0, *)
|
|
2501
|
+
internal var pipModel: HMSPipModel? {
|
|
2502
|
+
if _pipModel == nil {
|
|
2503
|
+
_pipModel = HMSPipModel()
|
|
2504
|
+
}
|
|
2505
|
+
return _pipModel as? HMSPipModel
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
internal var pipController: AVPictureInPictureController?
|
|
2509
|
+
|
|
2510
|
+
private var useActiveSpeakerInPIP: Bool = true
|
|
2511
|
+
|
|
2512
|
+
@available(iOS 15.0, *)
|
|
2513
|
+
func setPictureInPictureParams(_ data: NSDictionary,
|
|
2514
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2515
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2516
|
+
|
|
2517
|
+
guard AVPictureInPictureController.isPictureInPictureSupported() else {
|
|
2518
|
+
let errorMessage = "\(#function) PIP is not supported on this device"
|
|
2519
|
+
reject?("6004", errorMessage, nil)
|
|
2520
|
+
return
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
guard let uiView = UIApplication.shared.keyWindow?.rootViewController?.view else {
|
|
2524
|
+
let errorMessage = "\(#function) Failed to setup PIP"
|
|
2525
|
+
reject?("6004", errorMessage, nil)
|
|
2526
|
+
return
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
pipModel?.pipViewEnabled = true
|
|
2530
|
+
|
|
2531
|
+
if let scaleType = data["scaleType"] as? String {
|
|
2532
|
+
pipModel?.scaleType = getViewContentMode(scaleType)
|
|
2533
|
+
} else {
|
|
2534
|
+
pipModel?.scaleType = .scaleAspectFill
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
pipModel?.color = .black
|
|
2538
|
+
pipModel?.text = hms?.localPeer?.name
|
|
2539
|
+
|
|
2540
|
+
let controller = UIHostingController(rootView: HMSPipView(model: pipModel!))
|
|
2541
|
+
|
|
2542
|
+
pipVideoCallViewController?.view.addConstrained(subview: controller.view)
|
|
2543
|
+
|
|
2544
|
+
if let ratio = data["aspectRatio"] as? [Int], ratio.count == 2 {
|
|
2545
|
+
pipVideoCallViewController?.preferredContentSize = CGSize(width: ratio[0], height: ratio[1])
|
|
2546
|
+
} else {
|
|
2547
|
+
pipVideoCallViewController?.preferredContentSize = CGSize(width: uiView.frame.size.width, height: uiView.frame.size.height)
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
guard let pipVideoCallViewController = pipVideoCallViewController else {
|
|
2551
|
+
let errorMessage = "\(#function) Failed to setup PIP"
|
|
2552
|
+
reject?("6004", errorMessage, nil)
|
|
2553
|
+
return
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
let pipContentSource = AVPictureInPictureController.ContentSource(activeVideoCallSourceView: uiView, contentViewController: pipVideoCallViewController)
|
|
2557
|
+
|
|
2558
|
+
pipController = AVPictureInPictureController(contentSource: pipContentSource)
|
|
2559
|
+
|
|
2560
|
+
pipController?.delegate = self
|
|
2561
|
+
|
|
2562
|
+
pipController?.canStartPictureInPictureAutomaticallyFromInline = true
|
|
2563
|
+
|
|
2564
|
+
if let autoEnterPIP = data["autoEnterPipMode"] as? Bool {
|
|
2565
|
+
pipController?.canStartPictureInPictureAutomaticallyFromInline = autoEnterPIP
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification,
|
|
2569
|
+
object: nil, queue: .main) { [weak self] _ in
|
|
2570
|
+
self?.stopPIP(nil, nil)
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
resolve?(true)
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
func enterPipMode(_ resolve: RCTPromiseResolveBlock?,
|
|
2577
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2578
|
+
pipController?.startPictureInPicture()
|
|
2579
|
+
resolve?(true)
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
func stopPIP(_ resolve: RCTPromiseResolveBlock?,
|
|
2583
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2584
|
+
pipController?.stopPictureInPicture()
|
|
2585
|
+
resolve?(nil)
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
func disposePIP(_ resolve: RCTPromiseResolveBlock?,
|
|
2589
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2590
|
+
pipController = nil
|
|
2591
|
+
_pipModel = nil
|
|
2592
|
+
_pipVideoCallViewController = nil
|
|
2593
|
+
NotificationCenter.default.removeObserver(UIApplication.didBecomeActiveNotification)
|
|
2594
|
+
resolve?(nil)
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
func isPIPActive(_ resolve: RCTPromiseResolveBlock?,
|
|
2598
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2599
|
+
if pipController != nil && pipController!.isPictureInPictureActive {
|
|
2600
|
+
resolve?(true)
|
|
2601
|
+
} else {
|
|
2602
|
+
resolve?(false)
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
/// Change the video track in PIP Mode
|
|
2607
|
+
/// - Parameters:
|
|
2608
|
+
/// - data: Data containing the trackId of the video track to be changed
|
|
2609
|
+
/// - resolve: Promise resolve block
|
|
2610
|
+
/// - reject: Promise reject block
|
|
2611
|
+
@available(iOS 15.0, *)
|
|
2612
|
+
func changeIOSPIPVideoTrack(_ data: NSDictionary,
|
|
2613
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2614
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2615
|
+
|
|
2616
|
+
guard let trackID = data["trackId"] as? String,
|
|
2617
|
+
let room = hms?.room,
|
|
2618
|
+
let track = HMSUtilities.getVideoTrack(for: trackID, in: room)
|
|
2619
|
+
else {
|
|
2620
|
+
let errorMessage = "\(#function) Incorrect data passed for changing track in PIP Mode"
|
|
2621
|
+
reject?("6004", errorMessage, nil)
|
|
2622
|
+
return
|
|
2623
|
+
}
|
|
2624
|
+
|
|
2625
|
+
useActiveSpeakerInPIP = false
|
|
2626
|
+
pipModel?.track = track
|
|
2627
|
+
resolve?(nil)
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
func setActiveSpeakerInIOSPIP(_ data: NSDictionary,
|
|
2631
|
+
_ resolve: RCTPromiseResolveBlock?,
|
|
2632
|
+
_ reject: RCTPromiseRejectBlock?) {
|
|
2633
|
+
guard let enabled = data["enable"] as? Bool else {
|
|
2634
|
+
let errorMessage = "\(#function) Incorrect data passed for setActiveSpeakerInIOSPIP in PIP Mode"
|
|
2635
|
+
reject?("6004", errorMessage, nil)
|
|
2636
|
+
return
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
useActiveSpeakerInPIP = enabled
|
|
2640
|
+
resolve?(nil)
|
|
2641
|
+
}
|
|
2642
|
+
|
|
1893
2643
|
// MARK: - Helper Functions
|
|
1894
2644
|
|
|
1895
2645
|
// Handle resetting states and data cleanup
|
|
@@ -1907,6 +2657,8 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1907
2657
|
self.eventsEnableStatus.removeAll()
|
|
1908
2658
|
self.sessionStore = nil
|
|
1909
2659
|
self.sessionStoreChangeObservers.removeAll()
|
|
2660
|
+
self.peerListIterators.removeAll()
|
|
2661
|
+
self.roomMutedLocally = false
|
|
1910
2662
|
HMSDecoder.clearRestrictDataStates()
|
|
1911
2663
|
}
|
|
1912
2664
|
|
|
@@ -1966,6 +2718,8 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1966
2718
|
return "SERVER_RECORDING_STATE_UPDATED"
|
|
1967
2719
|
case .hlsRecordingStateUpdated:
|
|
1968
2720
|
return "HLS_RECORDING_STATE_UPDATED"
|
|
2721
|
+
case .transcriptionStateUpdated:
|
|
2722
|
+
return "TRANSCRIPTIONS_UPDATED"
|
|
1969
2723
|
default:
|
|
1970
2724
|
return ""
|
|
1971
2725
|
}
|
|
@@ -1986,6 +2740,19 @@ class HMSRNSDK: HMSUpdateListener, HMSPreviewListener {
|
|
|
1986
2740
|
static private func getTimeStamp() -> String {
|
|
1987
2741
|
"\(Date().timeIntervalSince1970)"
|
|
1988
2742
|
}
|
|
2743
|
+
|
|
2744
|
+
private func getViewContentMode(_ type: String?) -> UIView.ContentMode {
|
|
2745
|
+
switch type {
|
|
2746
|
+
case "ASPECT_FILL":
|
|
2747
|
+
return .scaleAspectFill
|
|
2748
|
+
case "ASPECT_FIT":
|
|
2749
|
+
return .scaleAspectFit
|
|
2750
|
+
case "ASPECT_BALANCED":
|
|
2751
|
+
return .center
|
|
2752
|
+
default:
|
|
2753
|
+
return .scaleAspectFill
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
1989
2756
|
}
|
|
1990
2757
|
|
|
1991
2758
|
extension UIImage {
|
|
@@ -2001,3 +2768,63 @@ extension UIImage {
|
|
|
2001
2768
|
return normalizedImage
|
|
2002
2769
|
}
|
|
2003
2770
|
}
|
|
2771
|
+
|
|
2772
|
+
extension HMSRNSDK: AVPictureInPictureControllerDelegate {
|
|
2773
|
+
|
|
2774
|
+
public func pictureInPictureControllerWillStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2775
|
+
print(#function)
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
public func pictureInPictureControllerDidStartPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2779
|
+
|
|
2780
|
+
if eventsEnableStatus[HMSConstants.ON_PIP_MODE_CHANGED] != true {
|
|
2781
|
+
return
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
self.delegate?.emitEvent(HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2785
|
+
["event": HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2786
|
+
"id": self.id,
|
|
2787
|
+
"isInPictureInPictureMode": true])
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
public func pictureInPictureControllerWillStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2791
|
+
print(#function)
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
public func pictureInPictureControllerDidStopPictureInPicture(_ pictureInPictureController: AVPictureInPictureController) {
|
|
2795
|
+
if eventsEnableStatus[HMSConstants.ON_PIP_MODE_CHANGED] != true {
|
|
2796
|
+
return
|
|
2797
|
+
}
|
|
2798
|
+
|
|
2799
|
+
self.delegate?.emitEvent(HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2800
|
+
["event": HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2801
|
+
"id": self.id,
|
|
2802
|
+
"isInPictureInPictureMode": false])
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
public func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, failedToStartPictureInPictureWithError error: Error) {
|
|
2806
|
+
if eventsEnableStatus[HMSConstants.ON_PIP_MODE_CHANGED] != true {
|
|
2807
|
+
return
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
self.delegate?.emitEvent(HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2811
|
+
["event": HMSConstants.ON_PIP_MODE_CHANGED,
|
|
2812
|
+
"id": self.id,
|
|
2813
|
+
"isInPictureInPictureMode": false])
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
public func pictureInPictureController(_ pictureInPictureController: AVPictureInPictureController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) {
|
|
2817
|
+
print(#function)
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
extension UIView {
|
|
2822
|
+
func addConstrained(subview: UIView) {
|
|
2823
|
+
addSubview(subview)
|
|
2824
|
+
subview.translatesAutoresizingMaskIntoConstraints = false
|
|
2825
|
+
subview.topAnchor.constraint(equalTo: topAnchor).isActive = true
|
|
2826
|
+
subview.leadingAnchor.constraint(equalTo: leadingAnchor).isActive = true
|
|
2827
|
+
subview.trailingAnchor.constraint(equalTo: trailingAnchor).isActive = true
|
|
2828
|
+
subview.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true
|
|
2829
|
+
}
|
|
2830
|
+
}
|