mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 14:20:32 +05:30
Limit formats available to AVPlayer
This commit is contained in:
parent
b15d024f88
commit
ba6b148a75
@ -62,13 +62,11 @@ final class AVPlayerBackend: PlayerBackend {
|
|||||||
|
|
||||||
func bestPlayable(_ streams: [Stream], maxResolution _: ResolutionSetting) -> Stream? {
|
func bestPlayable(_ streams: [Stream], maxResolution _: ResolutionSetting) -> Stream? {
|
||||||
streams.first { $0.kind == .hls } ??
|
streams.first { $0.kind == .hls } ??
|
||||||
streams.filter { $0.kind == .adaptive }.max { $0.resolution < $1.resolution } ??
|
streams.max { $0.resolution < $1.resolution }
|
||||||
streams.first
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func canPlay(_ stream: Stream) -> Bool {
|
func canPlay(_ stream: Stream) -> Bool {
|
||||||
stream.kind == .hls || stream.kind == .stream || stream.videoFormat == "MPEG_4" ||
|
stream.kind == .hls || (stream.kind == .stream && stream.resolution.height <= 720)
|
||||||
(stream.videoFormat.starts(with: "video/mp4") && stream.encoding == "h264")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func playStream(
|
func playStream(
|
||||||
|
Loading…
Reference in New Issue
Block a user