mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-20 08:16:25 +00:00
feat(player): add mpv cache and buffer configuration
This commit is contained in:
@@ -29,7 +29,10 @@ public class MpvPlayerModule: Module {
|
||||
guard let source = source,
|
||||
let urlString = source["url"] as? String,
|
||||
let videoURL = URL(string: urlString) else { return }
|
||||
|
||||
|
||||
// Parse cache config if provided
|
||||
let cacheConfig = source["cacheConfig"] as? [String: Any]
|
||||
|
||||
let config = VideoLoadConfig(
|
||||
url: videoURL,
|
||||
headers: source["headers"] as? [String: String],
|
||||
@@ -37,9 +40,13 @@ public class MpvPlayerModule: Module {
|
||||
startPosition: source["startPosition"] as? Double,
|
||||
autoplay: (source["autoplay"] as? Bool) ?? true,
|
||||
initialSubtitleId: source["initialSubtitleId"] as? Int,
|
||||
initialAudioId: source["initialAudioId"] as? Int
|
||||
initialAudioId: source["initialAudioId"] as? Int,
|
||||
cacheEnabled: cacheConfig?["enabled"] as? String,
|
||||
cacheSeconds: cacheConfig?["cacheSeconds"] as? Int,
|
||||
demuxerMaxBytes: cacheConfig?["maxBytes"] as? Int,
|
||||
demuxerMaxBackBytes: cacheConfig?["maxBackBytes"] as? Int
|
||||
)
|
||||
|
||||
|
||||
view.loadVideo(config: config)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user