@100mslive/react-native-hms 1.7.2 → 1.9.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 -3
- package/android/local.properties +8 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +1 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +43 -15
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +113 -68
- package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +17 -4
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +75 -21
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +483 -184
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +587 -177
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +26 -7
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +32 -12
- package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +1 -0
- package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +10 -6
- package/android/src/main/res/layout/player_view.xml +3 -2
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSDecoder.swift +18 -7
- package/ios/HMSHLSPlayerManager.swift +18 -2
- package/ios/HMSHelper.swift +33 -4
- package/ios/HMSManager.m +256 -73
- package/ios/HMSManager.swift +47 -3
- package/ios/HMSRNSDK.swift +224 -140
- package/ios/HMSView.swift +17 -3
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/classes/HMSAudioCodec.js +1 -2
- package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioDevice.js +1 -2
- package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioMixingMode.js +1 -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/HMSCameraFacing.js +1 -2
- package/lib/commonjs/classes/HMSCameraFacing.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 +6 -0
- 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/HMSIOSAudioMode.js +1 -2
- package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
- package/lib/commonjs/classes/HMSLayer.js +1 -2
- package/lib/commonjs/classes/HMSLayer.js.map +1 -1
- package/lib/commonjs/classes/HMSLogAlarmManager.js +1 -2
- package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
- package/lib/commonjs/classes/HMSLogLevel.js +1 -2
- package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
- package/lib/commonjs/classes/HMSLogger.js +1 -2
- package/lib/commonjs/classes/HMSLogger.js.map +1 -1
- package/lib/commonjs/classes/HMSManagerModule.js +1 -2
- package/lib/commonjs/classes/HMSManagerModule.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/HMSNativeEventListener.js +1 -2
- package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -1
- package/lib/commonjs/classes/HMSPIPListenerActions.js +2 -2
- package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js +15 -0
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeerListIterator.js +64 -0
- package/lib/commonjs/classes/HMSPeerListIterator.js.map +1 -0
- package/lib/commonjs/classes/HMSPeerListIteratorOptions.js +2 -0
- package/lib/commonjs/classes/HMSPeerListIteratorOptions.js.map +1 -0
- package/lib/commonjs/classes/HMSPeerUpdate.js +3 -4
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js +8 -2
- package/lib/commonjs/classes/HMSPeersCache.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/HMSRoomCache.js +1 -2
- package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
- package/lib/commonjs/classes/HMSRoomUpdate.js +1 -2
- package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +192 -32
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js +1 -2
- package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackSource.js +1 -2
- package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
- package/lib/commonjs/classes/HMSTrackType.js +1 -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 +2 -2
- 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/HMSVideoViewMode.js +1 -2
- package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
- package/lib/commonjs/classes/HmsView.js +3 -4
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +13 -9
- package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +2 -4
- package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js +5 -10
- package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
- package/lib/commonjs/hooks/useHMSPeerUpdates.js +2 -2
- package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -1
- package/lib/commonjs/index.js +1 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/stores/hls-player-stats-store.js +1 -2
- package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -1
- package/lib/commonjs/stores/hms-store.js +1 -2
- package/lib/commonjs/stores/hms-store.js.map +1 -1
- package/lib/commonjs/types.js +4 -6
- package/lib/commonjs/types.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +6 -0
- package/lib/module/classes/HMSEncoder.js.map +1 -1
- package/lib/module/classes/HMSPIPListenerActions.js +1 -0
- package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
- package/lib/module/classes/HMSPeer.js +15 -0
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeerListIterator.js +58 -0
- package/lib/module/classes/HMSPeerListIterator.js.map +1 -0
- package/lib/module/classes/HMSPeerListIteratorOptions.js +2 -0
- package/lib/module/classes/HMSPeerListIteratorOptions.js.map +1 -0
- package/lib/module/classes/HMSPeerUpdate.js +2 -1
- package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/module/classes/HMSPeersCache.js +7 -0
- package/lib/module/classes/HMSPeersCache.js.map +1 -1
- package/lib/module/classes/HMSSDK.js +193 -33
- package/lib/module/classes/HMSSDK.js.map +1 -1
- package/lib/module/classes/HMSUpdateListenerActions.js +1 -0
- package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +11 -6
- package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.js +1 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/classes/HMSEncoder.d.ts +1 -0
- package/lib/typescript/classes/HMSPIPListenerActions.d.ts +1 -0
- package/lib/typescript/classes/HMSPeer.d.ts +3 -0
- package/lib/typescript/classes/HMSPeerListIterator.d.ts +9 -0
- package/lib/typescript/classes/HMSPeerListIteratorOptions.d.ts +24 -0
- package/lib/typescript/classes/HMSPeerUpdate.d.ts +2 -1
- package/lib/typescript/classes/HMSPeersCache.d.ts +1 -0
- package/lib/typescript/classes/HMSSDK.d.ts +69 -13
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +2 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/types.d.ts +3 -1
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSEncoder.ts +9 -0
- package/src/classes/HMSPIPListenerActions.ts +1 -0
- package/src/classes/HMSPeer.ts +25 -0
- package/src/classes/HMSPeerListIterator.ts +60 -0
- package/src/classes/HMSPeerListIteratorOptions.ts +26 -0
- package/src/classes/HMSPeerUpdate.ts +2 -0
- package/src/classes/HMSPeersCache.ts +7 -0
- package/src/classes/HMSSDK.tsx +235 -28
- package/src/classes/HMSUpdateListenerActions.ts +1 -0
- package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +15 -13
- package/src/index.ts +4 -1
- package/src/types.ts +2 -0
- package/android/.gradle/6.7.1/executionHistory/executionHistory.bin +0 -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.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/gc.properties +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/build.gradle
CHANGED
|
@@ -86,7 +86,7 @@ dependencies {
|
|
|
86
86
|
implementation "androidx.constraintlayout:constraintlayout:2.1.3"
|
|
87
87
|
implementation "androidx.appcompat:appcompat:1.3.1"
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
implementation "live.100ms:android-sdk:${sdkVersions["android"]}"
|
|
90
|
+
implementation "live.100ms:video-view:${sdkVersions["android"]}"
|
|
91
|
+
implementation "live.100ms:hls-player:${sdkVersions["android"]}"
|
|
92
92
|
}
|
package/android/local.properties
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
## This file must *NOT* be checked into Version Control Systems,
|
|
2
|
+
# as it contains information specific to your local configuration.
|
|
3
|
+
#
|
|
4
|
+
# Location of the SDK. This is only used by Gradle.
|
|
5
|
+
# For customization when using a Version Control System, please read the
|
|
6
|
+
# header note.
|
|
7
|
+
#Mon Nov 14 20:51:00 IST 2022
|
|
8
|
+
sdk.dir=/Users/jatinnagar/Library/Android/sdk
|
|
@@ -25,6 +25,7 @@ class HMSAudioshareActivity : ComponentActivity() {
|
|
|
25
25
|
HMSManager.hmsCollection[id]?.audioshareCallback?.reject(error)
|
|
26
26
|
HMSManager.hmsCollection[id]?.emitHMSError(error)
|
|
27
27
|
}
|
|
28
|
+
|
|
28
29
|
override fun onSuccess() {
|
|
29
30
|
HMSManager.hmsCollection[id]?.isAudioSharing = true
|
|
30
31
|
HMSManager.hmsCollection[id]?.audioshareCallback?.resolve(
|
|
@@ -16,7 +16,10 @@ import live.hms.video.sdk.models.trackchangerequest.HMSChangeTrackStateRequest
|
|
|
16
16
|
object HMSDecoder {
|
|
17
17
|
private var restrictRoleData = mutableMapOf<String, Boolean>()
|
|
18
18
|
|
|
19
|
-
fun setRestrictRoleData(
|
|
19
|
+
fun setRestrictRoleData(
|
|
20
|
+
roleName: String,
|
|
21
|
+
value: Boolean,
|
|
22
|
+
) {
|
|
20
23
|
this.restrictRoleData[roleName] = value
|
|
21
24
|
}
|
|
22
25
|
|
|
@@ -24,7 +27,10 @@ object HMSDecoder {
|
|
|
24
27
|
this.restrictRoleData.clear()
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
fun getHmsRoomSubset(
|
|
30
|
+
fun getHmsRoomSubset(
|
|
31
|
+
hmsRoom: HMSRoom?,
|
|
32
|
+
hmsRoomUpdateType: HMSRoomUpdate? = null,
|
|
33
|
+
): WritableMap {
|
|
28
34
|
val room: WritableMap = Arguments.createMap()
|
|
29
35
|
if (hmsRoom != null) {
|
|
30
36
|
room.putString("id", hmsRoom.roomId)
|
|
@@ -142,7 +148,10 @@ object HMSDecoder {
|
|
|
142
148
|
return room
|
|
143
149
|
}
|
|
144
150
|
|
|
145
|
-
fun getHmsPeerSubsetForPeerUpdateEvent(
|
|
151
|
+
fun getHmsPeerSubsetForPeerUpdateEvent(
|
|
152
|
+
hmsPeer: HMSPeer?,
|
|
153
|
+
peerUpdateType: HMSPeerUpdate,
|
|
154
|
+
): WritableMap {
|
|
146
155
|
val peer: WritableMap = Arguments.createMap()
|
|
147
156
|
if (hmsPeer != null) {
|
|
148
157
|
peer.putString(peerUpdateType.ordinal.toString(), hmsPeer.peerID)
|
|
@@ -163,6 +172,9 @@ object HMSDecoder {
|
|
|
163
172
|
HMSPeerUpdate.NAME_CHANGED -> {
|
|
164
173
|
print("$peerUpdateType received")
|
|
165
174
|
}
|
|
175
|
+
HMSPeerUpdate.HAND_RAISED_CHANGED -> {
|
|
176
|
+
peer.putBoolean("isHandRaised", hmsPeer.isHandRaised)
|
|
177
|
+
}
|
|
166
178
|
else -> {
|
|
167
179
|
print("Unhandled Peer Update Type received: $peerUpdateType")
|
|
168
180
|
}
|
|
@@ -171,7 +183,10 @@ object HMSDecoder {
|
|
|
171
183
|
return peer
|
|
172
184
|
}
|
|
173
185
|
|
|
174
|
-
fun getHmsPeerSubset(
|
|
186
|
+
fun getHmsPeerSubset(
|
|
187
|
+
hmsPeer: HMSPeer?,
|
|
188
|
+
peerUpdateType: HMSPeerUpdate? = null,
|
|
189
|
+
): WritableMap {
|
|
175
190
|
val peer: WritableMap = Arguments.createMap()
|
|
176
191
|
if (hmsPeer != null) {
|
|
177
192
|
peer.putString("peerID", hmsPeer.peerID)
|
|
@@ -193,6 +208,9 @@ object HMSDecoder {
|
|
|
193
208
|
HMSPeerUpdate.NAME_CHANGED -> {
|
|
194
209
|
print("$peerUpdateType received")
|
|
195
210
|
}
|
|
211
|
+
HMSPeerUpdate.HAND_RAISED_CHANGED -> {
|
|
212
|
+
peer.putBoolean("isHandRaised", hmsPeer.isHandRaised)
|
|
213
|
+
}
|
|
196
214
|
else -> {
|
|
197
215
|
print("Unhandled Peer Update Type received: $peerUpdateType")
|
|
198
216
|
}
|
|
@@ -219,6 +237,8 @@ object HMSDecoder {
|
|
|
219
237
|
|
|
220
238
|
peer.putMap("role", this.getHmsRole(hmsPeer.hmsRole))
|
|
221
239
|
|
|
240
|
+
peer.putBoolean("isHandRaised", hmsPeer.isHandRaised)
|
|
241
|
+
|
|
222
242
|
hmsPeer.networkQuality?.let {
|
|
223
243
|
peer.putMap("networkQuality", this.getHmsNetworkQuality(it))
|
|
224
244
|
}
|
|
@@ -467,10 +487,12 @@ object HMSDecoder {
|
|
|
467
487
|
private fun getHmsAudioTrackSettings(hmsAudioTrackSettings: HMSAudioTrackSettings?): WritableMap {
|
|
468
488
|
val settings: WritableMap = Arguments.createMap()
|
|
469
489
|
if (hmsAudioTrackSettings != null) {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
490
|
+
hmsAudioTrackSettings.useHardwareAcousticEchoCanceler?.let {
|
|
491
|
+
settings.putBoolean(
|
|
492
|
+
"useHardwareAcousticEchoCanceler",
|
|
493
|
+
it,
|
|
494
|
+
)
|
|
495
|
+
}
|
|
474
496
|
settings.putString("initialState", hmsAudioTrackSettings.initialState.name)
|
|
475
497
|
}
|
|
476
498
|
return settings
|
|
@@ -564,7 +586,10 @@ object HMSDecoder {
|
|
|
564
586
|
return hmsTracks
|
|
565
587
|
}
|
|
566
588
|
|
|
567
|
-
fun getHmsRoleChangeRequest(
|
|
589
|
+
fun getHmsRoleChangeRequest(
|
|
590
|
+
request: HMSRoleChangeRequest,
|
|
591
|
+
id: String?,
|
|
592
|
+
): WritableMap {
|
|
568
593
|
val roleChangeRequest: WritableMap = Arguments.createMap()
|
|
569
594
|
if (id != null) {
|
|
570
595
|
request.requestedBy?.let {
|
|
@@ -577,7 +602,10 @@ object HMSDecoder {
|
|
|
577
602
|
return roleChangeRequest
|
|
578
603
|
}
|
|
579
604
|
|
|
580
|
-
fun getHmsChangeTrackStateRequest(
|
|
605
|
+
fun getHmsChangeTrackStateRequest(
|
|
606
|
+
request: HMSChangeTrackStateRequest,
|
|
607
|
+
id: String,
|
|
608
|
+
): WritableMap {
|
|
581
609
|
val changeTrackStateRequest: WritableMap = Arguments.createMap()
|
|
582
610
|
|
|
583
611
|
request.requestedBy?.let {
|
|
@@ -607,7 +635,7 @@ object HMSDecoder {
|
|
|
607
635
|
fun getHMSBrowserRecordingState(data: HMSBrowserRecordingState?): ReadableMap {
|
|
608
636
|
val input = Arguments.createMap()
|
|
609
637
|
if (data !== null) {
|
|
610
|
-
input.putBoolean("initialising",
|
|
638
|
+
input.putBoolean("initialising", data.initialising)
|
|
611
639
|
|
|
612
640
|
input.putBoolean("running", data.running)
|
|
613
641
|
|
|
@@ -722,9 +750,7 @@ object HMSDecoder {
|
|
|
722
750
|
return subscribeSettings
|
|
723
751
|
}
|
|
724
752
|
|
|
725
|
-
private fun getHmsSubscribeDegradationSettings(
|
|
726
|
-
hmsSubscribeDegradationParams: SubscribeDegradationParams?,
|
|
727
|
-
): WritableMap {
|
|
753
|
+
private fun getHmsSubscribeDegradationSettings(hmsSubscribeDegradationParams: SubscribeDegradationParams?): WritableMap {
|
|
728
754
|
val subscribeDegradationParams: WritableMap = Arguments.createMap()
|
|
729
755
|
if (hmsSubscribeDegradationParams != null) {
|
|
730
756
|
subscribeDegradationParams.putString(
|
|
@@ -862,7 +888,9 @@ object HMSDecoder {
|
|
|
862
888
|
hmsQualityLimitationReasons.cpu?.let { qualityLimitationReasons.putDouble("cpu", it) }
|
|
863
889
|
hmsQualityLimitationReasons.none?.let { qualityLimitationReasons.putDouble("none", it) }
|
|
864
890
|
hmsQualityLimitationReasons.other?.let { qualityLimitationReasons.putDouble("other", it) }
|
|
865
|
-
hmsQualityLimitationReasons.qualityLimitationResolutionChanges?.let {
|
|
891
|
+
hmsQualityLimitationReasons.qualityLimitationResolutionChanges?.let {
|
|
892
|
+
qualityLimitationReasons.putInt("qualityLimitationResolutionChanges", it.toInt())
|
|
893
|
+
}
|
|
866
894
|
qualityLimitationReasons.putString("reason", hmsQualityLimitationReasons.reason.name)
|
|
867
895
|
}
|
|
868
896
|
return qualityLimitationReasons
|
|
@@ -4,6 +4,10 @@ import android.annotation.SuppressLint
|
|
|
4
4
|
import android.content.Context
|
|
5
5
|
import android.view.LayoutInflater
|
|
6
6
|
import android.widget.FrameLayout
|
|
7
|
+
import androidx.media3.common.Player
|
|
8
|
+
import androidx.media3.common.VideoSize
|
|
9
|
+
import androidx.media3.ui.AspectRatioFrameLayout.RESIZE_MODE_FIT
|
|
10
|
+
import androidx.media3.ui.AspectRatioFrameLayout.RESIZE_MODE_ZOOM
|
|
7
11
|
import androidx.media3.ui.PlayerView
|
|
8
12
|
import com.facebook.react.bridge.Arguments
|
|
9
13
|
import com.facebook.react.bridge.ReactContext
|
|
@@ -22,83 +26,85 @@ class HMSHLSPlayer(context: ReactContext) : FrameLayout(context) {
|
|
|
22
26
|
private var hmsHlsPlayer: HmsHlsPlayer? = null // 100ms HLS Player
|
|
23
27
|
private var hmssdkInstance: HMSSDK? = null
|
|
24
28
|
private var statsMonitorAttached = false
|
|
25
|
-
private val hmsHlsPlaybackEventsObject =
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
private val hmsHlsPlaybackEventsObject =
|
|
30
|
+
object : HmsHlsPlaybackEvents {
|
|
31
|
+
override fun onCue(cue: HmsHlsCue) {
|
|
32
|
+
super.onCue(cue)
|
|
33
|
+
|
|
34
|
+
val data = Arguments.createMap()
|
|
35
|
+
cue.endDate?.let { data.putString("endDate", it.time.toString()) }
|
|
36
|
+
cue.id?.let { data.putString("id", it) }
|
|
37
|
+
cue.payloadval?.let { data.putString("payloadval", it) }
|
|
38
|
+
data.putString("startDate", cue.startDate.time.toString())
|
|
39
|
+
|
|
40
|
+
sendHLSPlaybackEventToJS(HMSHLSPlayerConstants.ON_PLAYBACK_CUE_EVENT, data)
|
|
41
|
+
}
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
cue.id?.let { data.putString("id", it) }
|
|
32
|
-
cue.payloadval?.let { data.putString("payloadval", it) }
|
|
33
|
-
data.putString("startDate", cue.startDate.time.toString())
|
|
43
|
+
override fun onPlaybackFailure(error: HmsHlsException) {
|
|
44
|
+
super.onPlaybackFailure(error)
|
|
34
45
|
|
|
35
|
-
|
|
36
|
-
}
|
|
46
|
+
val data = Arguments.createMap()
|
|
37
47
|
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
// error
|
|
49
|
+
val errorData = Arguments.createMap()
|
|
50
|
+
errorData.putInt("errorCode", error.error.errorCode)
|
|
51
|
+
errorData.putString("errorCodeName", error.error.errorCodeName)
|
|
52
|
+
error.error.message?.let {
|
|
53
|
+
errorData.putString("message", it)
|
|
54
|
+
}
|
|
40
55
|
|
|
41
|
-
|
|
56
|
+
data.putMap("error", errorData)
|
|
42
57
|
|
|
43
|
-
|
|
44
|
-
val errorData = Arguments.createMap()
|
|
45
|
-
errorData.putInt("errorCode", error.error.errorCode)
|
|
46
|
-
errorData.putString("errorCodeName", error.error.errorCodeName)
|
|
47
|
-
error.error.message?.let {
|
|
48
|
-
errorData.putString("message", it)
|
|
58
|
+
sendHLSPlaybackEventToJS(HMSHLSPlayerConstants.ON_PLAYBACK_FAILURE_EVENT, data)
|
|
49
59
|
}
|
|
50
60
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
sendHLSPlaybackEventToJS(HMSHLSPlayerConstants.ON_PLAYBACK_FAILURE_EVENT, data)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
override fun onPlaybackStateChanged(state: HmsHlsPlaybackState) {
|
|
57
|
-
super.onPlaybackStateChanged(state)
|
|
58
|
-
|
|
59
|
-
val data = Arguments.createMap()
|
|
60
|
-
data.putString("state", state.name)
|
|
61
|
-
sendHLSPlaybackEventToJS(HMSHLSPlayerConstants.ON_PLAYBACK_STATE_CHANGE_EVENT, data)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
private val hmsHlsPlayerStatsListenerObject = object : PlayerStatsListener {
|
|
65
|
-
override fun onError(error: HMSException) {
|
|
66
|
-
val data = Arguments.createMap()
|
|
67
|
-
|
|
68
|
-
data.putString("action", error.action)
|
|
69
|
-
data.putInt("code", error.code)
|
|
70
|
-
data.putString("description", error.description)
|
|
71
|
-
data.putBoolean("isTerminal", error.isTerminal)
|
|
72
|
-
data.putString("message", error.message)
|
|
73
|
-
data.putString("name", error.name)
|
|
61
|
+
override fun onPlaybackStateChanged(state: HmsHlsPlaybackState) {
|
|
62
|
+
super.onPlaybackStateChanged(state)
|
|
74
63
|
|
|
75
|
-
|
|
64
|
+
val data = Arguments.createMap()
|
|
65
|
+
data.putString("state", state.name)
|
|
66
|
+
sendHLSPlaybackEventToJS(HMSHLSPlayerConstants.ON_PLAYBACK_STATE_CHANGE_EVENT, data)
|
|
67
|
+
}
|
|
76
68
|
}
|
|
69
|
+
private val hmsHlsPlayerStatsListenerObject =
|
|
70
|
+
object : PlayerStatsListener {
|
|
71
|
+
override fun onError(error: HMSException) {
|
|
72
|
+
val data = Arguments.createMap()
|
|
73
|
+
|
|
74
|
+
data.putString("action", error.action)
|
|
75
|
+
data.putInt("code", error.code)
|
|
76
|
+
data.putString("description", error.description)
|
|
77
|
+
data.putBoolean("isTerminal", error.isTerminal)
|
|
78
|
+
data.putString("message", error.message)
|
|
79
|
+
data.putString("name", error.name)
|
|
80
|
+
|
|
81
|
+
sendHLSStatsEventToJS(HMSHLSPlayerConstants.ON_STATS_EVENT_ERROR, data)
|
|
82
|
+
}
|
|
77
83
|
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
override fun onEventUpdate(playerStatsModel: PlayerStatsModel) {
|
|
85
|
+
val data = Arguments.createMap()
|
|
80
86
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
// bandwidth
|
|
88
|
+
data.putInt("bandWidthEstimate", playerStatsModel.bandwidth.bandWidthEstimate.toInt())
|
|
89
|
+
data.putInt("totalBytesLoaded", playerStatsModel.bandwidth.totalBytesLoaded.toInt())
|
|
84
90
|
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
// bufferedDuration
|
|
92
|
+
data.putInt("bufferedDuration", playerStatsModel.bufferedDuration.toInt())
|
|
87
93
|
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
// distanceFromLive
|
|
95
|
+
data.putInt("distanceFromLive", playerStatsModel.distanceFromLive.toInt())
|
|
90
96
|
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
// frameInfo
|
|
98
|
+
data.putInt("droppedFrameCount", playerStatsModel.frameInfo.droppedFrameCount)
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
// videoInfo
|
|
101
|
+
data.putInt("averageBitrate", playerStatsModel.videoInfo.averageBitrate)
|
|
102
|
+
data.putInt("videoHeight", playerStatsModel.videoInfo.videoHeight)
|
|
103
|
+
data.putInt("videoWidth", playerStatsModel.videoInfo.videoWidth)
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
sendHLSStatsEventToJS(HMSHLSPlayerConstants.ON_STATS_EVENT_UPDATE, data)
|
|
106
|
+
}
|
|
100
107
|
}
|
|
101
|
-
}
|
|
102
108
|
|
|
103
109
|
init {
|
|
104
110
|
val inflater = getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
|
@@ -109,6 +115,7 @@ class HMSHLSPlayer(context: ReactContext) : FrameLayout(context) {
|
|
|
109
115
|
// getting Exoplayer View from above xml
|
|
110
116
|
val localPlayerView = view.findViewById<PlayerView>(R.id.hls_view)
|
|
111
117
|
playerView = localPlayerView
|
|
118
|
+
localPlayerView.useController = false
|
|
112
119
|
|
|
113
120
|
val hmssdkCollection = context.getNativeModule(HMSManager::class.java)?.getHmsInstance()
|
|
114
121
|
hmssdkInstance = hmssdkCollection?.get("12345")?.hmsSDK
|
|
@@ -122,6 +129,37 @@ class HMSHLSPlayer(context: ReactContext) : FrameLayout(context) {
|
|
|
122
129
|
|
|
123
130
|
// setting 100ms HLS Player on Exoplayer
|
|
124
131
|
localPlayerView.player = localHmsHlsPlayer.getNativePlayer()
|
|
132
|
+
|
|
133
|
+
localPlayerView?.player?.addListener(
|
|
134
|
+
object : Player.Listener {
|
|
135
|
+
override fun onSurfaceSizeChanged(
|
|
136
|
+
width: Int,
|
|
137
|
+
height: Int,
|
|
138
|
+
) {
|
|
139
|
+
super.onSurfaceSizeChanged(width, height)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
override fun onVideoSizeChanged(videoSize: VideoSize) {
|
|
143
|
+
super.onVideoSizeChanged(videoSize)
|
|
144
|
+
|
|
145
|
+
if (videoSize.height != 0 && videoSize.width != 0) {
|
|
146
|
+
val width = videoSize.width.toDouble()
|
|
147
|
+
val height = videoSize.height.toDouble()
|
|
148
|
+
|
|
149
|
+
if (width >= height) {
|
|
150
|
+
playerView?.resizeMode = RESIZE_MODE_FIT
|
|
151
|
+
} else {
|
|
152
|
+
playerView?.resizeMode = RESIZE_MODE_ZOOM
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
val data = Arguments.createMap()
|
|
156
|
+
data.putString("state", "onVideoSizeChanged")
|
|
157
|
+
data.putDouble("aspectRatio", (width / height))
|
|
158
|
+
sendHLSPlaybackEventToJS(HMSHLSPlayerConstants.ON_PLAYBACK_STATE_CHANGE_EVENT, data)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
)
|
|
125
163
|
}
|
|
126
164
|
|
|
127
165
|
fun cleanup() {
|
|
@@ -138,13 +176,14 @@ class HMSHLSPlayer(context: ReactContext) : FrameLayout(context) {
|
|
|
138
176
|
|
|
139
177
|
val hlsStreamingState = this.hmssdkInstance?.getRoom()?.hlsStreamingState
|
|
140
178
|
|
|
141
|
-
val defaultURL: String? =
|
|
142
|
-
|
|
143
|
-
it.
|
|
144
|
-
|
|
145
|
-
|
|
179
|
+
val defaultURL: String? =
|
|
180
|
+
hlsStreamingState?.let {
|
|
181
|
+
if (it.running) {
|
|
182
|
+
it.variants?.get(0)?.hlsStreamUrl
|
|
183
|
+
} else {
|
|
184
|
+
null
|
|
185
|
+
}
|
|
146
186
|
}
|
|
147
|
-
}
|
|
148
187
|
|
|
149
188
|
if (defaultURL !== null) {
|
|
150
189
|
hmsHlsPlayer?.play(defaultURL)
|
|
@@ -215,7 +254,10 @@ class HMSHLSPlayer(context: ReactContext) : FrameLayout(context) {
|
|
|
215
254
|
statsMonitorAttached = false
|
|
216
255
|
}
|
|
217
256
|
|
|
218
|
-
private fun sendHLSPlaybackEventToJS(
|
|
257
|
+
private fun sendHLSPlaybackEventToJS(
|
|
258
|
+
eventName: String,
|
|
259
|
+
data: WritableMap,
|
|
260
|
+
) {
|
|
219
261
|
val event: WritableMap = Arguments.createMap()
|
|
220
262
|
event.putString("event", eventName)
|
|
221
263
|
event.putMap("data", data)
|
|
@@ -224,7 +266,10 @@ class HMSHLSPlayer(context: ReactContext) : FrameLayout(context) {
|
|
|
224
266
|
reactContext.getJSModule(RCTEventEmitter::class.java).receiveEvent(id, HMSHLSPlayerConstants.HMS_HLS_PLAYBACK_EVENT, event)
|
|
225
267
|
}
|
|
226
268
|
|
|
227
|
-
private fun sendHLSStatsEventToJS(
|
|
269
|
+
private fun sendHLSStatsEventToJS(
|
|
270
|
+
eventName: String,
|
|
271
|
+
data: WritableMap,
|
|
272
|
+
) {
|
|
228
273
|
val event: WritableMap = Arguments.createMap()
|
|
229
274
|
event.putString("event", eventName)
|
|
230
275
|
event.putMap("data", data)
|
|
@@ -34,7 +34,11 @@ class HMSHLSPlayerManager : SimpleViewManager<HMSHLSPlayer>() {
|
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
override fun receiveCommand(
|
|
37
|
+
override fun receiveCommand(
|
|
38
|
+
root: HMSHLSPlayer,
|
|
39
|
+
commandId: Int,
|
|
40
|
+
args: ReadableArray?,
|
|
41
|
+
) {
|
|
38
42
|
super.receiveCommand(root, commandId, args)
|
|
39
43
|
|
|
40
44
|
when (commandId) {
|
|
@@ -81,17 +85,26 @@ class HMSHLSPlayerManager : SimpleViewManager<HMSHLSPlayer>() {
|
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
@ReactProp(name = "url")
|
|
84
|
-
fun setStreamURL(
|
|
88
|
+
fun setStreamURL(
|
|
89
|
+
view: HMSHLSPlayer,
|
|
90
|
+
data: String?,
|
|
91
|
+
) {
|
|
85
92
|
view.play(data)
|
|
86
93
|
}
|
|
87
94
|
|
|
88
95
|
@ReactProp(name = "enableStats", defaultBoolean = false)
|
|
89
|
-
fun setEnableStats(
|
|
96
|
+
fun setEnableStats(
|
|
97
|
+
view: HMSHLSPlayer,
|
|
98
|
+
data: Boolean,
|
|
99
|
+
) {
|
|
90
100
|
view.enableStats(data)
|
|
91
101
|
}
|
|
92
102
|
|
|
93
103
|
@ReactProp(name = "enableControls", defaultBoolean = false)
|
|
94
|
-
fun setEnableControls(
|
|
104
|
+
fun setEnableControls(
|
|
105
|
+
view: HMSHLSPlayer,
|
|
106
|
+
data: Boolean,
|
|
107
|
+
) {
|
|
95
108
|
view.enableControls(data)
|
|
96
109
|
}
|
|
97
110
|
|
|
@@ -18,6 +18,8 @@ import live.hms.video.media.settings.*
|
|
|
18
18
|
import live.hms.video.media.tracks.HMSRemoteAudioTrack
|
|
19
19
|
import live.hms.video.media.tracks.HMSRemoteVideoTrack
|
|
20
20
|
import live.hms.video.media.tracks.HMSTrack
|
|
21
|
+
import live.hms.video.sdk.HMSSDK
|
|
22
|
+
import live.hms.video.sdk.listeners.PeerListResultListener
|
|
21
23
|
import live.hms.video.sdk.models.*
|
|
22
24
|
import live.hms.video.sdk.models.enums.AudioMixingMode
|
|
23
25
|
import live.hms.video.sdk.models.role.HMSRole
|
|
@@ -27,9 +29,12 @@ import live.hms.video.utils.HmsUtilities
|
|
|
27
29
|
import org.webrtc.SurfaceViewRenderer
|
|
28
30
|
import java.io.ByteArrayOutputStream
|
|
29
31
|
import java.util.*
|
|
32
|
+
import kotlin.collections.ArrayList
|
|
33
|
+
import kotlin.coroutines.resume
|
|
34
|
+
import kotlin.coroutines.resumeWithException
|
|
35
|
+
import kotlin.coroutines.suspendCoroutine
|
|
30
36
|
|
|
31
37
|
object HMSHelper {
|
|
32
|
-
|
|
33
38
|
fun areAllRequiredKeysAvailable(
|
|
34
39
|
map: ReadableMap?,
|
|
35
40
|
requiredKeys: Array<Pair<String, String>>,
|
|
@@ -96,18 +101,45 @@ object HMSHelper {
|
|
|
96
101
|
return null
|
|
97
102
|
}
|
|
98
103
|
|
|
99
|
-
fun getPeerFromPeerId(
|
|
104
|
+
fun getPeerFromPeerId(
|
|
105
|
+
peerId: String?,
|
|
106
|
+
room: HMSRoom?,
|
|
107
|
+
): HMSPeer? {
|
|
100
108
|
if (peerId != null && room != null) {
|
|
101
109
|
return HmsUtilities.getPeer(peerId, room)
|
|
102
110
|
}
|
|
103
111
|
return null
|
|
104
112
|
}
|
|
105
113
|
|
|
106
|
-
fun getRemotePeerFromPeerId(
|
|
107
|
-
|
|
108
|
-
|
|
114
|
+
suspend fun getRemotePeerFromPeerId(
|
|
115
|
+
peerId: String?,
|
|
116
|
+
hmsSDK: HMSSDK?,
|
|
117
|
+
): HMSRemotePeer? {
|
|
118
|
+
return suspendCoroutine {
|
|
119
|
+
val room = hmsSDK?.getRoom()
|
|
120
|
+
|
|
121
|
+
if (peerId != null && room != null) {
|
|
122
|
+
val peerFromRoom = HmsUtilities.getPeer(peerId, room) as? HMSRemotePeer
|
|
123
|
+
if (peerFromRoom != null) {
|
|
124
|
+
it.resume(peerFromRoom)
|
|
125
|
+
} else {
|
|
126
|
+
val limit = 1
|
|
127
|
+
val peerIds = arrayListOf(peerId)
|
|
128
|
+
val peerListIterator = hmsSDK.getPeerListIterator(PeerListIteratorOptions(limit = limit, byPeerIds = peerIds))
|
|
129
|
+
peerListIterator.next(object : PeerListResultListener {
|
|
130
|
+
override fun onError(error: HMSException) {
|
|
131
|
+
it.resumeWithException(error)
|
|
132
|
+
}
|
|
133
|
+
override fun onSuccess(result: ArrayList<HMSPeer>) {
|
|
134
|
+
val peerFromIterator = result[0]
|
|
135
|
+
it.resume(peerFromIterator as? HMSRemotePeer)
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
} else {
|
|
140
|
+
it.resume(null)
|
|
141
|
+
}
|
|
109
142
|
}
|
|
110
|
-
return null
|
|
111
143
|
}
|
|
112
144
|
|
|
113
145
|
fun getRolesFromRoleNames(
|
|
@@ -128,7 +160,10 @@ object HMSHelper {
|
|
|
128
160
|
return encodedRoles.toList()
|
|
129
161
|
}
|
|
130
162
|
|
|
131
|
-
fun getRoleFromRoleName(
|
|
163
|
+
fun getRoleFromRoleName(
|
|
164
|
+
role: String?,
|
|
165
|
+
roles: List<HMSRole>?,
|
|
166
|
+
): HMSRole? {
|
|
132
167
|
if (role != null && roles != null) {
|
|
133
168
|
for (hmsRole in roles) {
|
|
134
169
|
if (role == hmsRole.name) {
|
|
@@ -139,21 +174,30 @@ object HMSHelper {
|
|
|
139
174
|
return null
|
|
140
175
|
}
|
|
141
176
|
|
|
142
|
-
fun getRemoteAudioTrackFromTrackId(
|
|
177
|
+
fun getRemoteAudioTrackFromTrackId(
|
|
178
|
+
trackId: String?,
|
|
179
|
+
room: HMSRoom?,
|
|
180
|
+
): HMSRemoteAudioTrack? {
|
|
143
181
|
if (trackId != null && room != null) {
|
|
144
182
|
return HmsUtilities.getAudioTrack(trackId, room) as? HMSRemoteAudioTrack
|
|
145
183
|
}
|
|
146
184
|
return null
|
|
147
185
|
}
|
|
148
186
|
|
|
149
|
-
fun getRemoteVideoTrackFromTrackId(
|
|
187
|
+
fun getRemoteVideoTrackFromTrackId(
|
|
188
|
+
trackId: String?,
|
|
189
|
+
room: HMSRoom?,
|
|
190
|
+
): HMSRemoteVideoTrack? {
|
|
150
191
|
if (trackId != null && room != null) {
|
|
151
192
|
return HmsUtilities.getVideoTrack(trackId, room) as? HMSRemoteVideoTrack
|
|
152
193
|
}
|
|
153
194
|
return null
|
|
154
195
|
}
|
|
155
196
|
|
|
156
|
-
fun getTrackFromTrackId(
|
|
197
|
+
fun getTrackFromTrackId(
|
|
198
|
+
trackId: String?,
|
|
199
|
+
room: HMSRoom?,
|
|
200
|
+
): HMSTrack? {
|
|
157
201
|
if (trackId != null && room != null) {
|
|
158
202
|
return HmsUtilities.getTrack(trackId, room)
|
|
159
203
|
}
|
|
@@ -334,7 +378,10 @@ object HMSHelper {
|
|
|
334
378
|
return HMSVideoTrackSettings.CameraFacing.FRONT
|
|
335
379
|
}
|
|
336
380
|
|
|
337
|
-
fun getHms(
|
|
381
|
+
fun getHms(
|
|
382
|
+
credentials: ReadableMap,
|
|
383
|
+
hmsCollection: MutableMap<String, HMSRNSDK>,
|
|
384
|
+
): HMSRNSDK? {
|
|
338
385
|
val id = credentials.getString("id")
|
|
339
386
|
|
|
340
387
|
return if (id != null) {
|
|
@@ -372,9 +419,7 @@ object HMSHelper {
|
|
|
372
419
|
return HMSHLSConfig(hlsMeetingUrlVariant, hlsRecordingConfig)
|
|
373
420
|
}
|
|
374
421
|
|
|
375
|
-
private fun getHMSHLSMeetingURLVariants(
|
|
376
|
-
hmsMeetingURLVariants: ArrayList<HashMap<String, String>>?,
|
|
377
|
-
): List<HMSHLSMeetingURLVariant> {
|
|
422
|
+
private fun getHMSHLSMeetingURLVariants(hmsMeetingURLVariants: ArrayList<HashMap<String, String>>?): List<HMSHLSMeetingURLVariant> {
|
|
378
423
|
val meetingURLVariants = mutableListOf<HMSHLSMeetingURLVariant>()
|
|
379
424
|
if (hmsMeetingURLVariants !== null) {
|
|
380
425
|
for (variant in hmsMeetingURLVariants) {
|
|
@@ -408,9 +453,7 @@ object HMSHelper {
|
|
|
408
453
|
return null
|
|
409
454
|
}
|
|
410
455
|
|
|
411
|
-
private fun getHMSHLSMeetingURLVariant(
|
|
412
|
-
hmsMeetingURLVariant: HashMap<String, String>?,
|
|
413
|
-
): HMSHLSMeetingURLVariant {
|
|
456
|
+
private fun getHMSHLSMeetingURLVariant(hmsMeetingURLVariant: HashMap<String, String>?): HMSHLSMeetingURLVariant {
|
|
414
457
|
var meetingURLVariant = HMSHLSMeetingURLVariant("", "")
|
|
415
458
|
if (hmsMeetingURLVariant !== null) {
|
|
416
459
|
val meetingUrl = hmsMeetingURLVariant["meetingUrl"] as String
|
|
@@ -478,7 +521,7 @@ object HMSHelper {
|
|
|
478
521
|
initEndpoint = credentials.getString("endpoint") as String,
|
|
479
522
|
metadata = credentials.getString("metadata") as String,
|
|
480
523
|
captureNetworkQualityInPreview =
|
|
481
|
-
|
|
524
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
482
525
|
)
|
|
483
526
|
}
|
|
484
527
|
areAllRequiredKeysAvailable(
|
|
@@ -503,7 +546,7 @@ object HMSHelper {
|
|
|
503
546
|
credentials.getString("authToken") as String,
|
|
504
547
|
initEndpoint = credentials.getString("endpoint") as String,
|
|
505
548
|
captureNetworkQualityInPreview =
|
|
506
|
-
|
|
549
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
507
550
|
)
|
|
508
551
|
}
|
|
509
552
|
areAllRequiredKeysAvailable(
|
|
@@ -516,7 +559,7 @@ object HMSHelper {
|
|
|
516
559
|
credentials.getString("authToken") as String,
|
|
517
560
|
metadata = credentials.getString("metadata") as String,
|
|
518
561
|
captureNetworkQualityInPreview =
|
|
519
|
-
|
|
562
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
520
563
|
)
|
|
521
564
|
}
|
|
522
565
|
areAllRequiredKeysAvailable(credentials, arrayOf(Pair("endpoint", "String"))) -> {
|
|
@@ -544,7 +587,7 @@ object HMSHelper {
|
|
|
544
587
|
credentials.getString("username") as String,
|
|
545
588
|
credentials.getString("authToken") as String,
|
|
546
589
|
captureNetworkQualityInPreview =
|
|
547
|
-
|
|
590
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
548
591
|
)
|
|
549
592
|
}
|
|
550
593
|
}
|
|
@@ -652,4 +695,15 @@ object HMSHelper {
|
|
|
652
695
|
}
|
|
653
696
|
return HMSAudioManager.AudioDevice.SPEAKER_PHONE
|
|
654
697
|
}
|
|
698
|
+
|
|
699
|
+
fun getPeerListIteratorOptions(data: ReadableMap?): PeerListIteratorOptions? {
|
|
700
|
+
if (data == null) {
|
|
701
|
+
return null
|
|
702
|
+
}
|
|
703
|
+
val limit = data.getInt("limit")
|
|
704
|
+
val role = data.getString("byRoleName")
|
|
705
|
+
val peerIds = data.getArray("byPeerIds")?.toArrayList() as? ArrayList<String>
|
|
706
|
+
|
|
707
|
+
return PeerListIteratorOptions(null, role, peerIds, limit)
|
|
708
|
+
}
|
|
655
709
|
}
|