mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 18:54:11 +00:00
Channels search, add SDWebImage framework
This commit is contained in:
@@ -98,14 +98,6 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func piped(_ instance: Instance) -> PipedAPI {
|
||||
PipedAPI(account: instance.anonymousAccount)
|
||||
}
|
||||
|
||||
func invidious(_ instance: Instance) -> InvidiousAPI {
|
||||
InvidiousAPI(account: instance.anonymousAccount)
|
||||
}
|
||||
|
||||
private func playStream(
|
||||
_ stream: Stream,
|
||||
of video: Video,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import Foundation
|
||||
import Siesta
|
||||
import SwiftUI
|
||||
import AVFoundation
|
||||
|
||||
extension PlayerModel {
|
||||
var isLoadingAvailableStreams: Bool {
|
||||
@@ -101,14 +102,16 @@ extension PlayerModel {
|
||||
func streamsWithInstance(instance: Instance, streams: [Stream]) -> [Stream] {
|
||||
streams.map { stream in
|
||||
stream.instance = instance
|
||||
|
||||
if instance.app == .invidious {
|
||||
stream.audioAsset = AVURLAsset(url: InvidiousAPI.assetURLFrom(instance: instance, url: stream.audioAsset.url)!)
|
||||
stream.videoAsset = AVURLAsset(url: InvidiousAPI.assetURLFrom(instance: instance, url: stream.videoAsset.url)!)
|
||||
}
|
||||
|
||||
return stream
|
||||
}
|
||||
}
|
||||
|
||||
func streamsWithAssetsFromInstance(instance: Instance, streams: [Stream]) -> [Stream] {
|
||||
streams.map { stream in stream.withAssetsFrom(instance) }
|
||||
}
|
||||
|
||||
func streamsSorter(_ lhs: Stream, _ rhs: Stream) -> Bool {
|
||||
lhs.kind == rhs.kind ? (lhs.resolution.height > rhs.resolution.height) : (lhs.kind < rhs.kind)
|
||||
}
|
||||
|
Reference in New Issue
Block a user