Skip to content

Commit

Permalink
Adding onTracksUpdated callback
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-daily committed Aug 21, 2024
1 parent 74c6fe9 commit ddb381c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rtvi-client-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ signing {
val signingKey = System.getenv("RTVI_GPG_SIGNING_KEY")
val signingPassphrase = System.getenv("RTVI_GPG_SIGNING_PASSPHRASE")

useInMemoryPgpKeys(signingKey, signingPassphrase)
sign(publishing.publications)
if (!signingKey.isNullOrEmpty() || !signingPassphrase.isNullOrEmpty()) {
useInMemoryPgpKeys(signingKey, signingPassphrase)
sign(publishing.publications)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ai.rtvi.client.types.MediaDeviceInfo
import ai.rtvi.client.types.Participant
import ai.rtvi.client.types.PipecatMetrics
import ai.rtvi.client.types.ServiceConfig
import ai.rtvi.client.types.Tracks
import ai.rtvi.client.types.Transcript
import ai.rtvi.client.types.TransportState

Expand Down Expand Up @@ -127,6 +128,11 @@ abstract class VoiceEventCallbacks {
* Invoked when the state of the input devices changes.
*/
open fun onInputsUpdated(camera: Boolean, mic: Boolean) {}

/**
* Invoked when the set of available cam/mic tracks changes.
*/
open fun onTracksUpdated(tracks: Tracks) {}
}

internal class CallbackInterceptor(vararg listeners: VoiceEventCallbacks): VoiceEventCallbacks() {
Expand Down Expand Up @@ -224,4 +230,8 @@ internal class CallbackInterceptor(vararg listeners: VoiceEventCallbacks): Voice
override fun onInputsUpdated(camera: Boolean, mic: Boolean) {
callbacks.forEach { it.onInputsUpdated(camera = camera, mic = mic) }
}

override fun onTracksUpdated(tracks: Tracks) {
callbacks.forEach { it.onTracksUpdated(tracks) }
}
}

0 comments on commit ddb381c

Please sign in to comment.