@100mslive/react-native-hms 1.4.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +3 -2
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +189 -55
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +1 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +94 -38
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +446 -107
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +5 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +42 -25
- package/android/src/main/res/layout/hms_view.xml +2 -2
- package/ios/HMSConstants.swift +33 -0
- package/ios/HMSDecoder.swift +372 -157
- package/ios/HMSHelper.swift +44 -7
- package/ios/HMSManager.m +17 -2
- package/ios/HMSManager.swift +177 -75
- package/ios/HMSRNSDK.swift +641 -199
- package/ios/HMSView.m +1 -0
- package/ios/HMSView.swift +21 -19
- package/lib/commonjs/classes/HMSAudioTrackSettings.js +14 -0
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSCameraControl.js +28 -0
- package/lib/commonjs/classes/HMSCameraControl.js.map +1 -0
- package/lib/commonjs/classes/HMSEncoder.js +97 -14
- package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
- package/lib/commonjs/classes/HMSIOSAudioMode.js +13 -0
- package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -0
- package/lib/commonjs/classes/HMSLayer.js +14 -0
- package/lib/commonjs/classes/HMSLayer.js.map +1 -0
- package/lib/commonjs/classes/HMSLocalVideoStats.js +11 -0
- package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +1 -1
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPublishSettings.js +2 -0
- package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSQualityLimitationReason.js +16 -0
- package/lib/commonjs/classes/HMSQualityLimitationReason.js.map +1 -0
- package/lib/commonjs/classes/HMSQualityLimitationReasons.js +27 -0
- package/lib/commonjs/classes/HMSQualityLimitationReasons.js.map +1 -0
- package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js +39 -3
- package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSRoom.js +4 -0
- package/lib/commonjs/classes/HMSRoom.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomUpdate.js +1 -0
- package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +82 -45
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSSessionStore.js +173 -0
- package/lib/commonjs/classes/HMSSessionStore.js.map +1 -0
- package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js +19 -0
- package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js.map +1 -0
- package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js +23 -0
- package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -0
- package/lib/commonjs/classes/HMSSimulcastSettings.js +5 -4
- package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js +17 -0
- package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js.map +1 -0
- package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js +21 -0
- package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js.map +1 -0
- package/lib/commonjs/classes/HMSSubscribeSettings.js +2 -0
- package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +8 -0
- package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
- package/lib/commonjs/classes/HMSVideoTrackSettings.js +5 -0
- package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +2 -0
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/index.js +72 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/emitter/EventEmitter.js +162 -0
- package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -0
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js +46 -0
- package/lib/commonjs/utils/emitter/_EmitterSubscription.js.map +1 -0
- package/lib/commonjs/utils/emitter/_EventSubscription.js +36 -0
- package/lib/commonjs/utils/emitter/_EventSubscription.js.map +1 -0
- package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js +90 -0
- package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js.map +1 -0
- package/lib/commonjs/utils/index.js +17 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/classes/HMSAudioTrackSettings.js +14 -0
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSCameraControl.js +21 -0
- package/lib/module/classes/HMSCameraControl.js.map +1 -0
- package/lib/module/classes/HMSEncoder.js +97 -14
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSIOSAudioMode.js +6 -0
- package/lib/module/classes/HMSIOSAudioMode.js.map +1 -0
- package/lib/module/classes/HMSLayer.js +7 -0
- package/lib/module/classes/HMSLayer.js.map +1 -0
- package/lib/module/classes/HMSLocalVideoStats.js +11 -0
- package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +1 -1
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPublishSettings.js +2 -0
- package/lib/module/classes/HMSPublishSettings.js.map +1 -1
- package/lib/module/classes/HMSQualityLimitationReason.js +9 -0
- package/lib/module/classes/HMSQualityLimitationReason.js.map +1 -0
- package/lib/module/classes/HMSQualityLimitationReasons.js +20 -0
- package/lib/module/classes/HMSQualityLimitationReasons.js.map +1 -0
- package/lib/module/classes/HMSRemotePeer.js.map +1 -1
- package/lib/module/classes/HMSRemoteVideoTrack.js +39 -3
- package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSRoom.js +4 -0
- package/lib/module/classes/HMSRoom.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/HMSSDK.js +83 -45
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSSessionStore.js +166 -0
- package/lib/module/classes/HMSSessionStore.js.map +1 -0
- package/lib/module/classes/HMSSimulcastLayerDefinition.js +12 -0
- package/lib/module/classes/HMSSimulcastLayerDefinition.js.map +1 -0
- package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js +16 -0
- package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -0
- package/lib/module/classes/HMSSimulcastSettings.js +5 -4
- package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
- package/lib/module/classes/HMSSimulcastSettingsPolicy.js +10 -0
- package/lib/module/classes/HMSSimulcastSettingsPolicy.js.map +1 -0
- package/lib/module/classes/HMSSubscribeDegradationPolicy.js +14 -0
- package/lib/module/classes/HMSSubscribeDegradationPolicy.js.map +1 -0
- package/lib/module/classes/HMSSubscribeSettings.js +2 -0
- package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +8 -0
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/classes/HMSVideoResolution.js.map +1 -1
- package/lib/module/classes/HMSVideoTrackSettings.js +5 -0
- package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
- package/lib/module/classes/HmsView.js +2 -0
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/emitter/EventEmitter.js +151 -0
- package/lib/module/utils/emitter/EventEmitter.js.map +1 -0
- package/lib/module/utils/emitter/_EmitterSubscription.js +39 -0
- package/lib/module/utils/emitter/_EmitterSubscription.js.map +1 -0
- package/lib/module/utils/emitter/_EventSubscription.js +29 -0
- package/lib/module/utils/emitter/_EventSubscription.js.map +1 -0
- package/lib/module/utils/emitter/_EventSubscriptionVendor.js +83 -0
- package/lib/module/utils/emitter/_EventSubscriptionVendor.js.map +1 -0
- package/lib/module/utils/index.js +2 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +14 -0
- package/lib/typescript/classes/HMSCameraControl.d.ts +9 -0
- package/lib/typescript/classes/HMSEncoder.d.ts +13 -1
- package/lib/typescript/classes/HMSIOSAudioMode.d.ts +4 -0
- package/lib/typescript/classes/HMSLayer.d.ts +5 -0
- package/lib/typescript/classes/HMSLocalVideoStats.d.ts +6 -0
- package/lib/typescript/classes/HMSPeer.d.ts +1 -1
- package/lib/typescript/classes/HMSPublishSettings.d.ts +3 -0
- package/lib/typescript/classes/HMSQualityLimitationReason.d.ts +7 -0
- package/lib/typescript/classes/HMSQualityLimitationReasons.d.ts +17 -0
- package/lib/typescript/classes/HMSRemotePeer.d.ts +0 -1
- package/lib/typescript/classes/HMSRemoteVideoTrack.d.ts +6 -2
- package/lib/typescript/classes/HMSRoomUpdate.d.ts +2 -1
- package/lib/typescript/classes/HMSSDK.d.ts +21 -31
- package/lib/typescript/classes/HMSSessionStore.d.ts +63 -0
- package/lib/typescript/classes/HMSSimulcastLayerDefinition.d.ts +10 -0
- package/lib/typescript/classes/HMSSimulcastLayerSettingsPolicy.d.ts +12 -0
- package/lib/typescript/classes/HMSSimulcastSettings.d.ts +7 -3
- package/lib/typescript/classes/HMSSimulcastSettingsPolicy.d.ts +7 -0
- package/lib/typescript/classes/HMSSubscribeDegradationPolicy.d.ts +10 -0
- package/lib/typescript/classes/HMSSubscribeSettings.d.ts +5 -2
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +9 -1
- package/lib/typescript/classes/HMSVideoResolution.d.ts +2 -2
- package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +5 -0
- package/lib/typescript/classes/HmsView.d.ts +2 -2
- package/lib/typescript/index.d.ts +7 -0
- package/lib/typescript/utils/emitter/EventEmitter.d.ts +91 -0
- package/lib/typescript/utils/emitter/_EmitterSubscription.d.ts +29 -0
- package/lib/typescript/utils/emitter/_EventSubscription.d.ts +19 -0
- package/lib/typescript/utils/emitter/_EventSubscriptionVendor.d.ts +44 -0
- package/lib/typescript/utils/index.d.ts +1 -0
- package/package.json +21 -2
- package/sdk-versions.json +3 -3
- package/src/classes/HMSAudioTrackSettings.ts +16 -0
- package/src/classes/HMSCameraControl.ts +21 -0
- package/src/classes/HMSEncoder.ts +126 -11
- package/src/classes/HMSIOSAudioMode.ts +4 -0
- package/src/classes/HMSLayer.ts +5 -0
- package/src/classes/HMSLocalVideoStats.ts +21 -0
- package/src/classes/HMSPeer.ts +1 -1
- package/src/classes/HMSPublishSettings.ts +4 -0
- package/src/classes/HMSQualityLimitationReason.ts +7 -0
- package/src/classes/HMSQualityLimitationReasons.ts +27 -0
- package/src/classes/HMSRemotePeer.ts +0 -1
- package/src/classes/HMSRemoteVideoTrack.ts +52 -4
- package/src/classes/HMSRoom.ts +2 -0
- package/src/classes/HMSRoomUpdate.ts +1 -0
- package/src/classes/HMSSDK.tsx +124 -52
- package/src/classes/HMSSessionStore.ts +209 -0
- package/src/classes/HMSSimulcastLayerDefinition.ts +12 -0
- package/src/classes/HMSSimulcastLayerSettingsPolicy.ts +18 -0
- package/src/classes/HMSSimulcastSettings.ts +12 -3
- package/src/classes/HMSSimulcastSettingsPolicy.ts +9 -0
- package/src/classes/HMSSubscribeDegradationPolicy.ts +15 -0
- package/src/classes/HMSSubscribeSettings.ts +10 -2
- package/src/classes/HMSUpdateListenerActions.ts +8 -0
- package/src/classes/HMSVideoResolution.ts +1 -1
- package/src/classes/HMSVideoTrackSettings.ts +5 -0
- package/src/classes/HmsView.tsx +5 -1
- package/src/index.ts +10 -0
- package/src/utils/emitter/EventEmitter.ts +160 -0
- package/src/utils/emitter/_EmitterSubscription.ts +44 -0
- package/src/utils/emitter/_EventSubscription.ts +28 -0
- package/src/utils/emitter/_EventSubscriptionVendor.ts +89 -0
- package/src/utils/index.ts +1 -0
package/android/build.gradle
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import groovy.json.JsonSlurper
|
|
2
2
|
|
|
3
|
-
def
|
|
3
|
+
def sdkVersions = new JsonSlurper().parse file("../sdk-versions.json")
|
|
4
4
|
|
|
5
5
|
buildscript {
|
|
6
6
|
ext.kotlin_version = '1.5.30-RC'
|
|
@@ -69,7 +69,8 @@ dependencies {
|
|
|
69
69
|
//noinspection GradleDynamicVersion
|
|
70
70
|
implementation "com.facebook.react:react-native:+"
|
|
71
71
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // From node_modules
|
|
72
|
-
implementation "live.100ms:android-sdk:${
|
|
72
|
+
implementation "live.100ms:android-sdk:${sdkVersions["android"]}"
|
|
73
|
+
implementation "live.100ms:video-view:${sdkVersions["android"]}"
|
|
73
74
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'
|
|
74
75
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
|
75
76
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
package com.reactnativehmssdk
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.*
|
|
4
|
+
import live.hms.video.connection.degredation.QualityLimitationReasons
|
|
4
5
|
import live.hms.video.connection.stats.*
|
|
5
6
|
import live.hms.video.connection.stats.quality.HMSNetworkQuality
|
|
6
7
|
import live.hms.video.error.HMSException
|
|
7
|
-
import live.hms.video.media.settings
|
|
8
|
-
import live.hms.video.media.settings.HMSVideoResolution
|
|
9
|
-
import live.hms.video.media.settings.HMSVideoTrackSettings
|
|
8
|
+
import live.hms.video.media.settings.*
|
|
10
9
|
import live.hms.video.media.tracks.*
|
|
11
10
|
import live.hms.video.sdk.models.*
|
|
12
11
|
import live.hms.video.sdk.models.enums.HMSPeerUpdate
|
|
@@ -77,12 +76,14 @@ object HMSDecoder {
|
|
|
77
76
|
val room: WritableMap = Arguments.createMap()
|
|
78
77
|
if (hmsRoom != null) {
|
|
79
78
|
room.putString("id", hmsRoom.roomId)
|
|
80
|
-
|
|
79
|
+
hmsRoom.sessionId?.let {
|
|
80
|
+
room.putString("sessionId", it)
|
|
81
|
+
}
|
|
81
82
|
room.putString("name", hmsRoom.name)
|
|
82
83
|
room.putString("metaData", null)
|
|
83
|
-
hmsRoom.startedAt?.let {
|
|
84
|
-
|
|
85
|
-
}
|
|
84
|
+
// hmsRoom.startedAt?.let {
|
|
85
|
+
// room.putString("startedAt", it.toString())
|
|
86
|
+
// }
|
|
86
87
|
|
|
87
88
|
hmsRoom.browserRecordingState?.let {
|
|
88
89
|
room.putMap(
|
|
@@ -113,7 +114,9 @@ object HMSDecoder {
|
|
|
113
114
|
room.putMap("hlsRecordingState", this.getHMSHlsRecordingState(hmsRoom.hlsRecordingState))
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
|
|
117
|
+
hmsRoom.localPeer?.let {
|
|
118
|
+
room.putMap("localPeer", this.getHmsLocalPeer(it))
|
|
119
|
+
}
|
|
117
120
|
|
|
118
121
|
room.putArray("peers", this.getAllPeers(hmsRoom.peerList))
|
|
119
122
|
|
|
@@ -309,6 +312,10 @@ object HMSDecoder {
|
|
|
309
312
|
publishSettings.putMap("screen", this.getHmsVideoSettings(it))
|
|
310
313
|
}
|
|
311
314
|
|
|
315
|
+
hmsPublishSettings.simulcast?.let {
|
|
316
|
+
publishSettings.putMap("simulcast", this.getHmsSimulcastSettings(it))
|
|
317
|
+
}
|
|
318
|
+
|
|
312
319
|
publishSettings.putArray("allowed", this.getWriteableArray(hmsPublishSettings.allowed))
|
|
313
320
|
}
|
|
314
321
|
return publishSettings
|
|
@@ -345,6 +352,50 @@ object HMSDecoder {
|
|
|
345
352
|
return videoSettings
|
|
346
353
|
}
|
|
347
354
|
|
|
355
|
+
private fun getHmsSimulcastSettings(hmsSimulcastSettings: Simulcast?): WritableMap {
|
|
356
|
+
val simulcastSettings: WritableMap = Arguments.createMap()
|
|
357
|
+
if (hmsSimulcastSettings != null) {
|
|
358
|
+
hmsSimulcastSettings.video?.let {
|
|
359
|
+
simulcastSettings.putMap("video", getHmsVideoSimulcastLayersParams(it))
|
|
360
|
+
}
|
|
361
|
+
hmsSimulcastSettings.screen?.let {
|
|
362
|
+
simulcastSettings.putMap("screen", getHmsVideoSimulcastLayersParams(it))
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return simulcastSettings
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
private fun getHmsVideoSimulcastLayersParams(hmsVideoSimulcastLayersParams: VideoSimulcastLayersParams?): WritableMap {
|
|
369
|
+
val videoSimulcastLayersParams: WritableMap = Arguments.createMap()
|
|
370
|
+
if (hmsVideoSimulcastLayersParams != null) {
|
|
371
|
+
hmsVideoSimulcastLayersParams.layers?.let {
|
|
372
|
+
val layersParams = Arguments.createArray()
|
|
373
|
+
it.forEach { layer -> layersParams.pushMap(getHmsLayerParams(layer)) }
|
|
374
|
+
videoSimulcastLayersParams.putArray("layers", layersParams)
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return videoSimulcastLayersParams
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
private fun getHmsLayerParams(hmsLayerParams: LayerParams?): WritableMap {
|
|
381
|
+
val layerParams: WritableMap = Arguments.createMap()
|
|
382
|
+
if (hmsLayerParams != null) {
|
|
383
|
+
hmsLayerParams.rid?.let {
|
|
384
|
+
layerParams.putString("rid", it)
|
|
385
|
+
}
|
|
386
|
+
hmsLayerParams.maxBitrate?.let {
|
|
387
|
+
layerParams.putInt("maxBitrate", it)
|
|
388
|
+
}
|
|
389
|
+
hmsLayerParams.scaleResolutionDownBy?.let {
|
|
390
|
+
layerParams.putDouble("scaleResolutionDownBy", it.toDouble())
|
|
391
|
+
}
|
|
392
|
+
hmsLayerParams.maxFramerate?.let {
|
|
393
|
+
layerParams.putInt("maxFramerate", it)
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return layerParams
|
|
397
|
+
}
|
|
398
|
+
|
|
348
399
|
fun getHmsLocalPeer(hmsLocalPeer: HMSLocalPeer?): WritableMap {
|
|
349
400
|
val peer: WritableMap = Arguments.createMap()
|
|
350
401
|
if (hmsLocalPeer != null) {
|
|
@@ -412,10 +463,11 @@ object HMSDecoder {
|
|
|
412
463
|
return settings
|
|
413
464
|
}
|
|
414
465
|
|
|
415
|
-
private fun getHmsVideoTrackResolution(hmsResolution: HMSVideoResolution):
|
|
416
|
-
val resolution:
|
|
417
|
-
resolution.
|
|
418
|
-
resolution.
|
|
466
|
+
private fun getHmsVideoTrackResolution(hmsResolution: HMSVideoResolution): WritableArray {
|
|
467
|
+
val resolution: WritableArray = Arguments.createArray() // [width, height]
|
|
468
|
+
resolution.pushInt(hmsResolution.width)
|
|
469
|
+
resolution.pushInt(hmsResolution.height)
|
|
470
|
+
|
|
419
471
|
return resolution
|
|
420
472
|
}
|
|
421
473
|
|
|
@@ -630,6 +682,11 @@ object HMSDecoder {
|
|
|
630
682
|
val subscribeSettings: WritableMap = Arguments.createMap()
|
|
631
683
|
if (hmsSubscribeSettings != null) {
|
|
632
684
|
subscribeSettings.putInt("maxSubsBitRate", hmsSubscribeSettings.maxSubsBitRate)
|
|
685
|
+
|
|
686
|
+
hmsSubscribeSettings.subscribeDegradationParam?.let {
|
|
687
|
+
subscribeSettings.putMap("subscribeDegradation", this.getHmsSubscribeDegradationSettings(it))
|
|
688
|
+
}
|
|
689
|
+
|
|
633
690
|
subscribeSettings.putArray(
|
|
634
691
|
"subscribeTo",
|
|
635
692
|
this.getWriteableArray(hmsSubscribeSettings.subscribeTo)
|
|
@@ -702,26 +759,32 @@ object HMSDecoder {
|
|
|
702
759
|
return hmsNetworkQuality
|
|
703
760
|
}
|
|
704
761
|
|
|
705
|
-
fun getHMSRTCStats(hmsRtcStats: HMSRTCStats?):
|
|
706
|
-
val rtcStats:
|
|
762
|
+
fun getHMSRTCStats(hmsRtcStats: HMSRTCStats?): WritableArray {
|
|
763
|
+
val rtcStats: WritableArray = Arguments.createArray() // [bitrateReceived, bitrateSent, bytesReceived, bytesSent, packetsLost, packetsReceived, roundTripTime]
|
|
707
764
|
if (hmsRtcStats != null) {
|
|
708
|
-
rtcStats.
|
|
709
|
-
rtcStats.
|
|
710
|
-
rtcStats.
|
|
711
|
-
rtcStats.
|
|
712
|
-
rtcStats.
|
|
713
|
-
rtcStats.
|
|
714
|
-
rtcStats.
|
|
765
|
+
rtcStats.pushDouble(hmsRtcStats.bitrateReceived)
|
|
766
|
+
rtcStats.pushDouble(hmsRtcStats.bitrateSent)
|
|
767
|
+
rtcStats.pushString(hmsRtcStats.bytesReceived.toString())
|
|
768
|
+
rtcStats.pushString(hmsRtcStats.bytesSent.toString())
|
|
769
|
+
rtcStats.pushString(hmsRtcStats.packetsLost.toString())
|
|
770
|
+
rtcStats.pushString(hmsRtcStats.packetsReceived.toString())
|
|
771
|
+
rtcStats.pushDouble(hmsRtcStats.roundTripTime)
|
|
715
772
|
}
|
|
716
773
|
return rtcStats
|
|
717
774
|
}
|
|
718
775
|
|
|
719
|
-
fun getLocalAudioStats(hmsLocalAudioStats: HMSLocalAudioStats?):
|
|
720
|
-
val localAudioStats:
|
|
776
|
+
fun getLocalAudioStats(hmsLocalAudioStats: HMSLocalAudioStats?): WritableArray {
|
|
777
|
+
val localAudioStats: WritableArray = Arguments.createArray()
|
|
778
|
+
|
|
721
779
|
if (hmsLocalAudioStats != null) {
|
|
722
|
-
|
|
723
|
-
localAudioStats.
|
|
724
|
-
|
|
780
|
+
val bitrate = hmsLocalAudioStats.bitrate ?: -1.0
|
|
781
|
+
localAudioStats.pushDouble(bitrate)
|
|
782
|
+
|
|
783
|
+
val bytesSent = hmsLocalAudioStats.bytesSent.let { if (it === null) "" else it.toString() }
|
|
784
|
+
localAudioStats.pushString(bytesSent)
|
|
785
|
+
|
|
786
|
+
val roundTripTime = hmsLocalAudioStats.roundTripTime ?: -1.0
|
|
787
|
+
localAudioStats.pushDouble(roundTripTime)
|
|
725
788
|
}
|
|
726
789
|
return localAudioStats
|
|
727
790
|
}
|
|
@@ -730,48 +793,119 @@ object HMSDecoder {
|
|
|
730
793
|
val stats: WritableArray = Arguments.createArray()
|
|
731
794
|
|
|
732
795
|
for (stat in hmsLocalVideoStats) {
|
|
733
|
-
val localVideoStats:
|
|
796
|
+
val localVideoStats: WritableArray = Arguments.createArray() // [bitrate, bytesSent, roundTripTime, frameRate, resolution, layer, qualityLimitationReasons]
|
|
734
797
|
|
|
735
|
-
|
|
736
|
-
localVideoStats.
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
)
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
798
|
+
val bitrate = stat.bitrate ?: -1.0
|
|
799
|
+
localVideoStats.pushDouble(bitrate)
|
|
800
|
+
|
|
801
|
+
val bytesSent = stat.bytesSent.let { if (it === null) "" else it.toString() }
|
|
802
|
+
localVideoStats.pushString(bytesSent)
|
|
803
|
+
|
|
804
|
+
val roundTripTime = stat.roundTripTime ?: -1.0
|
|
805
|
+
localVideoStats.pushDouble(roundTripTime)
|
|
806
|
+
|
|
807
|
+
val frameRate = stat.frameRate ?: -1.0
|
|
808
|
+
localVideoStats.pushDouble(frameRate)
|
|
809
|
+
|
|
810
|
+
stat.resolution.let {
|
|
811
|
+
if (it === null) {
|
|
812
|
+
localVideoStats.pushNull()
|
|
813
|
+
} else {
|
|
814
|
+
localVideoStats.pushArray(getHmsVideoTrackResolution(it)) // [width, height]
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
val layer = stat.hmsLayer.let { if (it === null) HMSLayer.HIGH.name else it.name }
|
|
819
|
+
localVideoStats.pushString(layer)
|
|
820
|
+
|
|
821
|
+
val qualityLimitationReasons = getHmsQualityLimitationReasons(stat.qualityLimitationReason)
|
|
822
|
+
localVideoStats.pushMap(qualityLimitationReasons)
|
|
823
|
+
|
|
824
|
+
stats.pushArray(localVideoStats)
|
|
744
825
|
}
|
|
745
826
|
|
|
746
827
|
return stats
|
|
747
828
|
}
|
|
748
829
|
|
|
749
|
-
fun
|
|
750
|
-
val
|
|
830
|
+
private fun getHmsQualityLimitationReasons(hmsQualityLimitationReasons: QualityLimitationReasons?): WritableMap {
|
|
831
|
+
val qualityLimitationReasons: WritableMap = Arguments.createMap()
|
|
832
|
+
|
|
833
|
+
if (hmsQualityLimitationReasons != null) {
|
|
834
|
+
hmsQualityLimitationReasons.bandWidth?.let { qualityLimitationReasons.putDouble("bandwidth", it) }
|
|
835
|
+
hmsQualityLimitationReasons.cpu?.let { qualityLimitationReasons.putDouble("cpu", it) }
|
|
836
|
+
hmsQualityLimitationReasons.none?.let { qualityLimitationReasons.putDouble("none", it) }
|
|
837
|
+
hmsQualityLimitationReasons.other?.let { qualityLimitationReasons.putDouble("other", it) }
|
|
838
|
+
hmsQualityLimitationReasons.qualityLimitationResolutionChanges?.let { qualityLimitationReasons.putInt("qualityLimitationResolutionChanges", it.toInt()) }
|
|
839
|
+
qualityLimitationReasons.putString("reason", hmsQualityLimitationReasons.reason.name)
|
|
840
|
+
}
|
|
841
|
+
return qualityLimitationReasons
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
fun getRemoteAudioStats(hmsRemoteAudioStats: HMSRemoteAudioStats?): WritableArray {
|
|
845
|
+
val remoteAudioStats: WritableArray = Arguments.createArray()
|
|
846
|
+
|
|
751
847
|
if (hmsRemoteAudioStats != null) {
|
|
752
|
-
|
|
753
|
-
remoteAudioStats.
|
|
754
|
-
|
|
755
|
-
hmsRemoteAudioStats.
|
|
756
|
-
remoteAudioStats.
|
|
848
|
+
val bitrate = hmsRemoteAudioStats.bitrate ?: -1.0
|
|
849
|
+
remoteAudioStats.pushDouble(bitrate)
|
|
850
|
+
|
|
851
|
+
val bytesReceived = hmsRemoteAudioStats.bytesReceived.let { if (it === null) "" else it.toString() }
|
|
852
|
+
remoteAudioStats.pushString(bytesReceived)
|
|
853
|
+
|
|
854
|
+
val jitter = hmsRemoteAudioStats.jitter ?: -1.0
|
|
855
|
+
remoteAudioStats.pushDouble(jitter)
|
|
856
|
+
|
|
857
|
+
val packetsLost = hmsRemoteAudioStats.packetsLost ?: -1
|
|
858
|
+
remoteAudioStats.pushInt(packetsLost)
|
|
859
|
+
|
|
860
|
+
val packetsReceived = hmsRemoteAudioStats.packetsReceived.let { if (it === null) "" else it.toString() }
|
|
861
|
+
remoteAudioStats.pushString(packetsReceived)
|
|
757
862
|
}
|
|
758
863
|
return remoteAudioStats
|
|
759
864
|
}
|
|
760
865
|
|
|
761
|
-
fun getRemoteVideoStats(hmsRemoteVideoStats: HMSRemoteVideoStats?):
|
|
762
|
-
val remoteVideoStats:
|
|
866
|
+
fun getRemoteVideoStats(hmsRemoteVideoStats: HMSRemoteVideoStats?): WritableArray {
|
|
867
|
+
val remoteVideoStats: WritableArray = Arguments.createArray() // [bitrate, bytesReceived, frameRate, jitter, packetsLost, packetsReceived, resolution]
|
|
868
|
+
|
|
763
869
|
if (hmsRemoteVideoStats != null) {
|
|
764
|
-
|
|
765
|
-
remoteVideoStats.
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
hmsRemoteVideoStats.
|
|
870
|
+
val bitrate = hmsRemoteVideoStats.bitrate ?: -1.0
|
|
871
|
+
remoteVideoStats.pushDouble(bitrate)
|
|
872
|
+
|
|
873
|
+
val bytesReceived = hmsRemoteVideoStats.bytesReceived.let { if (it === null) "" else it.toString() }
|
|
874
|
+
remoteVideoStats.pushString(bytesReceived)
|
|
875
|
+
|
|
876
|
+
val frameRate = hmsRemoteVideoStats.frameRate ?: -1.0
|
|
877
|
+
remoteVideoStats.pushDouble(frameRate)
|
|
878
|
+
|
|
879
|
+
val jitter = hmsRemoteVideoStats.jitter ?: -1.0
|
|
880
|
+
remoteVideoStats.pushDouble(jitter)
|
|
881
|
+
|
|
882
|
+
val packetsLost = hmsRemoteVideoStats.packetsLost ?: -1
|
|
883
|
+
remoteVideoStats.pushInt(packetsLost)
|
|
884
|
+
|
|
885
|
+
val packetsReceived = hmsRemoteVideoStats.packetsReceived.let { if (it === null) "" else it.toString() }
|
|
886
|
+
remoteVideoStats.pushString(packetsReceived)
|
|
887
|
+
|
|
888
|
+
hmsRemoteVideoStats.resolution.let {
|
|
889
|
+
if (it === null) {
|
|
890
|
+
remoteVideoStats.pushNull()
|
|
891
|
+
} else {
|
|
892
|
+
remoteVideoStats.pushArray(getHmsVideoTrackResolution(it)) // [width, height]
|
|
893
|
+
}
|
|
894
|
+
}
|
|
774
895
|
}
|
|
775
896
|
return remoteVideoStats
|
|
776
897
|
}
|
|
898
|
+
|
|
899
|
+
private fun getSimulcastLayerDefinition(hmsSimulcastLayerDefinition: HMSSimulcastLayerDefinition): WritableMap {
|
|
900
|
+
val simulcastLayerDefinition: WritableMap = Arguments.createMap()
|
|
901
|
+
simulcastLayerDefinition.putString("layer", hmsSimulcastLayerDefinition.layer.name)
|
|
902
|
+
simulcastLayerDefinition.putArray("resolution", getHmsVideoTrackResolution(hmsSimulcastLayerDefinition.resolution)) // [width, height]
|
|
903
|
+
return simulcastLayerDefinition
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
fun getSimulcastLayerDefinitions(hmsSimulcastLayerDefinitions: List<HMSSimulcastLayerDefinition>): WritableArray {
|
|
907
|
+
val simulcastLayerDefinitions: WritableArray = Arguments.createArray()
|
|
908
|
+
hmsSimulcastLayerDefinitions.forEach { simulcastLayerDefinitions.pushMap(getSimulcastLayerDefinition(it)) }
|
|
909
|
+
return simulcastLayerDefinitions
|
|
910
|
+
}
|
|
777
911
|
}
|
|
@@ -370,20 +370,6 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
370
370
|
callback?.resolve(result)
|
|
371
371
|
}
|
|
372
372
|
|
|
373
|
-
@ReactMethod
|
|
374
|
-
fun enableRTCStats(data: ReadableMap) {
|
|
375
|
-
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
376
|
-
|
|
377
|
-
hms?.enableRTCStats()
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
@ReactMethod
|
|
381
|
-
fun disableRTCStats(data: ReadableMap) {
|
|
382
|
-
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
383
|
-
|
|
384
|
-
hms?.disableRTCStats()
|
|
385
|
-
}
|
|
386
|
-
|
|
387
373
|
@ReactMethod
|
|
388
374
|
fun enableNetworkQualityUpdates(data: ReadableMap) {
|
|
389
375
|
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
@@ -503,7 +489,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
503
489
|
},
|
|
504
490
|
endMeeting = {
|
|
505
491
|
endMeeting()
|
|
506
|
-
}
|
|
492
|
+
},
|
|
507
493
|
)
|
|
508
494
|
} else {
|
|
509
495
|
null
|
|
@@ -570,7 +556,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
570
556
|
pipRemoteActionsList[audioActionIdx] = android.app.RemoteAction(
|
|
571
557
|
android.graphics.drawable.Icon.createWithResource(
|
|
572
558
|
reactApplicationContext,
|
|
573
|
-
if (hmssdk?.getLocalPeer()?.audioTrack?.isMute === true) R.drawable.ic_mic_off_24 else R.drawable.ic_mic_24
|
|
559
|
+
if (hmssdk?.getLocalPeer()?.audioTrack?.isMute === true) R.drawable.ic_mic_off_24 else R.drawable.ic_mic_24,
|
|
574
560
|
),
|
|
575
561
|
PipActionReceiver.PIPActions.localAudio.title,
|
|
576
562
|
PipActionReceiver.PIPActions.localAudio.description,
|
|
@@ -578,8 +564,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
578
564
|
reactApplicationContext,
|
|
579
565
|
PipActionReceiver.PIPActions.localAudio.requestCode,
|
|
580
566
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(PipActionReceiver.PIPActions.localAudio.title, PipActionReceiver.PIPActions.localAudio.requestCode),
|
|
581
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
582
|
-
)
|
|
567
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
568
|
+
),
|
|
583
569
|
)
|
|
584
570
|
}
|
|
585
571
|
}
|
|
@@ -591,7 +577,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
591
577
|
pipRemoteActionsList[videoActionIdx] = android.app.RemoteAction(
|
|
592
578
|
android.graphics.drawable.Icon.createWithResource(
|
|
593
579
|
reactApplicationContext,
|
|
594
|
-
updatedIcon
|
|
580
|
+
updatedIcon,
|
|
595
581
|
),
|
|
596
582
|
PipActionReceiver.PIPActions.localVideo.title,
|
|
597
583
|
PipActionReceiver.PIPActions.localVideo.description,
|
|
@@ -599,8 +585,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
599
585
|
reactApplicationContext,
|
|
600
586
|
PipActionReceiver.PIPActions.localVideo.requestCode,
|
|
601
587
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(PipActionReceiver.PIPActions.localVideo.title, PipActionReceiver.PIPActions.localVideo.requestCode),
|
|
602
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
603
|
-
)
|
|
588
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
589
|
+
),
|
|
604
590
|
)
|
|
605
591
|
}
|
|
606
592
|
}
|
|
@@ -620,7 +606,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
620
606
|
val aspectRatio: Pair<Int, Int>?,
|
|
621
607
|
val showEndButton: Boolean,
|
|
622
608
|
val showVideoButton: Boolean,
|
|
623
|
-
val showAudioButton: Boolean
|
|
609
|
+
val showAudioButton: Boolean,
|
|
624
610
|
)
|
|
625
611
|
|
|
626
612
|
@ReactMethod
|
|
@@ -670,8 +656,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
670
656
|
it.setAspectRatio(
|
|
671
657
|
Rational(
|
|
672
658
|
config.aspectRatio.first,
|
|
673
|
-
config.aspectRatio.second
|
|
674
|
-
)
|
|
659
|
+
config.aspectRatio.second,
|
|
660
|
+
),
|
|
675
661
|
)
|
|
676
662
|
}
|
|
677
663
|
|
|
@@ -693,7 +679,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
693
679
|
android.app.RemoteAction(
|
|
694
680
|
android.graphics.drawable.Icon.createWithResource(
|
|
695
681
|
reactApplicationContext,
|
|
696
|
-
if (localPeer?.audioTrack?.isMute === true) R.drawable.ic_mic_off_24 else R.drawable.ic_mic_24
|
|
682
|
+
if (localPeer?.audioTrack?.isMute === true) R.drawable.ic_mic_off_24 else R.drawable.ic_mic_24,
|
|
697
683
|
),
|
|
698
684
|
PipActionReceiver.PIPActions.localAudio.title,
|
|
699
685
|
PipActionReceiver.PIPActions.localAudio.description,
|
|
@@ -701,9 +687,9 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
701
687
|
reactApplicationContext,
|
|
702
688
|
PipActionReceiver.PIPActions.localAudio.requestCode,
|
|
703
689
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(PipActionReceiver.PIPActions.localAudio.title, PipActionReceiver.PIPActions.localAudio.requestCode),
|
|
704
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
705
|
-
)
|
|
706
|
-
)
|
|
690
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
691
|
+
),
|
|
692
|
+
),
|
|
707
693
|
)
|
|
708
694
|
}
|
|
709
695
|
|
|
@@ -718,11 +704,11 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
718
704
|
PipActionReceiver.PIPActions.endMeet.requestCode,
|
|
719
705
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(
|
|
720
706
|
PipActionReceiver.PIPActions.endMeet.title,
|
|
721
|
-
PipActionReceiver.PIPActions.endMeet.requestCode
|
|
707
|
+
PipActionReceiver.PIPActions.endMeet.requestCode,
|
|
722
708
|
),
|
|
723
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
724
|
-
)
|
|
725
|
-
)
|
|
709
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
710
|
+
),
|
|
711
|
+
),
|
|
726
712
|
)
|
|
727
713
|
}
|
|
728
714
|
|
|
@@ -731,7 +717,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
731
717
|
android.app.RemoteAction(
|
|
732
718
|
android.graphics.drawable.Icon.createWithResource(
|
|
733
719
|
reactApplicationContext,
|
|
734
|
-
if (localPeer?.videoTrack?.isMute === true) R.drawable.ic_camera_toggle_off else R.drawable.ic_camera_toggle_on
|
|
720
|
+
if (localPeer?.videoTrack?.isMute === true) R.drawable.ic_camera_toggle_off else R.drawable.ic_camera_toggle_on,
|
|
735
721
|
),
|
|
736
722
|
PipActionReceiver.PIPActions.localVideo.title,
|
|
737
723
|
PipActionReceiver.PIPActions.localVideo.description,
|
|
@@ -740,11 +726,11 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
740
726
|
PipActionReceiver.PIPActions.localVideo.requestCode,
|
|
741
727
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(
|
|
742
728
|
PipActionReceiver.PIPActions.localVideo.title,
|
|
743
|
-
PipActionReceiver.PIPActions.localVideo.requestCode
|
|
729
|
+
PipActionReceiver.PIPActions.localVideo.requestCode,
|
|
744
730
|
),
|
|
745
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
746
|
-
)
|
|
747
|
-
)
|
|
731
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
732
|
+
),
|
|
733
|
+
),
|
|
748
734
|
)
|
|
749
735
|
}
|
|
750
736
|
|
|
@@ -820,7 +806,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
820
806
|
aspectRatio = aspectRatio,
|
|
821
807
|
showEndButton = showEndButton,
|
|
822
808
|
showAudioButton = showAudioButton,
|
|
823
|
-
showVideoButton = showVideoButton
|
|
809
|
+
showVideoButton = showVideoButton,
|
|
824
810
|
)
|
|
825
811
|
}
|
|
826
812
|
|
|
@@ -884,6 +870,76 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
884
870
|
}
|
|
885
871
|
}
|
|
886
872
|
|
|
873
|
+
@ReactMethod
|
|
874
|
+
fun getRemoteVideoTrackFromTrackId(data: ReadableMap, promise: Promise) {
|
|
875
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
876
|
+
|
|
877
|
+
hms?.getRemoteVideoTrackFromTrackId(data, promise)
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
@ReactMethod
|
|
881
|
+
fun getRemoteAudioTrackFromTrackId(data: ReadableMap, promise: Promise) {
|
|
882
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
883
|
+
|
|
884
|
+
hms?.getRemoteAudioTrackFromTrackId(data, promise)
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
@ReactMethod
|
|
888
|
+
fun getVideoTrackLayer(data: ReadableMap, promise: Promise) {
|
|
889
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
890
|
+
|
|
891
|
+
hms?.getVideoTrackLayer(data, promise)
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
@ReactMethod
|
|
895
|
+
fun getVideoTrackLayerDefinition(data: ReadableMap, promise: Promise) {
|
|
896
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
897
|
+
|
|
898
|
+
hms?.getVideoTrackLayerDefinition(data, promise)
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
@ReactMethod
|
|
902
|
+
fun setVideoTrackLayer(data: ReadableMap, promise: Promise?) {
|
|
903
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
904
|
+
|
|
905
|
+
hms?.setVideoTrackLayer(data, promise)
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
@ReactMethod
|
|
909
|
+
fun captureImageAtMaxSupportedResolution(data: ReadableMap, promise: Promise?) {
|
|
910
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
911
|
+
|
|
912
|
+
hms?.captureImageAtMaxSupportedResolution(data, promise)
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
@ReactMethod
|
|
916
|
+
fun setSessionMetadataForKey(data: ReadableMap, promise: Promise?) {
|
|
917
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
918
|
+
|
|
919
|
+
hms?.setSessionMetadataForKey(data, promise)
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
@ReactMethod
|
|
923
|
+
fun getSessionMetadataForKey(data: ReadableMap, promise: Promise?) {
|
|
924
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
925
|
+
|
|
926
|
+
hms?.getSessionMetadataForKey(data, promise)
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
@ReactMethod
|
|
930
|
+
fun addKeyChangeListener(data: ReadableMap, promise: Promise?) {
|
|
931
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
932
|
+
|
|
933
|
+
hms?.addKeyChangeListener(data, promise)
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
@ReactMethod
|
|
937
|
+
fun removeKeyChangeListener(data: ReadableMap, promise: Promise?) {
|
|
938
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
939
|
+
|
|
940
|
+
hms?.removeKeyChangeListener(data, promise)
|
|
941
|
+
}
|
|
942
|
+
|
|
887
943
|
fun emitEvent(event: String, data: WritableMap) {
|
|
888
944
|
reactApplicationContext
|
|
889
945
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|