mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
Fix player instance setting (fix #260)
This commit is contained in:
@@ -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 []
|
||||
|
@@ -517,7 +517,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
||||
var streams = [Stream]()
|
||||
|
||||
if let hlsURL = content.dictionaryValue["hls"]?.url {
|
||||
streams.append(Stream(hlsURL: hlsURL))
|
||||
streams.append(Stream(instance: account.instance, hlsURL: hlsURL))
|
||||
}
|
||||
|
||||
let audioStreams = content
|
||||
@@ -560,6 +560,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
||||
if videoOnly {
|
||||
streams.append(
|
||||
Stream(
|
||||
instance: account.instance,
|
||||
audioAsset: audioAsset,
|
||||
videoAsset: videoAsset,
|
||||
resolution: resolution,
|
||||
@@ -569,7 +570,12 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
||||
)
|
||||
} else {
|
||||
streams.append(
|
||||
SingleAssetStream(avAsset: videoAsset, resolution: resolution, kind: .stream)
|
||||
SingleAssetStream(
|
||||
instance: account.instance,
|
||||
avAsset: videoAsset,
|
||||
resolution: resolution,
|
||||
kind: .stream
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user