Fix player instance setting (fix #260)

This commit is contained in:
Arkadiusz Fal
2022-08-16 23:16:35 +02:00
parent 30889619fd
commit 3a508b98ab
10 changed files with 42 additions and 25 deletions

View File

@@ -509,6 +509,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
}
return SingleAssetStream(
instance: account.instance,
avAsset: AVURLAsset(url: streamURL),
resolution: Stream.Resolution.from(resolution: stream["resolution"].string ?? ""),
kind: .stream,
@@ -538,6 +539,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
}
return Stream(
instance: account.instance,
audioAsset: AVURLAsset(url: audioAssetURL),
videoAsset: AVURLAsset(url: videoAssetURL),
resolution: Stream.Resolution.from(resolution: videoStream["resolution"].stringValue),
@@ -550,7 +552,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
private func extractHLSStreams(from content: JSON) -> [Stream] {
if let hlsURL = content.dictionaryValue["hlsUrl"]?.url {
return [Stream(hlsURL: hlsURL)]
return [Stream(instance: account.instance, hlsURL: hlsURL)]
}
return []