more consolidation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Plugin.SRFPlay.Api.Models;
|
||||
@@ -78,16 +79,18 @@ public class MediaSourceFactory : IMediaSourceFactory
|
||||
itemId,
|
||||
isLiveStream);
|
||||
|
||||
// Create MediaSourceInfo with minimal settings to let clients determine playback
|
||||
// Don't specify Container or MediaStreams - let the .m3u8 path trigger HLS detection
|
||||
// Create MediaSourceInfo with codec info so clients know they can direct play
|
||||
// Provide MediaStreams with H.264+AAC so Android TV/ExoPlayer doesn't trigger transcoding
|
||||
var mediaStreams = CreateMediaStreams(qualityPreference);
|
||||
|
||||
var mediaSource = new MediaSourceInfo
|
||||
{
|
||||
Id = itemId,
|
||||
Name = chapter.Title,
|
||||
Path = proxyUrl,
|
||||
Protocol = MediaProtocol.Http,
|
||||
// Empty container - let clients detect HLS from .m3u8 extension
|
||||
Container = string.Empty,
|
||||
// Use "hls" to trigger hls.js player in web client
|
||||
Container = "hls",
|
||||
SupportsDirectStream = true,
|
||||
SupportsDirectPlay = true,
|
||||
SupportsTranscoding = false,
|
||||
@@ -98,15 +101,13 @@ public class MediaSourceFactory : IMediaSourceFactory
|
||||
IsInfiniteStream = isLiveStream,
|
||||
RequiresOpening = false,
|
||||
RequiresClosing = false,
|
||||
// Disable probing - we provide stream info directly
|
||||
SupportsProbing = false,
|
||||
ReadAtNativeFramerate = isLiveStream,
|
||||
// Don't specify MediaStreams - let client determine codec compatibility
|
||||
MediaStreams = new List<MediaStream>(),
|
||||
// Reduce analyze duration for faster startup (3000ms is Jellyfin default, 1000ms for live)
|
||||
// Provide codec info so clients know they can direct play H.264+AAC
|
||||
MediaStreams = mediaStreams.ToList(),
|
||||
AnalyzeDurationMs = isLiveStream ? 1000 : 3000,
|
||||
// Ignore DTS timestamps for live streams to avoid sync issues
|
||||
IgnoreDts = isLiveStream,
|
||||
// Ignore index for live streams
|
||||
IgnoreIndex = isLiveStream,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user