From bf00809766d8710382d66e419a9315a953bac74e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaquim=20St=C3=A4hli?= Date: Mon, 24 Jul 2023 15:24:17 +0200 Subject: [PATCH] Uptime is send only when time shift <= 30 seconds (#185) --- .../business/tracker/commandersact/CommandersActStreaming.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActStreaming.kt b/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActStreaming.kt index 91d0370ae..31bce6b79 100644 --- a/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActStreaming.kt +++ b/pillarbox-core-business/src/main/java/ch/srgssr/pillarbox/core/business/tracker/commandersact/CommandersActStreaming.kt @@ -154,6 +154,7 @@ internal class CommandersActStreaming( } private fun notifyUptime(position: Duration) { + if (getTimeshift(position) > LIVE_EDGE_THRESHOLD) return notifyEvent(MediaEventType.Uptime, position) } @@ -194,5 +195,6 @@ internal class CommandersActStreaming( internal var UPTIME_PERIOD = 60.seconds internal var POS_PERIOD = 30.seconds private const val VALID_SEEK_THRESHOLD: Long = 1000L + private val LIVE_EDGE_THRESHOLD = 60.seconds } }