feat: enhance stream URL handling and add initial offset support in VideoPlayer

This commit is contained in:
2026-03-11 19:51:51 +01:00
parent c9aa36bb5f
commit 4789dca679
5 changed files with 47 additions and 13 deletions

View File

@@ -158,10 +158,14 @@ impl IMediaProvider for JellyfinMediaProvider {
/// Requests H.264 video + AAC audio in an MP4 container so that all
/// major browsers can play it natively. Jellyfin will direct-play if the
/// source already matches; otherwise it transcodes on the fly.
/// A high `VideoBitRate` (40 Mbps) preserves quality on local networks.
/// The API key is embedded in the URL so the player needs no separate auth.
///
/// Note: the caller (stream proxy route) may append `StartTimeTicks` to
/// seek to the correct broadcast offset before returning the URL to the client.
async fn get_stream_url(&self, item_id: &MediaItemId) -> DomainResult<String> {
Ok(format!(
"{}/Videos/{}/stream?videoCodec=h264&audioCodec=aac&container=mp4&api_key={}",
"{}/Videos/{}/stream?videoCodec=h264&audioCodec=aac&container=mp4&VideoBitRate=40000000&api_key={}",
self.config.base_url,
item_id.as_ref(),
self.config.api_key,