Skip to content

Commit

Permalink
Release 1.9.10: Develop to main (#1324)
Browse files Browse the repository at this point in the history
# Description

- Release 1.9.10: Develop to main

### Pre-launch Checklist

- [x] The [Documentation] is updated accordingly, or this PR doesn't
require it.
- [x] I have updated the `ExampleAppChangelog.txt` file with relevant
changes.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making, or this PR is
test-exempt.
- [x] All existing and new tests are passing.

<!-- Links -->

[Documentation]: https://www.100ms.live/docs
  • Loading branch information
ygit authored Feb 16, 2024
2 parents affc7a9 + 2bb3ce7 commit 32c2e91
Show file tree
Hide file tree
Showing 130 changed files with 7,770 additions and 1,443 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ object HMSDecoder {
permissions.putBoolean("hlsStreaming", hmsPermissions.hlsStreaming)
permissions.putBoolean("rtmpStreaming", hmsPermissions.rtmpStreaming)
permissions.putBoolean("changeRole", hmsPermissions.changeRole)
permissions.putBoolean("pollRead", hmsPermissions.pollRead)
permissions.putBoolean("pollWrite", hmsPermissions.pollWrite)
}
return permissions
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class HMSManager(reactContext: ReactApplicationContext) :
hms?.getAuthTokenByRoomCode(data, promise)
}

// region Person-In-Person Mode Action handing
// region Picture-In-Picture Mode Action handing
private val pipReceiver by lazy {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
PipActionReceiver(
Expand Down Expand Up @@ -1342,6 +1342,64 @@ class HMSManager(reactContext: ReactApplicationContext) :
.emit(event, data)
}

// region Polls
@ReactMethod
fun quickStartPoll(
data: ReadableMap,
promise: Promise?,
) {
val rnSDK = HMSHelper.getHms(data, hmsCollection)
rnSDK?.let { sdk ->
sdk.interactivityCenter?.let { center ->
center.quickStartPoll(data, promise)
return
}
}
promise?.reject(
"6004",
"HMS SDK not initialized",
)
}

@ReactMethod
fun addResponseOnPollQuestion(
data: ReadableMap,
promise: Promise?,
) {
val rnSDK = HMSHelper.getHms(data, hmsCollection)
rnSDK?.let { sdk ->
sdk.interactivityCenter?.let { center ->
center.addResponseOnPollQuestion(data, promise)
return
}
}
promise?.reject(
"6004",
"HMS SDK not initialized",
)
}

@ReactMethod
fun stopPoll(
data: ReadableMap,
promise: Promise?,
) {
val rnSDK = HMSHelper.getHms(data, hmsCollection)
rnSDK?.let { sdk ->
sdk.interactivityCenter?.let { center ->
center.stop(data, promise)
return
}
}
promise?.reject(
"6004",
"HMS SDK not initialized",
)
}
// endregion

// region ActivityLifecycleCallbacks

override fun onActivityCreated(
activity: Activity,
savedInstanceState: Bundle?,
Expand Down Expand Up @@ -1377,7 +1435,8 @@ class HMSManager(reactContext: ReactApplicationContext) :
}
}
} catch (e: Exception) {
// Log.d("error", e.message)
}
}

// endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ class HMSRNSDK(
private var audioMixingMode: AudioMixingMode = AudioMixingMode.TALK_AND_MUSIC
private var id: String = sdkId
private var self = this
private var eventsEnableStatus = mutableMapOf<String, Boolean>()
var eventsEnableStatus = mutableMapOf<String, Boolean>()
private var sessionStore: HmsSessionStore? = null
private val keyChangeObservers = mutableMapOf<String, HMSKeyChangeListener?>()
private val peerListIterators = mutableMapOf<String, PeerListIterator>()
private var roomMutedLocally = false

var interactivityCenter: HMSRNInteractivityCenter? = null

init {
val builder = HMSSDK.Builder(reactApplicationContext)
if (HMSHelper.areAllRequiredKeysAvailable(data, arrayOf(Pair("trackSettings", "Map")))) {
Expand Down Expand Up @@ -85,6 +87,10 @@ class HMSRNSDK(
}

this.hmsSDK = builder.build()

hmsSDK?.let {
interactivityCenter = HMSRNInteractivityCenter(it, this)
}
}

private fun emitCustomError(message: String) {
Expand Down Expand Up @@ -1698,15 +1704,16 @@ class HMSRNSDK(
if (eventsEnableStatus["ON_AUDIO_DEVICE_CHANGED"] != true) {
return
}

val data: WritableMap = Arguments.createMap()
data.putString("device", selectedAudioDevice.name)
data.putArray("audioDevicesList", HMSHelper.getAudioDevicesSet(availableAudioDevices))
data.putString("id", id)
delegate.emitEvent("ON_AUDIO_DEVICE_CHANGED", data)
}

override fun onError(error: HMSException) {
self.emitHMSError(error)
override fun onError(e: HMSException) {
self.emitHMSError(e)
}
},
)
Expand Down
Loading

0 comments on commit 32c2e91

Please sign in to comment.