Playback rate

This commit is contained in:
Arkadiusz Fal
2021-06-19 22:10:14 +02:00
parent c40fc3e042
commit bb19fca073
9 changed files with 105 additions and 11 deletions

View File

@@ -88,6 +88,14 @@ final class Video: Identifiable, ObservableObject {
selectableStreams.min { $0.resolution > $1.resolution }
}
func streamWithResolution(_ resolution: StreamResolution) -> Stream? {
selectableStreams.first { $0.resolution == resolution }
}
func defaultStreamForProfile(_ profile: Profile) -> Stream? {
streamWithResolution(profile.defaultStreamResolution.value)
}
private func extractThumbnailURL(from details: JSON) -> URL? {
if details["videoThumbnails"].arrayValue.isEmpty {
return nil