Skip to content

Commit

Permalink
feat: add resumeAudioTrack method to android native
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed Dec 12, 2024
1 parent b000f2e commit 17b854e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ dependencies {
// noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:${ReactNative.ext.getVersion("android", "kotlin")}"
implementation("com.sendbird.sdk:sendbird-calls:1.11.10")
implementation("com.sendbird.sdk:sendbird-calls:1.12.1")
}

ReactNative.shared.applyPackageVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,13 @@ class CallsDirectCallModule(private val root: CallsModule): DirectCallModule {
CallsUtils.findDirectCall(identifier, from).resumeVideoCapturer()
}
}

override fun resumeAudioTrack(type: String, identifier: String) {
val from = "directCall/resumeAudioTrack"
RNCallsLogger.d("[DirectCallModule] $from ($identifier)")

CallsUtils.safeRun {
CallsUtils.findDirectCall(identifier, from).resumeAudioTrack()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,13 @@ class CallsGroupCallModule: GroupCallModule {
CallsUtils.findRoom(identifier, from).localParticipant?.resumeVideoCapturer()
}
}

override fun resumeAudioTrack(type: String, identifier: String) {
val from = "groupCall/resumeAudioTrack"
RNCallsLogger.d("[GroupCallModule] $from ($identifier)")

CallsUtils.safeRun {
CallsUtils.findRoom(identifier, from).localParticipant?.resumeAudioTrack()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class CallsModule(val reactContext: ReactApplicationContext) : CallsModuleStruct
override fun selectAudioDevice(type: String, identifier: String, device: String, promise: Promise) = getControllableModule(type).selectAudioDevice(type, identifier, device, promise)
override fun selectVideoDevice(type: String, identifier: String, device: ReadableMap, promise: Promise) = getControllableModule(type).selectVideoDevice(type, identifier, device, promise)
override fun resumeVideoCapturer(type: String, identifier: String) = getControllableModule(type).resumeVideoCapturer(type, identifier)
override fun resumeAudioTrack(type: String, identifier: String) = getControllableModule(type).resumeAudioTrack(type, identifier)

/** DirectCall module interface **/
override fun accept(callId: String, options: ReadableMap, holdActiveCall: Boolean, promise: Promise) = directCallModule.accept(callId, options, holdActiveCall, promise)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ interface MediaDeviceControl {
fun selectAudioDevice(type: String, identifier: String, device: String, promise: Promise)
fun selectVideoDevice(type: String, identifier: String, device: ReadableMap, promise: Promise)
fun resumeVideoCapturer(type: String, identifier: String)
fun resumeAudioTrack(type: String, identifier: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class RNSendbirdCallsModule(private val reactContext: ReactApplicationContext) :
override fun selectVideoDevice(type: String, identifier: String, device: ReadableMap, promise: Promise) = module.selectVideoDevice(type, identifier, device, promise)
@ReactMethod
override fun resumeVideoCapturer(type: String, identifier: String) = module.resumeVideoCapturer(type, identifier)
@ReactMethod
override fun resumeAudioTrack(type: String, identifier: String) = module.resumeAudioTrack(type, identifier)

/** DirectCall **/
@ReactMethod
Expand Down

0 comments on commit 17b854e

Please sign in to comment.