Live streams fix (fix #174, #175)

This commit is contained in:
Arkadiusz Fal
2022-07-22 00:44:21 +02:00
parent 827c64719c
commit e6baaa519a
8 changed files with 81 additions and 20 deletions

View File

@@ -132,6 +132,8 @@ final class AVPlayerBackend: PlayerBackend {
}
func seek(to time: CMTime, completionHandler: ((Bool) -> Void)?) {
guard !model.live else { return }
avPlayer.seek(
to: time,
toleranceBefore: .secondsInDefaultTimescale(1),

View File

@@ -140,6 +140,8 @@ final class MPVClient: ObservableObject {
options.append("sub-files-append=\"\(subURL)\"")
}
options.append("force-seekable=yes")
args.append(options.joined(separator: ","))
command("loadfile", args: args, returnValueCallback: completionHandler)