Local videos fixes

This commit is contained in:
Arkadiusz Fal
2022-11-11 19:19:48 +01:00
parent 4cb9e24796
commit 80d8d66986
4 changed files with 12 additions and 7 deletions

View File

@@ -806,7 +806,7 @@ final class PlayerModel: ObservableObject {
#if os(macOS)
var windowTitle: String {
currentVideo.isNil ? "Not Playing" : "\(currentVideo!.title) - \(currentVideo!.author)"
currentVideo.isNil ? "Not Playing" : "\(currentVideo!.displayTitle) - \(currentVideo!.displayAuthor)"
}
#else
func handleEnterForeground() {

View File

@@ -59,16 +59,21 @@ extension PlayerModel {
DispatchQueue.main.async { [weak self] in
guard let self else { return }
guard let video = self.currentVideo else {
guard let video = item.video else {
return
}
self.videoBeingOpened = nil
if video.isLocal {
self.availableStreams = video.streams
return
}
guard let playerInstance = self.playerInstance else { return }
let streamsInstance = video.streams.compactMap(\.instance).first
if !video.isLocal, video.streams.isEmpty || streamsInstance != playerInstance {
if video.streams.isEmpty || streamsInstance != playerInstance {
self.loadAvailableStreams(video)
} else {
self.availableStreams = self.streamsWithInstance(instance: playerInstance, streams: video.streams)