fix(playback): bypass cache for live streams opened via ZoomableContentView

Live streams routed through the Live Streams tab go through ShowVideoStreaming
→ ZoomableContentView, not LiveActivity.kt. ZoomableContentView is generic
and was calling VideoView without isLiveStream=true, so live stream segments
ended up in SimpleCache. The cached HLS manifest then went stale (live
manifests roll constantly) and playback stopped after ~30 seconds.

Plumb the flag through the data model: add isLiveStream to MediaUrlVideo,
set it true when ShowVideoStreaming constructs the model, and pass it from
ZoomableContentView into VideoView. URL heuristic (.m3u8) wasn't viable —
that would also bypass cache for on-demand NIP-71 multi-rendition videos
and defeat the original feature.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
davotoula
2026-04-21 19:42:33 +01:00
parent 0218653a9c
commit 63454761ef
3 changed files with 3 additions and 0 deletions
@@ -203,6 +203,7 @@ fun ZoomableContentView(
onDialog = { dialogOpen = true },
accountViewModel = accountViewModel,
thumbhash = content.thumbhash,
isLiveStream = content.isLiveStream,
)
}
}
@@ -53,6 +53,7 @@ fun ShowVideoStreaming(
artworkUri = event.image(),
authorName = baseChannel.creatorName(),
uri = baseChannel.toNAddr(),
isLiveStream = true,
)
}
@@ -97,6 +97,7 @@ open class MediaUrlVideo(
val contentWarning: String? = null,
mimeType: String? = null,
thumbhash: String? = null,
val isLiveStream: Boolean = false,
) : MediaUrlContent(url, description, hash, dim, blurhash, uri, mimeType, thumbhash)
@Immutable