From 9100b7cf7196ea86f4c06376f4be652ca83de7d5 Mon Sep 17 00:00:00 2001 From: marcus-daily <111281783+marcus-daily@users.noreply.github.com> Date: Wed, 21 Aug 2024 13:18:22 +0100 Subject: [PATCH] Adding `expiry` field to VoiceClient/Transport --- .../src/main/java/ai/rtvi/client/VoiceClient.kt | 7 +++++++ .../src/main/java/ai/rtvi/client/transport/Transport.kt | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceClient.kt b/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceClient.kt index 37dac1a..abfca18 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceClient.kt +++ b/rtvi-client-android/src/main/java/ai/rtvi/client/VoiceClient.kt @@ -466,6 +466,13 @@ open class VoiceClient( val isCamEnabled get() = transport.isCamEnabled() + /** + * The expiry time for the transport session, if applicable. Measured in seconds + * since the UNIX epoch (UTC). + */ + val expiry + get() = transport.expiry() + /** * Returns a list of participant media tracks. */ diff --git a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/Transport.kt b/rtvi-client-android/src/main/java/ai/rtvi/client/transport/Transport.kt index 9287ac6..904bd79 100644 --- a/rtvi-client-android/src/main/java/ai/rtvi/client/transport/Transport.kt +++ b/rtvi-client-android/src/main/java/ai/rtvi/client/transport/Transport.kt @@ -34,6 +34,12 @@ abstract class Transport { abstract fun isCamEnabled(): Boolean abstract fun isMicEnabled(): Boolean + /** + * The expiry time for the transport session, if applicable. Measured in seconds + * since the UNIX epoch (UTC). + */ + abstract fun expiry(): Long? + abstract fun sendMessage(message: MsgClientToServer): Future abstract fun state(): TransportState