diff --git a/android/app/src/main/java/tv/orbit/classic/Idents.kt b/android/app/src/main/java/tv/orbit/classic/Idents.kt index 5d57c787..d972b534 100644 --- a/android/app/src/main/java/tv/orbit/classic/Idents.kt +++ b/android/app/src/main/java/tv/orbit/classic/Idents.kt @@ -121,7 +121,10 @@ internal fun IdentOverlay(session: EmbySampleSession, channel: SampleChannel, ne Box(Modifier.fillMaxSize().graphicsLayer { alpha = fade.value }.background(NightNavy)) { // Reduce motion: the still card (the logo over the next show's picture) instead of a moving ident, so no sting either // (Paul, 7 November 2026: sensory settings shape the ident, sound included). Tots keeps its still goodbye. - val video = if (cameo != null || (settings.reduceMotion && mood == null)) null else block?.video ?: identVideo(channel.number, next.startMs) + // An ident that fails to play (a damaged file, a decoder it can't get) falls back to the silent still card. The ident + // only covers a show's last seconds on the schedule's clock, so it never holds up the next programme either way. + var failed by remember { mutableStateOf(false) } + val video = if (failed || cameo != null || (settings.reduceMotion && mood == null)) null else block?.video ?: identVideo(channel.number, next.startMs) // With idents off, Tots still says goodbye with a picture that doesn't move. if (mood != null && (!settings.idents || settings.reduceMotion)) Image(cachedPainter(mood.still), null, Modifier.fillMaxSize()) // Every third Tots changeover, a drawn bumper with the cast instead of the filmed ident. @@ -141,6 +144,11 @@ internal fun IdentOverlay(session: EmbySampleSession, channel: SampleChannel, ne volume = if (block != null) (if (settings.blockIdentSound) 1f else 0f) else if (mood != null && settings.identSound && !settings.reduceMotion && TotsJingle.take(mood, System.currentTimeMillis())) identVolume(settings.identSoundQuiet) else if (mood == null && settings.identSound && IdentStings.take(channel.number, System.currentTimeMillis())) identVolume(settings.identSoundQuiet) else 0f + addListener(object : androidx.media3.common.Player.Listener { + override fun onPlayerError(error: androidx.media3.common.PlaybackException) { + android.util.Log.w("OrbitSchedule", "ident channel=${channel.number} failed=${error.errorCodeName}"); failed = true + } + }) prepare(); playWhenReady = true } }