@100mslive/react-native-hms 1.6.2 → 1.7.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 +30 -39
- 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.9/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.9/executionHistory/executionHistory.lock +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/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- 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/build.gradle +24 -9
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +103 -104
- package/android/gradlew.bat +3 -18
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +40 -17
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +248 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +101 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +12 -6
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +7 -14
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +118 -113
- package/android/src/main/java/com/reactnativehmssdk/HmssdkPackage.kt +1 -1
- package/android/src/main/res/layout/player_view.xml +9 -0
- package/ios/HMSDecoder.swift +8 -7
- package/ios/HMSHLSPlayerManager.m +22 -0
- package/ios/HMSHLSPlayerManager.swift +368 -0
- package/ios/HMSHelper.swift +6 -2
- package/ios/HMSManager.m +5 -2
- package/ios/HMSManager.swift +30 -16
- package/ios/HMSRNSDK.swift +84 -105
- package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSBrowserRecordingState.js +2 -0
- package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraControl.js +3 -5
- package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +44 -38
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSEventEmitter.js +10 -0
- package/lib/commonjs/classes/HMSEventEmitter.js.map +1 -0
- package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSManagerModule.js +18 -0
- package/lib/commonjs/classes/HMSManagerModule.js.map +1 -0
- package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventListener.js +13 -0
- package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -0
- package/lib/commonjs/classes/HMSPeer.js +55 -20
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerUpdate.js +1 -1
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js +33 -43
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
- package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomCache.js +10 -5
- package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +108 -113
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +6 -7
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
- package/lib/commonjs/classes/HMSTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +4 -1
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +147 -0
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -0
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +12 -0
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -0
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js +71 -0
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -0
- package/lib/commonjs/components/HMSHLSPlayer/index.js +63 -0
- package/lib/commonjs/components/HMSHLSPlayer/index.js.map +1 -0
- package/lib/commonjs/hooks/useHMSPeerUpdates.js +77 -0
- package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -0
- package/lib/commonjs/index.js +63 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hls-player-playback-slice.js +23 -0
- package/lib/commonjs/stores/hls-player-playback-slice.js.map +1 -0
- package/lib/commonjs/stores/hls-player-stats-store.js +36 -0
- package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -0
- package/lib/commonjs/stores/hms-store.js +16 -0
- package/lib/commonjs/stores/hms-store.js.map +1 -0
- package/lib/commonjs/stores/types.js +6 -0
- package/lib/commonjs/stores/types.js.map +1 -0
- package/lib/commonjs/types.js +36 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/classes/HMSAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSBrowserRecordingState.js +2 -0
- package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
- package/lib/module/classes/HMSCameraControl.js +1 -4
- package/lib/module/classes/HMSCameraControl.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +42 -37
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSEventEmitter.js +3 -0
- package/lib/module/classes/HMSEventEmitter.js.map +1 -0
- package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSLocalPeer.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSManagerModule.js +11 -0
- package/lib/module/classes/HMSManagerModule.js.map +1 -0
- package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/module/classes/HMSNativeEventListener.js +5 -0
- package/lib/module/classes/HMSNativeEventListener.js.map +1 -0
- package/lib/module/classes/HMSPeer.js +55 -20
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerUpdate.js +1 -1
- package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/module/classes/HMSPeersCache.js +31 -42
- package/lib/module/classes/HMSPeersCache.js.map +1 -1
- package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSRoom.js.map +1 -1
- package/lib/module/classes/HMSRoomCache.js +8 -4
- package/lib/module/classes/HMSRoomCache.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +57 -62
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +2 -4
- package/lib/module/classes/HMSSessionStore.js.map +1 -1
- package/lib/module/classes/HMSTrack.js.map +1 -1
- package/lib/module/classes/HMSVideoTrack.js.map +1 -1
- package/lib/module/classes/HmsView.js +4 -1
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +138 -0
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -0
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +4 -0
- package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -0
- package/lib/module/components/HMSHLSPlayer/hooks.js +56 -0
- package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -0
- package/lib/module/components/HMSHLSPlayer/index.js +3 -0
- package/lib/module/components/HMSHLSPlayer/index.js.map +1 -0
- package/lib/module/hooks/useHMSPeerUpdates.js +67 -0
- package/lib/module/hooks/useHMSPeerUpdates.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/stores/hls-player-playback-slice.js +16 -0
- package/lib/module/stores/hls-player-playback-slice.js.map +1 -0
- package/lib/module/stores/hls-player-stats-store.js +29 -0
- package/lib/module/stores/hls-player-stats-store.js.map +1 -0
- package/lib/module/stores/hms-store.js +9 -0
- package/lib/module/stores/hms-store.js.map +1 -0
- package/lib/module/stores/types.js +2 -0
- package/lib/module/stores/types.js.map +1 -0
- package/lib/module/types.js +32 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/classes/HMSAudioTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +2 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +1 -0
- package/lib/typescript/classes/HMSEventEmitter.d.ts +2 -0
- package/lib/typescript/classes/HMSLocalAudioTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSLocalPeer.d.ts +3 -3
- package/lib/typescript/classes/HMSLocalVideoTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSManagerModule.d.ts +3 -0
- package/lib/typescript/classes/HMSNativeEventListener.d.ts +4 -0
- package/lib/typescript/classes/HMSPeer.d.ts +10 -5
- package/lib/typescript/classes/HMSPeersCache.d.ts +17 -2
- package/lib/typescript/classes/HMSRTMPConfig.d.ts +2 -2
- package/lib/typescript/classes/HMSRemoteAudioTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSRemotePeer.d.ts +3 -3
- package/lib/typescript/classes/HMSRemoteVideoTrack.d.ts +2 -1
- package/lib/typescript/classes/HMSRoom.d.ts +1 -1
- package/lib/typescript/classes/HMSSDK.d.ts +5 -15
- package/lib/typescript/classes/HMSTrack.d.ts +3 -2
- package/lib/typescript/classes/HMSVideoTrack.d.ts +2 -1
- package/lib/typescript/classes/HmsView.d.ts +1 -1
- package/lib/typescript/components/HMSHLSPlayer/HMSHLSPlayer.d.ts +21 -0
- package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +19 -0
- package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +17 -0
- package/lib/typescript/components/HMSHLSPlayer/index.d.ts +2 -0
- package/lib/typescript/hooks/useHMSPeerUpdates.d.ts +7 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/stores/hls-player-playback-slice.d.ts +5 -0
- package/lib/typescript/stores/hls-player-stats-store.d.ts +9 -0
- package/lib/typescript/stores/hms-store.d.ts +9 -0
- package/lib/typescript/stores/types.d.ts +25 -0
- package/lib/typescript/types.d.ts +63 -0
- package/package.json +4 -1
- package/react-native-hms.podspec +1 -0
- package/sdk-versions.json +3 -2
- package/src/classes/HMSAudioTrack.ts +2 -1
- package/src/classes/HMSBrowserRecordingState.ts +3 -0
- package/src/classes/HMSCameraControl.ts +1 -2
- package/src/classes/HMSEncoder.ts +18 -8
- package/src/classes/HMSEventEmitter.ts +3 -0
- package/src/classes/HMSLocalAudioTrack.ts +2 -1
- package/src/classes/HMSLocalPeer.ts +3 -3
- package/src/classes/HMSLocalVideoTrack.ts +2 -1
- package/src/classes/HMSManagerModule.ts +18 -0
- package/src/classes/HMSNativeEventEmitter.ts +2 -1
- package/src/classes/HMSNativeEventListener.ts +8 -0
- package/src/classes/HMSPeer.ts +96 -48
- package/src/classes/HMSPeerUpdate.ts +4 -4
- package/src/classes/HMSPeersCache.ts +55 -43
- package/src/classes/HMSRTMPConfig.ts +2 -2
- package/src/classes/HMSRemoteAudioTrack.ts +2 -1
- package/src/classes/HMSRemotePeer.ts +3 -3
- package/src/classes/HMSRemoteVideoTrack.ts +2 -1
- package/src/classes/HMSRoom.ts +1 -1
- package/src/classes/HMSRoomCache.ts +11 -3
- package/src/classes/HMSSDK.tsx +74 -73
- package/src/classes/HMSSessionStore.ts +6 -8
- package/src/classes/HMSTrack.ts +3 -2
- package/src/classes/HMSVideoTrack.ts +2 -1
- package/src/classes/HmsView.tsx +8 -2
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +261 -0
- package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +37 -0
- package/src/components/HMSHLSPlayer/hooks.ts +101 -0
- package/src/components/HMSHLSPlayer/index.ts +9 -0
- package/src/hooks/useHMSPeerUpdates.ts +85 -0
- package/src/index.ts +14 -0
- package/src/stores/hls-player-playback-slice.ts +25 -0
- package/src/stores/hls-player-stats-store.ts +37 -0
- package/src/stores/hms-store.ts +11 -0
- package/src/stores/types.ts +49 -0
- package/src/types.ts +119 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/jarRepositories.xml +0 -50
- package/android/.idea/libraries/Gradle__androidx_activity_activity_1_2_4_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_3_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_experimental_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_4_1_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_4_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_autofill_autofill_1_1_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_collection_collection_1_1_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_2_1_3_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_core_core_1_7_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_3_6_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_4_0.xml +0 -11
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_4_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_savedstate_2_3_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +0 -16
- package/android/.idea/libraries/Gradle__androidx_tracing_tracing_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_1_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_fbjni_fbjni_0_3_0_aar.xml +0 -14
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_2_5_0_aar.xml +0 -18
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_native_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_ashmem_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_java_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_native_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagefilters_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagetranscoder_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_fresco_ui_common_2_5_0_aar.xml +0 -15
- package/android/.idea/libraries/Gradle__com_facebook_infer_annotation_infer_annotation_0_18_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_71_0_rc_0_debug_aar.xml +0 -14
- package/android/.idea/libraries/Gradle__com_facebook_soloader_annotation_0_10_4.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_soloader_nativeloader_0_10_4.xml +0 -13
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_10_4_aar.xml +0 -14
- package/android/.idea/libraries/Gradle__com_facebook_yoga_proguard_annotations_1_19_0.xml +0 -13
- package/android/.idea/libraries/Gradle__com_github_100mslive_android_sdk_lib_2_5_1_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_github_100mslive_webrtc_m104_hms_1_3_aar.xml +0 -10
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_4_9_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_4_9_2.xml +0 -13
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_2_9_0.xml +0 -13
- package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_annotations_jvm_1_3_72.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_6_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_6_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_6_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk8_1_6_10.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlinx_kotlinx_coroutines_android_1_6_0.xml +0 -13
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm_1_6_0.xml +0 -13
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/modules/android.androidTest.iml +0 -203
- package/android/.idea/modules/android.iml +0 -40
- package/android/.idea/modules/android.main.iml +0 -199
- package/android/.idea/modules/android.unitTest.iml +0 -197
- package/android/.idea/modules.xml +0 -11
- package/android/.idea/sonarlint/issuestore/3/c/3c46088b6add3088181589d8ed726652742b6221 +0 -5
- package/android/.idea/sonarlint/issuestore/index.pb +0 -7
- package/android/.idea/vcs.xml +0 -6
- package/android/local.properties +0 -8
- 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/yogesh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/yogesh.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- /package/android/{.idea/sonarlint/issuestore/a/8/a8c9f5ddd88723818e51ae3cf8693d02355a8691 → .gradle/6.7.1/gc.properties} +0 -0
- /package/android/{.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 → .gradle/configuration-cache/gc.properties} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HMSPeer } from './HMSPeer';
|
|
2
2
|
import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
|
|
3
3
|
import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
|
|
4
|
+
import type { HMSTrackSource } from './HMSTrackSource';
|
|
4
5
|
|
|
5
6
|
export class HMSRemotePeer extends HMSPeer {
|
|
6
7
|
private remoteAudio?: HMSRemoteAudioTrack;
|
|
@@ -16,10 +17,9 @@ export class HMSRemotePeer extends HMSPeer {
|
|
|
16
17
|
|
|
17
18
|
constructor(params: {
|
|
18
19
|
peerID: string;
|
|
19
|
-
customerDescription?: string;
|
|
20
20
|
remoteAudioTrackData?: {
|
|
21
21
|
trackId: string;
|
|
22
|
-
source?:
|
|
22
|
+
source?: HMSTrackSource;
|
|
23
23
|
isMute?: boolean;
|
|
24
24
|
trackDescription?: string;
|
|
25
25
|
playbackAllowed?: boolean;
|
|
@@ -27,7 +27,7 @@ export class HMSRemotePeer extends HMSPeer {
|
|
|
27
27
|
};
|
|
28
28
|
remoteVideoTrackData?: {
|
|
29
29
|
trackId: string;
|
|
30
|
-
source?:
|
|
30
|
+
source?: HMSTrackSource;
|
|
31
31
|
trackDescription?: string;
|
|
32
32
|
isMute?: boolean;
|
|
33
33
|
playbackAllowed?: boolean;
|
|
@@ -5,6 +5,7 @@ import type { HMSTrackType } from './HMSTrackType';
|
|
|
5
5
|
import type { HMSLayer } from './HMSLayer';
|
|
6
6
|
import type { HMSSimulcastLayerDefinition } from './HMSSimulcastLayerDefinition';
|
|
7
7
|
import { HMSEncoder } from './HMSEncoder';
|
|
8
|
+
import type { HMSTrackSource } from './HMSTrackSource';
|
|
8
9
|
|
|
9
10
|
const {
|
|
10
11
|
/**
|
|
@@ -105,7 +106,7 @@ export class HMSRemoteVideoTrack extends HMSVideoTrack {
|
|
|
105
106
|
|
|
106
107
|
constructor(params: {
|
|
107
108
|
trackId: string;
|
|
108
|
-
source?:
|
|
109
|
+
source?: HMSTrackSource;
|
|
109
110
|
trackDescription?: string;
|
|
110
111
|
isMute?: boolean;
|
|
111
112
|
playbackAllowed?: boolean;
|
package/src/classes/HMSRoom.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import HMSManager from './HMSManagerModule';
|
|
2
|
+
|
|
2
3
|
import type { HMSRoom } from './HMSRoom';
|
|
3
4
|
import { HMSEncoder } from './HMSEncoder';
|
|
4
5
|
import { HMSRoomUpdate } from './HMSRoomUpdate';
|
|
5
6
|
|
|
6
|
-
const { HMSManager } = NativeModules;
|
|
7
|
-
|
|
8
7
|
export let hmsRoomCache: HMSRoomCache | undefined;
|
|
9
8
|
|
|
10
9
|
export const getHmsRoomCache = () => hmsRoomCache;
|
|
@@ -93,6 +92,13 @@ export class HMSRoomCache {
|
|
|
93
92
|
);
|
|
94
93
|
break;
|
|
95
94
|
}
|
|
95
|
+
case HMSRoomUpdate.ROOM_PEER_COUNT_UPDATED: {
|
|
96
|
+
this._data.set(
|
|
97
|
+
'peerCount',
|
|
98
|
+
encodeHMSRoomProperty(this.id, 'peerCount', data)
|
|
99
|
+
);
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
96
102
|
default: {
|
|
97
103
|
for (const key in data) {
|
|
98
104
|
const property = key as keyof HMSRoomCacheProps;
|
|
@@ -149,6 +155,8 @@ function encodeHMSRoomProperty<T extends keyof HMSRoomCacheProps>(
|
|
|
149
155
|
value = HMSEncoder.encodeHLSRecordingState(data.hlsRecordingState);
|
|
150
156
|
} else if (property === 'localPeer') {
|
|
151
157
|
value = HMSEncoder.encodeHmsLocalPeer(data.localPeer, id);
|
|
158
|
+
} else if (property === 'peerCount') {
|
|
159
|
+
value = typeof data[property] === 'number' ? data[property] : null;
|
|
152
160
|
} else {
|
|
153
161
|
value = data[property];
|
|
154
162
|
}
|
package/src/classes/HMSSDK.tsx
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AppState,
|
|
2
|
+
import { AppState, Platform } from 'react-native';
|
|
3
3
|
import { HMSEncoder } from './HMSEncoder';
|
|
4
4
|
import { HMSHelper } from './HMSHelper';
|
|
5
5
|
import { getLogger, logger, setLogger } from './HMSLogger';
|
|
6
6
|
import { HMSTrackType } from './HMSTrackType';
|
|
7
7
|
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
8
|
-
import { HmsViewComponent
|
|
8
|
+
import { HmsViewComponent } from './HmsView';
|
|
9
|
+
import type { HmsComponentProps } from './HmsView';
|
|
10
|
+
|
|
11
|
+
import HMSManager from './HMSManagerModule';
|
|
9
12
|
|
|
10
13
|
import type { HMSConfig } from './HMSConfig';
|
|
11
14
|
import type { HMSLocalPeer } from './HMSLocalPeer';
|
|
@@ -25,8 +28,8 @@ import type { HMSAudioMixingMode } from './HMSAudioMixingMode';
|
|
|
25
28
|
import type { HMSLogSettings } from './HMSLogSettings';
|
|
26
29
|
import { HMSMessageType } from './HMSMessageType';
|
|
27
30
|
import { HMSPIPListenerActions } from './HMSPIPListenerActions';
|
|
28
|
-
import
|
|
29
|
-
import {
|
|
31
|
+
import HMSNativeEventListener from './HMSNativeEventListener';
|
|
32
|
+
import type { HMSNativeEventSubscription } from './HMSNativeEventListener';
|
|
30
33
|
import {
|
|
31
34
|
clearHmsPeersCache,
|
|
32
35
|
getHmsPeersCache,
|
|
@@ -52,17 +55,8 @@ interface PIPConfig {
|
|
|
52
55
|
videoButton?: boolean;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
const {
|
|
56
|
-
/**
|
|
57
|
-
* @ignore
|
|
58
|
-
*/
|
|
59
|
-
HMSManager,
|
|
60
|
-
} = NativeModules;
|
|
61
|
-
|
|
62
58
|
const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersion');
|
|
63
59
|
|
|
64
|
-
const HmsEventEmitter = new HMSNativeEventEmitter(HMSManager);
|
|
65
|
-
|
|
66
60
|
let HmsSdk: HMSSDK | undefined;
|
|
67
61
|
|
|
68
62
|
export class HMSSDK {
|
|
@@ -94,7 +88,7 @@ export class HMSSDK {
|
|
|
94
88
|
private emitterSubscriptions: Partial<
|
|
95
89
|
Record<
|
|
96
90
|
HMSUpdateListenerActions | HMSPIPListenerActions,
|
|
97
|
-
|
|
91
|
+
HMSNativeEventSubscription
|
|
98
92
|
>
|
|
99
93
|
> = {};
|
|
100
94
|
|
|
@@ -124,6 +118,7 @@ export class HMSSDK {
|
|
|
124
118
|
appGroup?: String;
|
|
125
119
|
preferredExtension?: String;
|
|
126
120
|
logSettings?: HMSLogSettings;
|
|
121
|
+
isPrebuilt?: boolean;
|
|
127
122
|
}) {
|
|
128
123
|
const { version } = require('../../package.json');
|
|
129
124
|
const { major, minor, patch } = ReactNativeVersion.version;
|
|
@@ -134,6 +129,7 @@ export class HMSSDK {
|
|
|
134
129
|
frameworkInfo: {
|
|
135
130
|
version: major + '.' + minor + '.' + patch,
|
|
136
131
|
sdkVersion: version,
|
|
132
|
+
isPrebuilt: params?.isPrebuilt || false,
|
|
137
133
|
},
|
|
138
134
|
logSettings: params?.logSettings,
|
|
139
135
|
});
|
|
@@ -1002,6 +998,7 @@ export class HMSSDK {
|
|
|
1002
998
|
};
|
|
1003
999
|
|
|
1004
1000
|
/**
|
|
1001
|
+
* Android Only
|
|
1005
1002
|
* - This wrapper function used to switch output to device other than the default, currently available only for android.
|
|
1006
1003
|
*
|
|
1007
1004
|
* checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
|
|
@@ -1022,6 +1019,19 @@ export class HMSSDK {
|
|
|
1022
1019
|
}
|
|
1023
1020
|
};
|
|
1024
1021
|
|
|
1022
|
+
switchAudioOutputUsingIOSUI = () => {
|
|
1023
|
+
logger?.verbose('#Function switchAudioOutputUsingIOSUI', {
|
|
1024
|
+
id: this.id,
|
|
1025
|
+
});
|
|
1026
|
+
if (Platform.OS !== 'ios') {
|
|
1027
|
+
throw new Error(
|
|
1028
|
+
'#Function `switchAudioOutputUsingIOSUI` is only available on iOS, use `switchAudioOutput` method instead!'
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
return HMSManager.switchAudioOutputUsingIOSUI({ id: this.id });
|
|
1033
|
+
};
|
|
1034
|
+
|
|
1025
1035
|
/**
|
|
1026
1036
|
* - This wrapper function used to change Audio Mode manually, currently available only for android.
|
|
1027
1037
|
*
|
|
@@ -1067,36 +1077,6 @@ export class HMSSDK {
|
|
|
1067
1077
|
}
|
|
1068
1078
|
};
|
|
1069
1079
|
|
|
1070
|
-
/**
|
|
1071
|
-
* @deprecated Older SessionMetaData APIs has been deprecated in favour of newer Session Store APIs.
|
|
1072
|
-
* You can subscribe to `ON_SESSION_STORE_AVAILABLE` event to get notified when the `HMSSessionStore`
|
|
1073
|
-
* is available and use `set` method on `HMSSessionStore` instance
|
|
1074
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/}
|
|
1075
|
-
*/
|
|
1076
|
-
setSessionMetaData = async (sessionMetaData: string | null) => {
|
|
1077
|
-
logger?.verbose('#Function setSessionMetaData', {
|
|
1078
|
-
id: this.id,
|
|
1079
|
-
sessionMetaData,
|
|
1080
|
-
});
|
|
1081
|
-
return await HMSManager.setSessionMetaData({
|
|
1082
|
-
id: this.id,
|
|
1083
|
-
sessionMetaData,
|
|
1084
|
-
});
|
|
1085
|
-
};
|
|
1086
|
-
|
|
1087
|
-
/**
|
|
1088
|
-
* @deprecated Older SessionMetaData APIs has been deprecated in favour of newer Session Store APIs.
|
|
1089
|
-
* You can subscribe to `ON_SESSION_STORE_AVAILABLE` event to get notified when the `HMSSessionStore`
|
|
1090
|
-
* is available and use `get` or `addKeyChangeListener` method on `HMSSessionStore` instance
|
|
1091
|
-
* checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/}
|
|
1092
|
-
*/
|
|
1093
|
-
getSessionMetaData = async () => {
|
|
1094
|
-
logger?.verbose('#Function getSessionMetaData', {
|
|
1095
|
-
id: this.id,
|
|
1096
|
-
});
|
|
1097
|
-
return await HMSManager.getSessionMetaData({ id: this.id });
|
|
1098
|
-
};
|
|
1099
|
-
|
|
1100
1080
|
getRemoteVideoTrackFromTrackId = async (trackId: string) => {
|
|
1101
1081
|
logger?.verbose('#Function getRemoteVideoTrackFromTrackId', {
|
|
1102
1082
|
id: this.id,
|
|
@@ -1125,6 +1105,25 @@ export class HMSSDK {
|
|
|
1125
1105
|
return HMSEncoder.encodeHmsRemoteAudioTrack(remoteAudioTrackData, this.id);
|
|
1126
1106
|
};
|
|
1127
1107
|
|
|
1108
|
+
getPeerFromPeerId = (peerId: string) => {
|
|
1109
|
+
logger?.verbose('#Function getPeerFromPeerId', {
|
|
1110
|
+
id: this.id,
|
|
1111
|
+
peerId,
|
|
1112
|
+
});
|
|
1113
|
+
// Getting Peer Cache
|
|
1114
|
+
const peersCache = getHmsPeersCache();
|
|
1115
|
+
|
|
1116
|
+
// If Peer Cache doesn't exist, return `undefined` as we don't have Peer
|
|
1117
|
+
if (!peersCache) return;
|
|
1118
|
+
|
|
1119
|
+
const peerRole = peersCache.getProperty(peerId, 'role');
|
|
1120
|
+
|
|
1121
|
+
// If Peer doesn't have valid Role, return `undefined` as we don't have Peer
|
|
1122
|
+
if (!peerRole) return;
|
|
1123
|
+
|
|
1124
|
+
return HMSEncoder.encodeHmsPeer({ peerID: peerId });
|
|
1125
|
+
};
|
|
1126
|
+
|
|
1128
1127
|
/**
|
|
1129
1128
|
* - This is a prototype event listener that takes action and listens for updates related to that particular action
|
|
1130
1129
|
*
|
|
@@ -1145,7 +1144,7 @@ export class HMSSDK {
|
|
|
1145
1144
|
// Checking if we already have ON_PREVIEW subscription
|
|
1146
1145
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_PREVIEW]) {
|
|
1147
1146
|
// Adding ON_PREVIEW native listener
|
|
1148
|
-
const previewSubscription =
|
|
1147
|
+
const previewSubscription = HMSNativeEventListener.addListener(
|
|
1149
1148
|
this.id,
|
|
1150
1149
|
HMSUpdateListenerActions.ON_PREVIEW,
|
|
1151
1150
|
this.onPreviewListener
|
|
@@ -1161,7 +1160,7 @@ export class HMSSDK {
|
|
|
1161
1160
|
// Checking if we already have ON_JOIN subscription
|
|
1162
1161
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_JOIN]) {
|
|
1163
1162
|
// Adding ON_JOIN native listener
|
|
1164
|
-
const joinSubscription =
|
|
1163
|
+
const joinSubscription = HMSNativeEventListener.addListener(
|
|
1165
1164
|
this.id,
|
|
1166
1165
|
HMSUpdateListenerActions.ON_JOIN,
|
|
1167
1166
|
this.onJoinListener
|
|
@@ -1179,7 +1178,7 @@ export class HMSSDK {
|
|
|
1179
1178
|
!this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROOM_UPDATE]
|
|
1180
1179
|
) {
|
|
1181
1180
|
// Adding ON_ROOM_UPDATE native listener
|
|
1182
|
-
const roomSubscription =
|
|
1181
|
+
const roomSubscription = HMSNativeEventListener.addListener(
|
|
1183
1182
|
this.id,
|
|
1184
1183
|
HMSUpdateListenerActions.ON_ROOM_UPDATE,
|
|
1185
1184
|
this.onRoomListener
|
|
@@ -1197,7 +1196,7 @@ export class HMSSDK {
|
|
|
1197
1196
|
!this.emitterSubscriptions[HMSUpdateListenerActions.ON_PEER_UPDATE]
|
|
1198
1197
|
) {
|
|
1199
1198
|
// Adding ON_PEER_UPDATE native listener
|
|
1200
|
-
const peerSubscription =
|
|
1199
|
+
const peerSubscription = HMSNativeEventListener.addListener(
|
|
1201
1200
|
this.id,
|
|
1202
1201
|
HMSUpdateListenerActions.ON_PEER_UPDATE,
|
|
1203
1202
|
this.onPeerListener
|
|
@@ -1215,7 +1214,7 @@ export class HMSSDK {
|
|
|
1215
1214
|
!this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRACK_UPDATE]
|
|
1216
1215
|
) {
|
|
1217
1216
|
// Adding ON_TRACK_UPDATE native listener
|
|
1218
|
-
const trackSubscription =
|
|
1217
|
+
const trackSubscription = HMSNativeEventListener.addListener(
|
|
1219
1218
|
this.id,
|
|
1220
1219
|
HMSUpdateListenerActions.ON_TRACK_UPDATE,
|
|
1221
1220
|
this.onTrackListener
|
|
@@ -1231,7 +1230,7 @@ export class HMSSDK {
|
|
|
1231
1230
|
// Checking if we already have ON_ERROR subscription
|
|
1232
1231
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_ERROR]) {
|
|
1233
1232
|
// Adding ON_ERROR native listener
|
|
1234
|
-
const errorSubscription =
|
|
1233
|
+
const errorSubscription = HMSNativeEventListener.addListener(
|
|
1235
1234
|
this.id,
|
|
1236
1235
|
HMSUpdateListenerActions.ON_ERROR,
|
|
1237
1236
|
this.onErrorListener
|
|
@@ -1247,7 +1246,7 @@ export class HMSSDK {
|
|
|
1247
1246
|
// Checking if we already have ON_MESSAGE subscription
|
|
1248
1247
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_MESSAGE]) {
|
|
1249
1248
|
// Adding ON_MESSAGE native listener
|
|
1250
|
-
const messageSubscription =
|
|
1249
|
+
const messageSubscription = HMSNativeEventListener.addListener(
|
|
1251
1250
|
this.id,
|
|
1252
1251
|
HMSUpdateListenerActions.ON_MESSAGE,
|
|
1253
1252
|
this.onMessageListener
|
|
@@ -1263,7 +1262,7 @@ export class HMSSDK {
|
|
|
1263
1262
|
// Checking if we already have ON_SPEAKER subscription
|
|
1264
1263
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_SPEAKER]) {
|
|
1265
1264
|
// Adding ON_SPEAKER native listener
|
|
1266
|
-
const speakerSubscription =
|
|
1265
|
+
const speakerSubscription = HMSNativeEventListener.addListener(
|
|
1267
1266
|
this.id,
|
|
1268
1267
|
HMSUpdateListenerActions.ON_SPEAKER,
|
|
1269
1268
|
this.onSpeakerListener
|
|
@@ -1279,7 +1278,7 @@ export class HMSSDK {
|
|
|
1279
1278
|
// Checking if we already have RECONNECTING subscription
|
|
1280
1279
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTING]) {
|
|
1281
1280
|
// Adding RECONNECTING native listener
|
|
1282
|
-
const reconnectingSubscription =
|
|
1281
|
+
const reconnectingSubscription = HMSNativeEventListener.addListener(
|
|
1283
1282
|
this.id,
|
|
1284
1283
|
HMSUpdateListenerActions.RECONNECTING,
|
|
1285
1284
|
this.reconnectingListener
|
|
@@ -1295,7 +1294,7 @@ export class HMSSDK {
|
|
|
1295
1294
|
// Checking if we already have RECONNECTED subscription
|
|
1296
1295
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.RECONNECTED]) {
|
|
1297
1296
|
// Adding RECONNECTED native listener
|
|
1298
|
-
const reconnectedSubscription =
|
|
1297
|
+
const reconnectedSubscription = HMSNativeEventListener.addListener(
|
|
1299
1298
|
this.id,
|
|
1300
1299
|
HMSUpdateListenerActions.RECONNECTED,
|
|
1301
1300
|
this.reconnectedListener
|
|
@@ -1315,7 +1314,7 @@ export class HMSSDK {
|
|
|
1315
1314
|
]
|
|
1316
1315
|
) {
|
|
1317
1316
|
// Adding ON_ROLE_CHANGE_REQUEST native listener
|
|
1318
|
-
const roleChangeReqSubscription =
|
|
1317
|
+
const roleChangeReqSubscription = HMSNativeEventListener.addListener(
|
|
1319
1318
|
this.id,
|
|
1320
1319
|
HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST,
|
|
1321
1320
|
this.onRoleChangeRequestListener
|
|
@@ -1336,7 +1335,7 @@ export class HMSSDK {
|
|
|
1336
1335
|
]
|
|
1337
1336
|
) {
|
|
1338
1337
|
// Adding ON_CHANGE_TRACK_STATE_REQUEST native listener
|
|
1339
|
-
const changeTrackReqSubscription =
|
|
1338
|
+
const changeTrackReqSubscription = HMSNativeEventListener.addListener(
|
|
1340
1339
|
this.id,
|
|
1341
1340
|
HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST,
|
|
1342
1341
|
this.onChangeTrackStateRequestListener
|
|
@@ -1357,11 +1356,12 @@ export class HMSSDK {
|
|
|
1357
1356
|
]
|
|
1358
1357
|
) {
|
|
1359
1358
|
// Adding ON_REMOVED_FROM_ROOM native listener
|
|
1360
|
-
const removedFromRoomSubscription =
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1359
|
+
const removedFromRoomSubscription =
|
|
1360
|
+
HMSNativeEventListener.addListener(
|
|
1361
|
+
this.id,
|
|
1362
|
+
HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM,
|
|
1363
|
+
this.onRemovedFromRoomListener
|
|
1364
|
+
);
|
|
1365
1365
|
this.emitterSubscriptions[
|
|
1366
1366
|
HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM
|
|
1367
1367
|
] = removedFromRoomSubscription;
|
|
@@ -1374,7 +1374,7 @@ export class HMSSDK {
|
|
|
1374
1374
|
// Checking if we already have ON_RTC_STATS subscription
|
|
1375
1375
|
if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_RTC_STATS]) {
|
|
1376
1376
|
// Adding ON_RTC_STATS native listener
|
|
1377
|
-
const rtcStatsSubscription =
|
|
1377
|
+
const rtcStatsSubscription = HMSNativeEventListener.addListener(
|
|
1378
1378
|
this.id,
|
|
1379
1379
|
HMSUpdateListenerActions.ON_RTC_STATS,
|
|
1380
1380
|
this.RTCStatsListener
|
|
@@ -1394,7 +1394,7 @@ export class HMSSDK {
|
|
|
1394
1394
|
]
|
|
1395
1395
|
) {
|
|
1396
1396
|
// Adding ON_LOCAL_AUDIO_STATS native listener
|
|
1397
|
-
const lclAudioStatsSubscription =
|
|
1397
|
+
const lclAudioStatsSubscription = HMSNativeEventListener.addListener(
|
|
1398
1398
|
this.id,
|
|
1399
1399
|
HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS,
|
|
1400
1400
|
this.onLocalAudioStatsListener
|
|
@@ -1415,7 +1415,7 @@ export class HMSSDK {
|
|
|
1415
1415
|
]
|
|
1416
1416
|
) {
|
|
1417
1417
|
// Adding ON_LOCAL_VIDEO_STATS native listener
|
|
1418
|
-
const lclVideoStatsSubscription =
|
|
1418
|
+
const lclVideoStatsSubscription = HMSNativeEventListener.addListener(
|
|
1419
1419
|
this.id,
|
|
1420
1420
|
HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS,
|
|
1421
1421
|
this.onLocalVideoStatsListener
|
|
@@ -1436,7 +1436,7 @@ export class HMSSDK {
|
|
|
1436
1436
|
]
|
|
1437
1437
|
) {
|
|
1438
1438
|
// Adding ON_REMOTE_AUDIO_STATS native listener
|
|
1439
|
-
const rmAudioStatsSubscription =
|
|
1439
|
+
const rmAudioStatsSubscription = HMSNativeEventListener.addListener(
|
|
1440
1440
|
this.id,
|
|
1441
1441
|
HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS,
|
|
1442
1442
|
this.onRemoteAudioStatsListener
|
|
@@ -1457,7 +1457,7 @@ export class HMSSDK {
|
|
|
1457
1457
|
]
|
|
1458
1458
|
) {
|
|
1459
1459
|
// Adding ON_REMOTE_VIDEO_STATS native listener
|
|
1460
|
-
const rmVideoStatsSubscription =
|
|
1460
|
+
const rmVideoStatsSubscription = HMSNativeEventListener.addListener(
|
|
1461
1461
|
this.id,
|
|
1462
1462
|
HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS,
|
|
1463
1463
|
this.onRemoteVideoStatsListener
|
|
@@ -1478,7 +1478,7 @@ export class HMSSDK {
|
|
|
1478
1478
|
]
|
|
1479
1479
|
) {
|
|
1480
1480
|
// Adding ON_AUDIO_DEVICE_CHANGED native listener
|
|
1481
|
-
const audDeviceChgSubscription =
|
|
1481
|
+
const audDeviceChgSubscription = HMSNativeEventListener.addListener(
|
|
1482
1482
|
this.id,
|
|
1483
1483
|
HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED,
|
|
1484
1484
|
this.onAudioDeviceChangedListener
|
|
@@ -1499,11 +1499,12 @@ export class HMSSDK {
|
|
|
1499
1499
|
]
|
|
1500
1500
|
) {
|
|
1501
1501
|
// Adding ON_SESSION_STORE_AVAILABLE native listener
|
|
1502
|
-
const sessionStoreAvailableSubscription =
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1502
|
+
const sessionStoreAvailableSubscription =
|
|
1503
|
+
HMSNativeEventListener.addListener(
|
|
1504
|
+
this.id,
|
|
1505
|
+
HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE,
|
|
1506
|
+
this.onSessionStoreAvailableListener
|
|
1507
|
+
);
|
|
1507
1508
|
this.emitterSubscriptions[
|
|
1508
1509
|
HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE
|
|
1509
1510
|
] = sessionStoreAvailableSubscription;
|
|
@@ -1519,7 +1520,7 @@ export class HMSSDK {
|
|
|
1519
1520
|
!this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_ROOM_LEAVE]
|
|
1520
1521
|
) {
|
|
1521
1522
|
// Adding ON_PIP_ROOM_LEAVE native listener
|
|
1522
|
-
const pipRoomLeaveSubscription =
|
|
1523
|
+
const pipRoomLeaveSubscription = HMSNativeEventListener.addListener(
|
|
1523
1524
|
this.id,
|
|
1524
1525
|
HMSPIPListenerActions.ON_PIP_ROOM_LEAVE,
|
|
1525
1526
|
this.onPIPRoomLeaveListener
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DeviceEventEmitter } from 'react-native';
|
|
2
|
+
import type { EmitterSubscription as RNEmitterSubscription } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import HMSManager from './HMSManagerModule';
|
|
5
|
+
|
|
6
6
|
import { HMSConstants } from './HMSConstants';
|
|
7
7
|
import { getLogger } from './HMSLogger';
|
|
8
8
|
import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
|
|
9
9
|
import { EventEmitter } from '../utils';
|
|
10
10
|
import type { EmitterSubscription } from '../utils';
|
|
11
11
|
|
|
12
|
-
const { HMSManager } = NativeModules;
|
|
13
|
-
|
|
14
12
|
type Nullable<T> = T | null | undefined;
|
|
15
13
|
|
|
16
14
|
export type HMSSessionStoreValue = Nullable<string>;
|
|
@@ -148,7 +146,7 @@ export class HMSSessionStore {
|
|
|
148
146
|
// this `uniqueId` will be used to remove 'KeyChangeListener' from native side
|
|
149
147
|
const uniqueId =
|
|
150
148
|
subscriptionsToRemove.length > 0
|
|
151
|
-
? (subscriptionsToRemove[0]
|
|
149
|
+
? (subscriptionsToRemove[0]!.context as { uniqueId: string }).uniqueId
|
|
152
150
|
: null;
|
|
153
151
|
|
|
154
152
|
// Removing required subscriptions from 'eventEmitter'
|
package/src/classes/HMSTrack.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { HMSTrackSource } from './HMSTrackSource';
|
|
1
2
|
import type { HMSTrackType } from './HMSTrackType';
|
|
2
3
|
|
|
3
4
|
export class HMSTrack {
|
|
4
5
|
trackId: string;
|
|
5
|
-
source?:
|
|
6
|
+
source?: HMSTrackSource;
|
|
6
7
|
trackDescription?: string;
|
|
7
8
|
mute?: boolean;
|
|
8
9
|
id: string;
|
|
@@ -14,7 +15,7 @@ export class HMSTrack {
|
|
|
14
15
|
|
|
15
16
|
constructor(params: {
|
|
16
17
|
trackId: string;
|
|
17
|
-
source?:
|
|
18
|
+
source?: HMSTrackSource;
|
|
18
19
|
trackDescription?: string;
|
|
19
20
|
isMute?: boolean;
|
|
20
21
|
id: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { HMSTrack } from './HMSTrack';
|
|
2
|
+
import type { HMSTrackSource } from './HMSTrackSource';
|
|
2
3
|
import type { HMSTrackType } from './HMSTrackType';
|
|
3
4
|
|
|
4
5
|
export class HMSVideoTrack extends HMSTrack {
|
|
@@ -6,7 +7,7 @@ export class HMSVideoTrack extends HMSTrack {
|
|
|
6
7
|
|
|
7
8
|
constructor(params: {
|
|
8
9
|
trackId: string;
|
|
9
|
-
source?:
|
|
10
|
+
source?: HMSTrackSource;
|
|
10
11
|
trackDescription?: string;
|
|
11
12
|
isMute?: boolean;
|
|
12
13
|
id: string;
|
package/src/classes/HmsView.tsx
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
requireNativeComponent,
|
|
5
5
|
StyleSheet,
|
|
6
6
|
UIManager,
|
|
7
|
-
ViewStyle,
|
|
8
7
|
Platform,
|
|
9
8
|
} from 'react-native';
|
|
9
|
+
import type { ViewStyle } from 'react-native';
|
|
10
10
|
import { HMSConstants } from './HMSConstants';
|
|
11
11
|
import { HMSVideoViewMode } from './HMSVideoViewMode';
|
|
12
12
|
|
|
@@ -89,6 +89,12 @@ export const HmsViewComponent = React.forwardRef<any, HmsComponentProps>(
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
const capture = async () => {
|
|
92
|
+
const viewManagerConfig = UIManager.getViewManagerConfig('HMSView');
|
|
93
|
+
|
|
94
|
+
if (!viewManagerConfig.Commands.capture) {
|
|
95
|
+
return Promise.reject('Capture command not available on HMSView');
|
|
96
|
+
}
|
|
97
|
+
|
|
92
98
|
let requestId = _nextRequestId++;
|
|
93
99
|
let requestMap = _requestMap;
|
|
94
100
|
|
|
@@ -97,7 +103,7 @@ export const HmsViewComponent = React.forwardRef<any, HmsComponentProps>(
|
|
|
97
103
|
let promise = new Promise(function (resolve, reject) {
|
|
98
104
|
requestMap.set(requestId, { resolve, reject });
|
|
99
105
|
});
|
|
100
|
-
|
|
106
|
+
|
|
101
107
|
UIManager.dispatchViewManagerCommand(
|
|
102
108
|
findNodeHandle(hmsViewRef.current),
|
|
103
109
|
viewManagerConfig.Commands.capture,
|