@100mslive/react-native-hms 1.5.0 → 1.6.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/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +44 -44
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +12 -12
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +35 -35
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +52 -24
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +245 -62
- package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +4 -3
- package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +40 -33
- package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +41 -41
- package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +2 -2
- package/ios/HMSConstants.swift +3 -1
- package/ios/HMSDecoder.swift +1 -1
- package/ios/HMSHelper.swift +44 -7
- package/ios/HMSManager.m +8 -0
- package/ios/HMSManager.swift +35 -1
- package/ios/HMSRNSDK.swift +268 -38
- package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -1
- package/lib/commonjs/classes/HMSAudioTrackSettings.js +14 -0
- package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/commonjs/classes/HMSEncoder.js +2 -1
- 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/HMSLocalAudioTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/commonjs/classes/HMSLogger.js.map +1 -1
- package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/commonjs/classes/HMSPeer.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
- package/lib/commonjs/classes/HMSRemoteAudioTrack.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.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +50 -0
- 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/HMSUpdateListenerActions.js +8 -0
- package/lib/commonjs/classes/HMSUpdateListenerActions.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 +19 -29
- package/lib/commonjs/classes/HmsView.js.map +1 -1
- package/lib/commonjs/index.js +12 -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/HMSAudioMixerSource.js.map +1 -1
- package/lib/module/classes/HMSAudioTrackSettings.js +14 -0
- package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
- package/lib/module/classes/HMSEncoder.js +2 -1
- 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/HMSLocalAudioTrack.js.map +1 -1
- package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
- package/lib/module/classes/HMSLogger.js.map +1 -1
- package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
- package/lib/module/classes/HMSPeer.js.map +1 -1
- package/lib/module/classes/HMSPeersCache.js.map +1 -1
- package/lib/module/classes/HMSRemoteAudioTrack.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.map +1 -1
- package/lib/module/classes/HMSSDK.js +50 -0
- 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/HMSUpdateListenerActions.js +8 -0
- package/lib/module/classes/HMSUpdateListenerActions.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 +21 -31
- package/lib/module/classes/HmsView.js.map +1 -1
- package/lib/module/index.js +1 -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/HMSIOSAudioMode.d.ts +4 -0
- package/lib/typescript/classes/HMSSDK.d.ts +16 -0
- package/lib/typescript/classes/HMSSessionStore.d.ts +63 -0
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +9 -1
- package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +5 -0
- package/lib/typescript/index.d.ts +2 -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 +2 -2
- package/src/classes/HMSAudioTrackSettings.ts +16 -0
- package/src/classes/HMSEncoder.ts +1 -0
- package/src/classes/HMSIOSAudioMode.ts +4 -0
- package/src/classes/HMSSDK.tsx +70 -4
- package/src/classes/HMSSessionStore.ts +209 -0
- package/src/classes/HMSUpdateListenerActions.ts +8 -0
- package/src/classes/HMSVideoTrackSettings.ts +5 -0
- package/src/classes/HmsView.tsx +21 -32
- package/src/index.ts +5 -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
|
@@ -13,44 +13,44 @@ import live.hms.video.sdk.HMSActionResultListener
|
|
|
13
13
|
|
|
14
14
|
class HMSAudioshareActivity : ComponentActivity() {
|
|
15
15
|
private var resultLauncher: ActivityResultLauncher<Intent> =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
finish()
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
mediaProjectionPermissionResultData,
|
|
37
|
-
HMSHelper.getAudioMixingMode(audioMixingMode)
|
|
38
|
-
)
|
|
39
|
-
} else {
|
|
40
|
-
val id = intent.getStringExtra("id")
|
|
41
|
-
val error =
|
|
42
|
-
HMSException(
|
|
43
|
-
103,
|
|
44
|
-
"RESULT_CANCELED",
|
|
45
|
-
"RESULT_CANCELED",
|
|
46
|
-
"RESULT_CANCELED",
|
|
47
|
-
"RESULT_CANCELED"
|
|
16
|
+
this.registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
|
17
|
+
if (result.resultCode == Activity.RESULT_OK) {
|
|
18
|
+
val mediaProjectionPermissionResultData: Intent? = result.data
|
|
19
|
+
val id = intent.getStringExtra("id")
|
|
20
|
+
val audioMixingMode = intent.getStringExtra("audioMixingMode")
|
|
21
|
+
HMSManager.hmsCollection[id]?.hmsSDK?.startAudioshare(
|
|
22
|
+
object : HMSActionResultListener {
|
|
23
|
+
override fun onError(error: HMSException) {
|
|
24
|
+
finish()
|
|
25
|
+
HMSManager.hmsCollection[id]?.audioshareCallback?.reject(error)
|
|
26
|
+
HMSManager.hmsCollection[id]?.emitHMSError(error)
|
|
27
|
+
}
|
|
28
|
+
override fun onSuccess() {
|
|
29
|
+
HMSManager.hmsCollection[id]?.isAudioSharing = true
|
|
30
|
+
HMSManager.hmsCollection[id]?.audioshareCallback?.resolve(
|
|
31
|
+
HMSManager.hmsCollection[id]?.emitHMSSuccess(),
|
|
48
32
|
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
33
|
+
finish()
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
mediaProjectionPermissionResultData,
|
|
37
|
+
HMSHelper.getAudioMixingMode(audioMixingMode),
|
|
38
|
+
)
|
|
39
|
+
} else {
|
|
40
|
+
val id = intent.getStringExtra("id")
|
|
41
|
+
val error =
|
|
42
|
+
HMSException(
|
|
43
|
+
103,
|
|
44
|
+
"RESULT_CANCELED",
|
|
45
|
+
"RESULT_CANCELED",
|
|
46
|
+
"RESULT_CANCELED",
|
|
47
|
+
"RESULT_CANCELED",
|
|
48
|
+
)
|
|
49
|
+
HMSManager.hmsCollection[id]?.audioshareCallback?.reject(error)
|
|
50
|
+
HMSManager.hmsCollection[id]?.emitHMSError(error)
|
|
51
|
+
finish()
|
|
53
52
|
}
|
|
53
|
+
}
|
|
54
54
|
|
|
55
55
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
56
56
|
super.onCreate(savedInstanceState)
|
|
@@ -63,20 +63,20 @@ class HMSAudioshareActivity : ComponentActivity() {
|
|
|
63
63
|
if (isAudioShared !== null && !isAudioShared) {
|
|
64
64
|
try {
|
|
65
65
|
val mediaProjectionManager =
|
|
66
|
-
|
|
66
|
+
getSystemService(Context.MEDIA_PROJECTION_SERVICE) as MediaProjectionManager
|
|
67
67
|
resultLauncher.launch(mediaProjectionManager.createScreenCaptureIntent())
|
|
68
68
|
} catch (e: Exception) {
|
|
69
69
|
println(e)
|
|
70
70
|
}
|
|
71
71
|
} else {
|
|
72
72
|
HMSManager.hmsCollection[id]?.emitHMSError(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
HMSException(
|
|
74
|
+
103,
|
|
75
|
+
"AUDIOSHARE_IS_ALREADY_RUNNING",
|
|
76
|
+
"AUDIOSHARE_IS_ALREADY_RUNNING",
|
|
77
|
+
"AUDIOSHARE_IS_ALREADY_RUNNING",
|
|
78
|
+
"AUDIOSHARE_IS_ALREADY_RUNNING",
|
|
79
|
+
),
|
|
80
80
|
)
|
|
81
81
|
finish()
|
|
82
82
|
}
|
|
@@ -42,7 +42,7 @@ object HMSDecoder {
|
|
|
42
42
|
hmsRoom.browserRecordingState?.let {
|
|
43
43
|
room.putMap(
|
|
44
44
|
"browserRecordingState",
|
|
45
|
-
this.getHMSBrowserRecordingState(it)
|
|
45
|
+
this.getHMSBrowserRecordingState(it),
|
|
46
46
|
)
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -55,7 +55,7 @@ object HMSDecoder {
|
|
|
55
55
|
hmsRoom.rtmpHMSRtmpStreamingState?.let {
|
|
56
56
|
room.putMap(
|
|
57
57
|
"rtmpHMSRtmpStreamingState",
|
|
58
|
-
this.getHMSRtmpStreamingState(it)
|
|
58
|
+
this.getHMSRtmpStreamingState(it),
|
|
59
59
|
)
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -63,7 +63,7 @@ object HMSDecoder {
|
|
|
63
63
|
hmsRoom.serverRecordingState?.let {
|
|
64
64
|
room.putMap(
|
|
65
65
|
"serverRecordingState",
|
|
66
|
-
this.getHMSServerRecordingState(it)
|
|
66
|
+
this.getHMSServerRecordingState(it),
|
|
67
67
|
)
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -88,21 +88,21 @@ object HMSDecoder {
|
|
|
88
88
|
hmsRoom.browserRecordingState?.let {
|
|
89
89
|
room.putMap(
|
|
90
90
|
"browserRecordingState",
|
|
91
|
-
this.getHMSBrowserRecordingState(it)
|
|
91
|
+
this.getHMSBrowserRecordingState(it),
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
hmsRoom.rtmpHMSRtmpStreamingState?.let {
|
|
96
96
|
room.putMap(
|
|
97
97
|
"rtmpHMSRtmpStreamingState",
|
|
98
|
-
this.getHMSRtmpStreamingState(it)
|
|
98
|
+
this.getHMSRtmpStreamingState(it),
|
|
99
99
|
)
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
hmsRoom.serverRecordingState?.let {
|
|
103
103
|
room.putMap(
|
|
104
104
|
"serverRecordingState",
|
|
105
|
-
this.getHMSServerRecordingState(it)
|
|
105
|
+
this.getHMSServerRecordingState(it),
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -445,7 +445,7 @@ object HMSDecoder {
|
|
|
445
445
|
if (hmsAudioTrackSettings != null) {
|
|
446
446
|
settings.putBoolean(
|
|
447
447
|
"useHardwareAcousticEchoCanceler",
|
|
448
|
-
hmsAudioTrackSettings.useHardwareAcousticEchoCanceler
|
|
448
|
+
hmsAudioTrackSettings.useHardwareAcousticEchoCanceler,
|
|
449
449
|
)
|
|
450
450
|
settings.putString("initialState", hmsAudioTrackSettings.initialState.name)
|
|
451
451
|
}
|
|
@@ -689,28 +689,28 @@ object HMSDecoder {
|
|
|
689
689
|
|
|
690
690
|
subscribeSettings.putArray(
|
|
691
691
|
"subscribeTo",
|
|
692
|
-
this.getWriteableArray(hmsSubscribeSettings.subscribeTo)
|
|
692
|
+
this.getWriteableArray(hmsSubscribeSettings.subscribeTo),
|
|
693
693
|
)
|
|
694
694
|
}
|
|
695
695
|
return subscribeSettings
|
|
696
696
|
}
|
|
697
697
|
|
|
698
698
|
private fun getHmsSubscribeDegradationSettings(
|
|
699
|
-
hmsSubscribeDegradationParams: SubscribeDegradationParams
|
|
699
|
+
hmsSubscribeDegradationParams: SubscribeDegradationParams?,
|
|
700
700
|
): WritableMap {
|
|
701
701
|
val subscribeDegradationParams: WritableMap = Arguments.createMap()
|
|
702
702
|
if (hmsSubscribeDegradationParams != null) {
|
|
703
703
|
subscribeDegradationParams.putString(
|
|
704
704
|
"degradeGracePeriodSeconds",
|
|
705
|
-
hmsSubscribeDegradationParams.degradeGracePeriodSeconds.toString()
|
|
705
|
+
hmsSubscribeDegradationParams.degradeGracePeriodSeconds.toString(),
|
|
706
706
|
)
|
|
707
707
|
subscribeDegradationParams.putString(
|
|
708
708
|
"packetLossThreshold",
|
|
709
|
-
hmsSubscribeDegradationParams.packetLossThreshold.toString()
|
|
709
|
+
hmsSubscribeDegradationParams.packetLossThreshold.toString(),
|
|
710
710
|
)
|
|
711
711
|
subscribeDegradationParams.putString(
|
|
712
712
|
"recoverGracePeriodSeconds",
|
|
713
|
-
hmsSubscribeDegradationParams.recoverGracePeriodSeconds.toString()
|
|
713
|
+
hmsSubscribeDegradationParams.recoverGracePeriodSeconds.toString(),
|
|
714
714
|
)
|
|
715
715
|
}
|
|
716
716
|
return subscribeDegradationParams
|
|
@@ -32,7 +32,7 @@ object HMSHelper {
|
|
|
32
32
|
|
|
33
33
|
fun areAllRequiredKeysAvailable(
|
|
34
34
|
map: ReadableMap?,
|
|
35
|
-
requiredKeys: Array<Pair<String, String
|
|
35
|
+
requiredKeys: Array<Pair<String, String>>,
|
|
36
36
|
): Boolean {
|
|
37
37
|
if (map == null) {
|
|
38
38
|
return false
|
|
@@ -65,7 +65,7 @@ object HMSHelper {
|
|
|
65
65
|
|
|
66
66
|
fun getUnavailableRequiredKey(
|
|
67
67
|
map: ReadableMap?,
|
|
68
|
-
requiredKeys: Array<Pair<String, String
|
|
68
|
+
requiredKeys: Array<Pair<String, String>>,
|
|
69
69
|
): String? {
|
|
70
70
|
if (map == null) {
|
|
71
71
|
return "Object_Is_Null"
|
|
@@ -112,7 +112,7 @@ object HMSHelper {
|
|
|
112
112
|
|
|
113
113
|
fun getRolesFromRoleNames(
|
|
114
114
|
targetedRoles: ArrayList<String>?,
|
|
115
|
-
roles: List<HMSRole
|
|
115
|
+
roles: List<HMSRole>?,
|
|
116
116
|
): List<HMSRole> {
|
|
117
117
|
val encodedRoles: MutableList<HMSRole> = mutableListOf()
|
|
118
118
|
|
|
@@ -163,9 +163,9 @@ object HMSHelper {
|
|
|
163
163
|
fun getFrameworkInfo(data: ReadableMap?): FrameworkInfo? {
|
|
164
164
|
if (data != null &&
|
|
165
165
|
this.areAllRequiredKeysAvailable(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
data,
|
|
167
|
+
arrayOf(Pair("version", "String"), Pair("sdkVersion", "String")),
|
|
168
|
+
)
|
|
169
169
|
) {
|
|
170
170
|
val version = data.getString("version") as String
|
|
171
171
|
val sdkVersion = data.getString("sdkVersion") as String
|
|
@@ -177,13 +177,13 @@ object HMSHelper {
|
|
|
177
177
|
fun getLogSettings(data: ReadableMap?): HMSLogSettings? {
|
|
178
178
|
if (data != null &&
|
|
179
179
|
this.areAllRequiredKeysAvailable(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
data,
|
|
181
|
+
arrayOf(
|
|
182
|
+
Pair("level", "String"),
|
|
183
|
+
Pair("maxDirSizeInBytes", "String"),
|
|
184
|
+
Pair("isLogStorageEnabled", "Boolean"),
|
|
185
|
+
),
|
|
186
|
+
)
|
|
187
187
|
) {
|
|
188
188
|
val level = getLogLevel(data.getString("level"))
|
|
189
189
|
val maxDirSizeInBytes = getLogAlarmManager(data.getString("maxDirSizeInBytes"))
|
|
@@ -370,7 +370,7 @@ object HMSHelper {
|
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
private fun getHMSHLSMeetingURLVariants(
|
|
373
|
-
hmsMeetingURLVariants: ArrayList<HashMap<String, String
|
|
373
|
+
hmsMeetingURLVariants: ArrayList<HashMap<String, String>>?,
|
|
374
374
|
): List<HMSHLSMeetingURLVariant> {
|
|
375
375
|
val meetingURLVariants = mutableListOf<HMSHLSMeetingURLVariant>()
|
|
376
376
|
if (hmsMeetingURLVariants !== null) {
|
|
@@ -388,14 +388,14 @@ object HMSHelper {
|
|
|
388
388
|
var videoOnDemand = false
|
|
389
389
|
if (areAllRequiredKeysAvailable(
|
|
390
390
|
hmsHlsRecordingConfig,
|
|
391
|
-
arrayOf(Pair("singleFilePerLayer", "Boolean"))
|
|
391
|
+
arrayOf(Pair("singleFilePerLayer", "Boolean")),
|
|
392
392
|
)
|
|
393
393
|
) {
|
|
394
394
|
singleFilePerLayer = hmsHlsRecordingConfig.getBoolean("singleFilePerLayer")
|
|
395
395
|
}
|
|
396
396
|
if (areAllRequiredKeysAvailable(
|
|
397
397
|
hmsHlsRecordingConfig,
|
|
398
|
-
arrayOf(Pair("videoOnDemand", "Boolean"))
|
|
398
|
+
arrayOf(Pair("videoOnDemand", "Boolean")),
|
|
399
399
|
)
|
|
400
400
|
) {
|
|
401
401
|
videoOnDemand = hmsHlsRecordingConfig.getBoolean("videoOnDemand")
|
|
@@ -406,7 +406,7 @@ object HMSHelper {
|
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
private fun getHMSHLSMeetingURLVariant(
|
|
409
|
-
hmsMeetingURLVariant: HashMap<String, String
|
|
409
|
+
hmsMeetingURLVariant: HashMap<String, String>?,
|
|
410
410
|
): HMSHLSMeetingURLVariant {
|
|
411
411
|
var meetingURLVariant = HMSHLSMeetingURLVariant("", "")
|
|
412
412
|
if (hmsMeetingURLVariant !== null) {
|
|
@@ -453,7 +453,7 @@ object HMSHelper {
|
|
|
453
453
|
var config =
|
|
454
454
|
HMSConfig(
|
|
455
455
|
credentials.getString("username") as String,
|
|
456
|
-
credentials.getString("authToken") as String
|
|
456
|
+
credentials.getString("authToken") as String,
|
|
457
457
|
)
|
|
458
458
|
|
|
459
459
|
when {
|
|
@@ -462,8 +462,8 @@ object HMSHelper {
|
|
|
462
462
|
arrayOf(
|
|
463
463
|
Pair("endpoint", "String"),
|
|
464
464
|
Pair("metadata", "String"),
|
|
465
|
-
Pair("captureNetworkQualityInPreview", "Boolean")
|
|
466
|
-
)
|
|
465
|
+
Pair("captureNetworkQualityInPreview", "Boolean"),
|
|
466
|
+
),
|
|
467
467
|
) -> {
|
|
468
468
|
config =
|
|
469
469
|
HMSConfig(
|
|
@@ -472,24 +472,24 @@ object HMSHelper {
|
|
|
472
472
|
initEndpoint = credentials.getString("endpoint") as String,
|
|
473
473
|
metadata = credentials.getString("metadata") as String,
|
|
474
474
|
captureNetworkQualityInPreview =
|
|
475
|
-
credentials.getBoolean("captureNetworkQualityInPreview")
|
|
475
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
476
476
|
)
|
|
477
477
|
}
|
|
478
478
|
areAllRequiredKeysAvailable(
|
|
479
479
|
credentials,
|
|
480
|
-
arrayOf(Pair("endpoint", "String"), Pair("metadata", "String"))
|
|
480
|
+
arrayOf(Pair("endpoint", "String"), Pair("metadata", "String")),
|
|
481
481
|
) -> {
|
|
482
482
|
config =
|
|
483
483
|
HMSConfig(
|
|
484
484
|
credentials.getString("username") as String,
|
|
485
485
|
credentials.getString("authToken") as String,
|
|
486
486
|
initEndpoint = credentials.getString("endpoint") as String,
|
|
487
|
-
metadata = credentials.getString("metadata") as String
|
|
487
|
+
metadata = credentials.getString("metadata") as String,
|
|
488
488
|
)
|
|
489
489
|
}
|
|
490
490
|
areAllRequiredKeysAvailable(
|
|
491
491
|
credentials,
|
|
492
|
-
arrayOf(Pair("endpoint", "String"), Pair("captureNetworkQualityInPreview", "Boolean"))
|
|
492
|
+
arrayOf(Pair("endpoint", "String"), Pair("captureNetworkQualityInPreview", "Boolean")),
|
|
493
493
|
) -> {
|
|
494
494
|
config =
|
|
495
495
|
HMSConfig(
|
|
@@ -497,12 +497,12 @@ object HMSHelper {
|
|
|
497
497
|
credentials.getString("authToken") as String,
|
|
498
498
|
initEndpoint = credentials.getString("endpoint") as String,
|
|
499
499
|
captureNetworkQualityInPreview =
|
|
500
|
-
credentials.getBoolean("captureNetworkQualityInPreview")
|
|
500
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
501
501
|
)
|
|
502
502
|
}
|
|
503
503
|
areAllRequiredKeysAvailable(
|
|
504
504
|
credentials,
|
|
505
|
-
arrayOf(Pair("metadata", "String"), Pair("captureNetworkQualityInPreview", "Boolean"))
|
|
505
|
+
arrayOf(Pair("metadata", "String"), Pair("captureNetworkQualityInPreview", "Boolean")),
|
|
506
506
|
) -> {
|
|
507
507
|
config =
|
|
508
508
|
HMSConfig(
|
|
@@ -510,7 +510,7 @@ object HMSHelper {
|
|
|
510
510
|
credentials.getString("authToken") as String,
|
|
511
511
|
metadata = credentials.getString("metadata") as String,
|
|
512
512
|
captureNetworkQualityInPreview =
|
|
513
|
-
credentials.getBoolean("captureNetworkQualityInPreview")
|
|
513
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
514
514
|
)
|
|
515
515
|
}
|
|
516
516
|
areAllRequiredKeysAvailable(credentials, arrayOf(Pair("endpoint", "String"))) -> {
|
|
@@ -518,7 +518,7 @@ object HMSHelper {
|
|
|
518
518
|
HMSConfig(
|
|
519
519
|
credentials.getString("username") as String,
|
|
520
520
|
credentials.getString("authToken") as String,
|
|
521
|
-
initEndpoint = credentials.getString("endpoint") as String
|
|
521
|
+
initEndpoint = credentials.getString("endpoint") as String,
|
|
522
522
|
)
|
|
523
523
|
}
|
|
524
524
|
areAllRequiredKeysAvailable(credentials, arrayOf(Pair("metadata", "String"))) -> {
|
|
@@ -526,19 +526,19 @@ object HMSHelper {
|
|
|
526
526
|
HMSConfig(
|
|
527
527
|
credentials.getString("username") as String,
|
|
528
528
|
credentials.getString("authToken") as String,
|
|
529
|
-
metadata = credentials.getString("metadata") as String
|
|
529
|
+
metadata = credentials.getString("metadata") as String,
|
|
530
530
|
)
|
|
531
531
|
}
|
|
532
532
|
areAllRequiredKeysAvailable(
|
|
533
533
|
credentials,
|
|
534
|
-
arrayOf(Pair("captureNetworkQualityInPreview", "Boolean"))
|
|
534
|
+
arrayOf(Pair("captureNetworkQualityInPreview", "Boolean")),
|
|
535
535
|
) -> {
|
|
536
536
|
config =
|
|
537
537
|
HMSConfig(
|
|
538
538
|
credentials.getString("username") as String,
|
|
539
539
|
credentials.getString("authToken") as String,
|
|
540
540
|
captureNetworkQualityInPreview =
|
|
541
|
-
credentials.getBoolean("captureNetworkQualityInPreview")
|
|
541
|
+
credentials.getBoolean("captureNetworkQualityInPreview"),
|
|
542
542
|
)
|
|
543
543
|
}
|
|
544
544
|
}
|
|
@@ -552,7 +552,7 @@ object HMSHelper {
|
|
|
552
552
|
sdkId: String,
|
|
553
553
|
args: ReadableArray?,
|
|
554
554
|
context: Context,
|
|
555
|
-
id: Int
|
|
555
|
+
id: Int,
|
|
556
556
|
) {
|
|
557
557
|
val output = Arguments.createMap()
|
|
558
558
|
if (args != null) {
|
|
@@ -587,8 +587,8 @@ object HMSHelper {
|
|
|
587
587
|
copyResult.toString(),
|
|
588
588
|
copyResult.toString(),
|
|
589
589
|
copyResult.toString(),
|
|
590
|
-
copyResult.toString()
|
|
591
|
-
)
|
|
590
|
+
copyResult.toString(),
|
|
591
|
+
),
|
|
592
592
|
)
|
|
593
593
|
output.putString("error", copyResult.toString())
|
|
594
594
|
reactContext
|
|
@@ -596,7 +596,7 @@ object HMSHelper {
|
|
|
596
596
|
.receiveEvent(id, "captureFrame", output)
|
|
597
597
|
}
|
|
598
598
|
},
|
|
599
|
-
Handler()
|
|
599
|
+
Handler(),
|
|
600
600
|
)
|
|
601
601
|
} catch (e: Exception) {
|
|
602
602
|
Log.e("captureSurfaceView", "error: $e")
|
|
@@ -489,7 +489,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
489
489
|
},
|
|
490
490
|
endMeeting = {
|
|
491
491
|
endMeeting()
|
|
492
|
-
}
|
|
492
|
+
},
|
|
493
493
|
)
|
|
494
494
|
} else {
|
|
495
495
|
null
|
|
@@ -556,7 +556,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
556
556
|
pipRemoteActionsList[audioActionIdx] = android.app.RemoteAction(
|
|
557
557
|
android.graphics.drawable.Icon.createWithResource(
|
|
558
558
|
reactApplicationContext,
|
|
559
|
-
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,
|
|
560
560
|
),
|
|
561
561
|
PipActionReceiver.PIPActions.localAudio.title,
|
|
562
562
|
PipActionReceiver.PIPActions.localAudio.description,
|
|
@@ -564,8 +564,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
564
564
|
reactApplicationContext,
|
|
565
565
|
PipActionReceiver.PIPActions.localAudio.requestCode,
|
|
566
566
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(PipActionReceiver.PIPActions.localAudio.title, PipActionReceiver.PIPActions.localAudio.requestCode),
|
|
567
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
568
|
-
)
|
|
567
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
568
|
+
),
|
|
569
569
|
)
|
|
570
570
|
}
|
|
571
571
|
}
|
|
@@ -577,7 +577,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
577
577
|
pipRemoteActionsList[videoActionIdx] = android.app.RemoteAction(
|
|
578
578
|
android.graphics.drawable.Icon.createWithResource(
|
|
579
579
|
reactApplicationContext,
|
|
580
|
-
updatedIcon
|
|
580
|
+
updatedIcon,
|
|
581
581
|
),
|
|
582
582
|
PipActionReceiver.PIPActions.localVideo.title,
|
|
583
583
|
PipActionReceiver.PIPActions.localVideo.description,
|
|
@@ -585,8 +585,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
585
585
|
reactApplicationContext,
|
|
586
586
|
PipActionReceiver.PIPActions.localVideo.requestCode,
|
|
587
587
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(PipActionReceiver.PIPActions.localVideo.title, PipActionReceiver.PIPActions.localVideo.requestCode),
|
|
588
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
589
|
-
)
|
|
588
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
589
|
+
),
|
|
590
590
|
)
|
|
591
591
|
}
|
|
592
592
|
}
|
|
@@ -606,7 +606,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
606
606
|
val aspectRatio: Pair<Int, Int>?,
|
|
607
607
|
val showEndButton: Boolean,
|
|
608
608
|
val showVideoButton: Boolean,
|
|
609
|
-
val showAudioButton: Boolean
|
|
609
|
+
val showAudioButton: Boolean,
|
|
610
610
|
)
|
|
611
611
|
|
|
612
612
|
@ReactMethod
|
|
@@ -656,8 +656,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
656
656
|
it.setAspectRatio(
|
|
657
657
|
Rational(
|
|
658
658
|
config.aspectRatio.first,
|
|
659
|
-
config.aspectRatio.second
|
|
660
|
-
)
|
|
659
|
+
config.aspectRatio.second,
|
|
660
|
+
),
|
|
661
661
|
)
|
|
662
662
|
}
|
|
663
663
|
|
|
@@ -679,7 +679,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
679
679
|
android.app.RemoteAction(
|
|
680
680
|
android.graphics.drawable.Icon.createWithResource(
|
|
681
681
|
reactApplicationContext,
|
|
682
|
-
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,
|
|
683
683
|
),
|
|
684
684
|
PipActionReceiver.PIPActions.localAudio.title,
|
|
685
685
|
PipActionReceiver.PIPActions.localAudio.description,
|
|
@@ -687,9 +687,9 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
687
687
|
reactApplicationContext,
|
|
688
688
|
PipActionReceiver.PIPActions.localAudio.requestCode,
|
|
689
689
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(PipActionReceiver.PIPActions.localAudio.title, PipActionReceiver.PIPActions.localAudio.requestCode),
|
|
690
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
691
|
-
)
|
|
692
|
-
)
|
|
690
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
691
|
+
),
|
|
692
|
+
),
|
|
693
693
|
)
|
|
694
694
|
}
|
|
695
695
|
|
|
@@ -704,11 +704,11 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
704
704
|
PipActionReceiver.PIPActions.endMeet.requestCode,
|
|
705
705
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(
|
|
706
706
|
PipActionReceiver.PIPActions.endMeet.title,
|
|
707
|
-
PipActionReceiver.PIPActions.endMeet.requestCode
|
|
707
|
+
PipActionReceiver.PIPActions.endMeet.requestCode,
|
|
708
708
|
),
|
|
709
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
710
|
-
)
|
|
711
|
-
)
|
|
709
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
710
|
+
),
|
|
711
|
+
),
|
|
712
712
|
)
|
|
713
713
|
}
|
|
714
714
|
|
|
@@ -717,7 +717,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
717
717
|
android.app.RemoteAction(
|
|
718
718
|
android.graphics.drawable.Icon.createWithResource(
|
|
719
719
|
reactApplicationContext,
|
|
720
|
-
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,
|
|
721
721
|
),
|
|
722
722
|
PipActionReceiver.PIPActions.localVideo.title,
|
|
723
723
|
PipActionReceiver.PIPActions.localVideo.description,
|
|
@@ -726,11 +726,11 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
726
726
|
PipActionReceiver.PIPActions.localVideo.requestCode,
|
|
727
727
|
Intent(PipActionReceiver.PIP_INTENT_ACTION).putExtra(
|
|
728
728
|
PipActionReceiver.PIPActions.localVideo.title,
|
|
729
|
-
PipActionReceiver.PIPActions.localVideo.requestCode
|
|
729
|
+
PipActionReceiver.PIPActions.localVideo.requestCode,
|
|
730
730
|
),
|
|
731
|
-
PendingIntent.FLAG_IMMUTABLE
|
|
732
|
-
)
|
|
733
|
-
)
|
|
731
|
+
PendingIntent.FLAG_IMMUTABLE,
|
|
732
|
+
),
|
|
733
|
+
),
|
|
734
734
|
)
|
|
735
735
|
}
|
|
736
736
|
|
|
@@ -806,7 +806,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
806
806
|
aspectRatio = aspectRatio,
|
|
807
807
|
showEndButton = showEndButton,
|
|
808
808
|
showAudioButton = showAudioButton,
|
|
809
|
-
showVideoButton = showVideoButton
|
|
809
|
+
showVideoButton = showVideoButton,
|
|
810
810
|
)
|
|
811
811
|
}
|
|
812
812
|
|
|
@@ -912,6 +912,34 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
912
912
|
hms?.captureImageAtMaxSupportedResolution(data, promise)
|
|
913
913
|
}
|
|
914
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
|
+
|
|
915
943
|
fun emitEvent(event: String, data: WritableMap) {
|
|
916
944
|
reactApplicationContext
|
|
917
945
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|