From ddb381c2478f3bbcbabc783b20ddfbbc789f2b03 Mon Sep 17 00:00:00 2001 From: marcus-daily <111281783+marcus-daily@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:14:30 +0100 Subject: [PATCH] Adding onTracksUpdated callback --- rtvi-client-android/build.gradle.kts | 6 ++++-- .../main/java/ai/rtvi/client/VoiceEventCallbacks.kt | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/rtvi-client-android/build.gradle.kts b/rtvi-client-android/build.gradle.kts index 853e83e..2ee6d0a 100644 --- a/rtvi-client-android/build.gradle.kts +++ b/rtvi-client-android/build.gradle.kts @@ -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) + } } \ No newline at end of file diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceEventCallbacks.kt b/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceEventCallbacks.kt index 2554ae4..f0fed77 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceEventCallbacks.kt +++ b/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceEventCallbacks.kt @@ -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 @@ -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() { @@ -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) } + } } \ No newline at end of file