Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Front Row/FrontRowApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Created by Joshua Park on 3/4/24.
//

import AVKit
import Sparkle
import SwiftUI

Expand Down Expand Up @@ -34,7 +35,12 @@ struct FrontRowApp: App {
Window("Front Row", id: "main") {
ContentView()
.preferredColorScheme(.dark)
.ignoresSafeArea()
.environment(playEngine)
.navigationTitle(playEngine.fileURL?.lastPathComponent ?? "Front Row")
.navigationDocument(
playEngine.isLocalFile ? playEngine.fileURL! : URL(filePath: "")
)
.sheet(isPresented: $presentedViewManager.isPresentingOpenURLView) {
OpenURLView()
.frame(minWidth: 600)
Expand Down Expand Up @@ -63,7 +69,7 @@ struct FrontRowApp: App {
windowController.setIsFullscreen(false)
}
}
.windowStyle(.hiddenTitleBar)
// .windowStyle(.hiddenTitleBar)
.restorationBehavior(.disabled)
.commands {
AppCommands(updater: updaterController.updater)
Expand Down
4 changes: 4 additions & 0 deletions Front Row/Support/PlayEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import SwiftUI

private(set) var isLocalFile = false

private(set) var fileURL: URL?

private var _currentTime: TimeInterval = 0.0

var currentTime: Double {
Expand Down Expand Up @@ -231,9 +233,11 @@ import SwiftUI
isLoaded = true
isLocalFile = FileManager.default.fileExists(
atPath: url.path(percentEncoded: false))
fileURL = url
case .failed:
isLoaded = false
isLocalFile = false
fileURL = nil
default:
break
}
Expand Down