mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix selecting best quality stream (fix #54)
This commit is contained in:
parent
975b8fe5c3
commit
a98b4eac83
@ -95,7 +95,9 @@ extension PlayerModel {
|
|||||||
|
|
||||||
switch quality {
|
switch quality {
|
||||||
case .best:
|
case .best:
|
||||||
return streams.first { $0.kind == .hls } ?? streams.first
|
return streams.first { $0.kind == .hls } ??
|
||||||
|
streams.filter { $0.kind == .stream }.max { $0.resolution < $1.resolution } ??
|
||||||
|
streams.first
|
||||||
default:
|
default:
|
||||||
let sorted = streams.filter { $0.kind != .hls }.sorted { $0.resolution > $1.resolution }
|
let sorted = streams.filter { $0.kind != .hls }.sorted { $0.resolution > $1.resolution }
|
||||||
return sorted.first(where: { $0.resolution.height <= quality.value.height })
|
return sorted.first(where: { $0.resolution.height <= quality.value.height })
|
||||||
|
Loading…
Reference in New Issue
Block a user