@100mslive/react-native-hms 1.8.0 → 2.0.0-alpha.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/.gradle/6.7.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/{6.7.1/fileHashes/fileHashes.bin → 6.9/fileHashes/resourceHashesCache.bin} +0 -0
- package/android/.gradle/6.9/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/6.9/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/6.9/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/6.9/javaCompile/taskHistory.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
- 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/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -0
- package/android/.idea/jarRepositories.xml +45 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +3 -3
- package/android/local.properties +8 -1
- package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +14 -4
- package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +12 -0
- package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +120 -25
- package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +184 -0
- package/ios/HMSConstants.swift +1 -0
- package/ios/HMSDecoder.swift +16 -5
- package/ios/HMSManager.m +12 -0
- package/ios/HMSManager.swift +22 -1
- package/ios/HMSRNSDK.swift +62 -0
- 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/HMSPIPListenerActions.js +1 -0
- 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 +46 -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 +2 -1
- package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
- package/lib/commonjs/classes/HMSPeersCache.js +7 -0
- package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
- package/lib/commonjs/classes/HMSSDK.js +122 -3
- package/lib/commonjs/classes/HMSSDK.js.map +1 -1
- package/lib/commonjs/classes/HMSUpdateListenerActions.js +1 -0
- package/lib/commonjs/classes/HMSUpdateListenerActions.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 +40 -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 +122 -4
- 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/typescript/classes/HMSPIPListenerActions.d.ts +1 -0
- package/lib/typescript/classes/HMSPeer.d.ts +3 -0
- package/lib/typescript/classes/HMSPeerListIterator.d.ts +7 -0
- package/lib/typescript/classes/HMSPeerListIteratorOptions.d.ts +5 -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 +23 -1
- package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +2 -1
- package/package.json +1 -1
- package/sdk-versions.json +2 -2
- package/src/classes/HMSPIPListenerActions.ts +1 -0
- package/src/classes/HMSPeer.ts +25 -0
- package/src/classes/HMSPeerListIterator.ts +40 -0
- package/src/classes/HMSPeerListIteratorOptions.ts +5 -0
- package/src/classes/HMSPeerUpdate.ts +2 -0
- package/src/classes/HMSPeersCache.ts +7 -0
- package/src/classes/HMSSDK.tsx +154 -2
- package/src/classes/HMSUpdateListenerActions.ts +1 -0
- package/android/.gradle/6.7.1/executionHistory/executionHistory.bin +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/.gradle/{6.7.1/fileHashes/fileHashes.bin → 6.9/fileHashes/resourceHashesCache.bin}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Tue Aug 08 17:17:39 IST 2023
|
|
2
2
|
gradle.version=6.7.1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="GradleMigrationSettings" migrationVersion="1" />
|
|
4
|
+
<component name="GradleSettings">
|
|
5
|
+
<option name="linkedExternalProjectsSettings">
|
|
6
|
+
<GradleProjectSettings>
|
|
7
|
+
<option name="testRunner" value="GRADLE" />
|
|
8
|
+
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
|
9
|
+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
|
10
|
+
<option name="modules">
|
|
11
|
+
<set>
|
|
12
|
+
<option value="$PROJECT_DIR$" />
|
|
13
|
+
</set>
|
|
14
|
+
</option>
|
|
15
|
+
</GradleProjectSettings>
|
|
16
|
+
</option>
|
|
17
|
+
</component>
|
|
18
|
+
</project>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="RemoteRepositoriesConfiguration">
|
|
4
|
+
<remote-repository>
|
|
5
|
+
<option name="id" value="central" />
|
|
6
|
+
<option name="name" value="Maven Central repository" />
|
|
7
|
+
<option name="url" value="https://repo1.maven.org/maven2" />
|
|
8
|
+
</remote-repository>
|
|
9
|
+
<remote-repository>
|
|
10
|
+
<option name="id" value="jboss.community" />
|
|
11
|
+
<option name="name" value="JBoss Community repository" />
|
|
12
|
+
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
|
13
|
+
</remote-repository>
|
|
14
|
+
<remote-repository>
|
|
15
|
+
<option name="id" value="MavenRepo" />
|
|
16
|
+
<option name="name" value="MavenRepo" />
|
|
17
|
+
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
|
18
|
+
</remote-repository>
|
|
19
|
+
<remote-repository>
|
|
20
|
+
<option name="id" value="MavenLocal" />
|
|
21
|
+
<option name="name" value="MavenLocal" />
|
|
22
|
+
<option name="url" value="file:$USER_HOME$/.m2/repository/" />
|
|
23
|
+
</remote-repository>
|
|
24
|
+
<remote-repository>
|
|
25
|
+
<option name="id" value="maven" />
|
|
26
|
+
<option name="name" value="maven" />
|
|
27
|
+
<option name="url" value="file:$PROJECT_DIR$/../node_modules/react-native/android/" />
|
|
28
|
+
</remote-repository>
|
|
29
|
+
<remote-repository>
|
|
30
|
+
<option name="id" value="Gradle Central Plugin Repository" />
|
|
31
|
+
<option name="name" value="Gradle Central Plugin Repository" />
|
|
32
|
+
<option name="url" value="https://plugins.gradle.org/m2" />
|
|
33
|
+
</remote-repository>
|
|
34
|
+
<remote-repository>
|
|
35
|
+
<option name="id" value="Google" />
|
|
36
|
+
<option name="name" value="Google" />
|
|
37
|
+
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
|
38
|
+
</remote-repository>
|
|
39
|
+
<remote-repository>
|
|
40
|
+
<option name="id" value="maven2" />
|
|
41
|
+
<option name="name" value="maven2" />
|
|
42
|
+
<option name="url" value="https://jitpack.io" />
|
|
43
|
+
</remote-repository>
|
|
44
|
+
</component>
|
|
45
|
+
</project>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
4
|
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="Android Studio default JDK" project-jdk-type="JavaSDK">
|
|
5
|
+
<output url="file://$PROJECT_DIR$/build/classes" />
|
|
6
|
+
</component>
|
|
7
|
+
<component name="ProjectType">
|
|
8
|
+
<option name="id" value="Android" />
|
|
9
|
+
</component>
|
|
10
|
+
</project>
|
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
|
|
@@ -172,6 +172,9 @@ object HMSDecoder {
|
|
|
172
172
|
HMSPeerUpdate.NAME_CHANGED -> {
|
|
173
173
|
print("$peerUpdateType received")
|
|
174
174
|
}
|
|
175
|
+
HMSPeerUpdate.HAND_RAISED_CHANGED -> {
|
|
176
|
+
peer.putBoolean("isHandRaised", hmsPeer.isHandRaised)
|
|
177
|
+
}
|
|
175
178
|
else -> {
|
|
176
179
|
print("Unhandled Peer Update Type received: $peerUpdateType")
|
|
177
180
|
}
|
|
@@ -205,6 +208,9 @@ object HMSDecoder {
|
|
|
205
208
|
HMSPeerUpdate.NAME_CHANGED -> {
|
|
206
209
|
print("$peerUpdateType received")
|
|
207
210
|
}
|
|
211
|
+
HMSPeerUpdate.HAND_RAISED_CHANGED -> {
|
|
212
|
+
peer.putBoolean("isHandRaised", hmsPeer.isHandRaised)
|
|
213
|
+
}
|
|
208
214
|
else -> {
|
|
209
215
|
print("Unhandled Peer Update Type received: $peerUpdateType")
|
|
210
216
|
}
|
|
@@ -231,6 +237,8 @@ object HMSDecoder {
|
|
|
231
237
|
|
|
232
238
|
peer.putMap("role", this.getHmsRole(hmsPeer.hmsRole))
|
|
233
239
|
|
|
240
|
+
peer.putBoolean("isHandRaised", hmsPeer.isHandRaised)
|
|
241
|
+
|
|
234
242
|
hmsPeer.networkQuality?.let {
|
|
235
243
|
peer.putMap("networkQuality", this.getHmsNetworkQuality(it))
|
|
236
244
|
}
|
|
@@ -479,10 +487,12 @@ object HMSDecoder {
|
|
|
479
487
|
private fun getHmsAudioTrackSettings(hmsAudioTrackSettings: HMSAudioTrackSettings?): WritableMap {
|
|
480
488
|
val settings: WritableMap = Arguments.createMap()
|
|
481
489
|
if (hmsAudioTrackSettings != null) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
490
|
+
hmsAudioTrackSettings.useHardwareAcousticEchoCanceler?.let {
|
|
491
|
+
settings.putBoolean(
|
|
492
|
+
"useHardwareAcousticEchoCanceler",
|
|
493
|
+
it,
|
|
494
|
+
)
|
|
495
|
+
}
|
|
486
496
|
settings.putString("initialState", hmsAudioTrackSettings.initialState.name)
|
|
487
497
|
}
|
|
488
498
|
return settings
|
|
@@ -27,6 +27,7 @@ import live.hms.video.utils.HmsUtilities
|
|
|
27
27
|
import org.webrtc.SurfaceViewRenderer
|
|
28
28
|
import java.io.ByteArrayOutputStream
|
|
29
29
|
import java.util.*
|
|
30
|
+
import kotlin.collections.ArrayList
|
|
30
31
|
|
|
31
32
|
object HMSHelper {
|
|
32
33
|
fun areAllRequiredKeysAvailable(
|
|
@@ -668,4 +669,15 @@ object HMSHelper {
|
|
|
668
669
|
}
|
|
669
670
|
return HMSAudioManager.AudioDevice.SPEAKER_PHONE
|
|
670
671
|
}
|
|
672
|
+
|
|
673
|
+
fun getPeerListIteratorOptions(data: ReadableMap?): PeerListIteratorOptions? {
|
|
674
|
+
if (data == null) {
|
|
675
|
+
return null
|
|
676
|
+
}
|
|
677
|
+
val limit = data.getInt("limit")
|
|
678
|
+
val role = data.getString("byRoleName")
|
|
679
|
+
val peerIds = data.getArray("byPeerIds")?.toArrayList() as? ArrayList<String>
|
|
680
|
+
|
|
681
|
+
return PeerListIteratorOptions(null, role, peerIds, limit)
|
|
682
|
+
}
|
|
671
683
|
}
|
|
@@ -5,6 +5,7 @@ import android.app.Application
|
|
|
5
5
|
import android.app.PendingIntent
|
|
6
6
|
import android.content.Intent
|
|
7
7
|
import android.content.pm.PackageManager
|
|
8
|
+
import android.content.res.Configuration
|
|
8
9
|
import android.os.Build
|
|
9
10
|
import android.os.Bundle
|
|
10
11
|
import android.util.Rational
|
|
@@ -21,6 +22,32 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
21
22
|
companion object {
|
|
22
23
|
const val REACT_CLASS = "HMSManager"
|
|
23
24
|
var hmsCollection = mutableMapOf<String, HMSRNSDK>()
|
|
25
|
+
|
|
26
|
+
var reactAppContext: ReactApplicationContext? = null
|
|
27
|
+
var pipParamConfig: PipParamConfig? = null;
|
|
28
|
+
var pipParamsUntyped: Any? = null;
|
|
29
|
+
var emitter: DeviceEventManagerModule.RCTDeviceEventEmitter? = null
|
|
30
|
+
|
|
31
|
+
fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration) {
|
|
32
|
+
emitter?.let {
|
|
33
|
+
val data = Arguments.createMap()
|
|
34
|
+
data.putBoolean("isInPictureInPictureMode", isInPictureInPictureMode)
|
|
35
|
+
|
|
36
|
+
it.emit("ON_PIP_MODE_CHANGED", data)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
fun onUserLeaveHint() {
|
|
41
|
+
val pipParams = pipParamsUntyped
|
|
42
|
+
if (
|
|
43
|
+
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
|
44
|
+
Build.VERSION.SDK_INT < Build.VERSION_CODES.S &&
|
|
45
|
+
pipParamConfig?.autoEnterPipMode == true &&
|
|
46
|
+
pipParams is android.app.PictureInPictureParams
|
|
47
|
+
) {
|
|
48
|
+
reactAppContext?.currentActivity?.enterPictureInPictureMode(pipParams)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
24
51
|
}
|
|
25
52
|
|
|
26
53
|
override fun getName(): String {
|
|
@@ -31,6 +58,21 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
31
58
|
return hmsCollection
|
|
32
59
|
}
|
|
33
60
|
|
|
61
|
+
private fun setupPip() {
|
|
62
|
+
if (emitter == null) {
|
|
63
|
+
reactAppContext = reactApplicationContext
|
|
64
|
+
|
|
65
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
66
|
+
currentActivity?.let {
|
|
67
|
+
pipReceiver?.register(it)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
emitter = reactApplicationContext
|
|
72
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
34
76
|
// Example method
|
|
35
77
|
// See https://reactnative.dev/docs/native-modules-android
|
|
36
78
|
@ReactMethod
|
|
@@ -743,7 +785,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
743
785
|
}
|
|
744
786
|
// endregion
|
|
745
787
|
|
|
746
|
-
|
|
788
|
+
data class PipParamConfig(
|
|
789
|
+
val autoEnterPipMode: Boolean,
|
|
747
790
|
val aspectRatio: Pair<Int, Int>?,
|
|
748
791
|
val showEndButton: Boolean,
|
|
749
792
|
val showVideoButton: Boolean,
|
|
@@ -767,6 +810,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
767
810
|
}
|
|
768
811
|
|
|
769
812
|
try {
|
|
813
|
+
setupPip()
|
|
814
|
+
|
|
770
815
|
PipActionReceiver.sdkIdForPIP = data.getString("id")
|
|
771
816
|
|
|
772
817
|
when (action) {
|
|
@@ -774,8 +819,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
774
819
|
val result = isPipModeSupported()
|
|
775
820
|
promise?.resolve(result)
|
|
776
821
|
}
|
|
777
|
-
"
|
|
778
|
-
val result =
|
|
822
|
+
"enterPipMode" -> {
|
|
823
|
+
val result = enterPipMode(data)
|
|
779
824
|
promise?.resolve(result)
|
|
780
825
|
}
|
|
781
826
|
"setPictureInPictureParams" -> {
|
|
@@ -807,10 +852,9 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
807
852
|
)
|
|
808
853
|
}
|
|
809
854
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
// }
|
|
855
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
|
856
|
+
it.setAutoEnterEnabled(config.autoEnterPipMode)
|
|
857
|
+
}
|
|
814
858
|
|
|
815
859
|
// region Setting RemoteActions on PictureInPictureParams
|
|
816
860
|
val hmssdk = getHmsInstance()[PipActionReceiver.sdkIdForPIP!!]?.hmsSDK
|
|
@@ -897,14 +941,12 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
897
941
|
return null
|
|
898
942
|
}
|
|
899
943
|
|
|
944
|
+
var autoEnterPipMode = false
|
|
900
945
|
var aspectRatio: Pair<Int, Int> = Pair(16, 9)
|
|
901
946
|
var showEndButton = false
|
|
902
947
|
var showAudioButton = false
|
|
903
948
|
var showVideoButton = false
|
|
904
949
|
|
|
905
|
-
// TODO:= We need compileSdkVersion >= 31 for autoEnterEnabled
|
|
906
|
-
// var autoEnterEnabled: Boolean? = null;
|
|
907
|
-
|
|
908
950
|
if (data !== null) {
|
|
909
951
|
if (data.hasKey("aspectRatio")) {
|
|
910
952
|
val aspectRatioArray = data.getArray("aspectRatio")
|
|
@@ -940,17 +982,17 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
940
982
|
showVideoButton = data.getBoolean("videoButton")
|
|
941
983
|
}
|
|
942
984
|
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
// }
|
|
985
|
+
if (data.hasKey("autoEnterPipMode")) {
|
|
986
|
+
val autoEnterPipModeType = data.getType("autoEnterPipMode")
|
|
987
|
+
|
|
988
|
+
if (autoEnterPipModeType === ReadableType.Boolean) {
|
|
989
|
+
autoEnterPipMode = data.getBoolean("autoEnterPipMode")
|
|
990
|
+
}
|
|
991
|
+
}
|
|
951
992
|
}
|
|
952
993
|
|
|
953
994
|
return PipParamConfig(
|
|
995
|
+
autoEnterPipMode = autoEnterPipMode,
|
|
954
996
|
aspectRatio = aspectRatio,
|
|
955
997
|
showEndButton = showEndButton,
|
|
956
998
|
showAudioButton = showAudioButton,
|
|
@@ -975,6 +1017,10 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
975
1017
|
if (pipParams !is android.app.PictureInPictureParams) {
|
|
976
1018
|
return false
|
|
977
1019
|
}
|
|
1020
|
+
|
|
1021
|
+
HMSManager.pipParamConfig = pipParamConfig
|
|
1022
|
+
HMSManager.pipParamsUntyped = pipParams
|
|
1023
|
+
|
|
978
1024
|
activity.setPictureInPictureParams(pipParams)
|
|
979
1025
|
return true
|
|
980
1026
|
} catch (e: Exception) {
|
|
@@ -991,7 +1037,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
991
1037
|
}
|
|
992
1038
|
|
|
993
1039
|
@RequiresApi(Build.VERSION_CODES.O)
|
|
994
|
-
private fun
|
|
1040
|
+
private fun enterPipMode(data: ReadableMap): Boolean {
|
|
995
1041
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
|
996
1042
|
return false
|
|
997
1043
|
}
|
|
@@ -1007,12 +1053,11 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
1007
1053
|
if (pipParams !is android.app.PictureInPictureParams) {
|
|
1008
1054
|
return false
|
|
1009
1055
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
return entered
|
|
1056
|
+
|
|
1057
|
+
HMSManager.pipParamConfig = pipParamConfig
|
|
1058
|
+
HMSManager.pipParamsUntyped = pipParams
|
|
1059
|
+
|
|
1060
|
+
return activity.enterPictureInPictureMode(pipParams)
|
|
1016
1061
|
} catch (e: Exception) {
|
|
1017
1062
|
throw e
|
|
1018
1063
|
}
|
|
@@ -1128,6 +1173,56 @@ class HMSManager(reactContext: ReactApplicationContext) :
|
|
|
1128
1173
|
hms?.getRoomLayout(data, promise)
|
|
1129
1174
|
}
|
|
1130
1175
|
|
|
1176
|
+
@ReactMethod
|
|
1177
|
+
fun raiseLocalPeerHand(
|
|
1178
|
+
data: ReadableMap,
|
|
1179
|
+
promise: Promise?,
|
|
1180
|
+
) {
|
|
1181
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
1182
|
+
hms?.raiseLocalPeerHand(data, promise)
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
@ReactMethod
|
|
1186
|
+
fun lowerLocalPeerHand(
|
|
1187
|
+
data: ReadableMap,
|
|
1188
|
+
promise: Promise?,
|
|
1189
|
+
) {
|
|
1190
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
1191
|
+
hms?.lowerLocalPeerHand(data, promise)
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
fun lowerRemotePeerHand(
|
|
1195
|
+
data: ReadableMap,
|
|
1196
|
+
promise: Promise?,
|
|
1197
|
+
) {
|
|
1198
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
1199
|
+
hms?.lowerRemotePeerHand(data, promise)
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
1203
|
+
fun getPeerListIterator(data: ReadableMap): WritableMap? {
|
|
1204
|
+
val hms = HMSHelper.getHms(data, hmsCollection) ?: return null
|
|
1205
|
+
return hms.getPeerListIterator(data)
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
@ReactMethod
|
|
1209
|
+
fun peerListIteratorHasNext(
|
|
1210
|
+
data: ReadableMap,
|
|
1211
|
+
promise: Promise?,
|
|
1212
|
+
) {
|
|
1213
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
1214
|
+
hms?.peerListIteratorHasNext(data, promise)
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
@ReactMethod
|
|
1218
|
+
fun peerListIteratorNext(
|
|
1219
|
+
data: ReadableMap,
|
|
1220
|
+
promise: Promise?,
|
|
1221
|
+
) {
|
|
1222
|
+
val hms = HMSHelper.getHms(data, hmsCollection)
|
|
1223
|
+
hms?.peerListIteratorNext(data, promise)
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1131
1226
|
fun emitEvent(
|
|
1132
1227
|
event: String,
|
|
1133
1228
|
data: WritableMap,
|