mirror of
https://github.com/yattee/yattee.git
synced 2025-11-24 18:28:20 +00:00
Prefer fast-loading formats when switching to AVPlayer
When switching from MPV to AVPlayer, prioritize HLS and stream formats over non-streamable MP4/AVC1 formats to avoid long loading times. Changes: - Added isFastLoadingFormat() helper to AVPlayerBackend - Modified streamByQualityProfile to prefer fast-loading formats for AVPlayer - Falls back to non-streamable formats only if no fast-loading option exists - Ensures quick backend switching without waiting for metadata download
This commit is contained in:
@@ -178,6 +178,12 @@ final class AVPlayerBackend: PlayerBackend {
|
||||
return stream.kind == .hls || stream.kind == .stream
|
||||
}
|
||||
|
||||
func isFastLoadingFormat(_ stream: Stream) -> Bool {
|
||||
// HLS and stream formats load quickly
|
||||
// Non-streamable MP4/AVC1 formats may take a long time
|
||||
return stream.kind == .hls || stream.kind == .stream
|
||||
}
|
||||
|
||||
func playStream(
|
||||
_ stream: Stream,
|
||||
of video: Video,
|
||||
|
||||
Reference in New Issue
Block a user