mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-20 08:02:16 +00:00
ok just some fixes i guess
This commit is contained in:
parent
a9e1328cec
commit
baa42e643c
8 changed files with 15 additions and 10 deletions
|
|
@ -1592,6 +1592,7 @@ class CustomMediaPlayerViewController: UIViewController, UIGestureRecognizerDele
|
||||||
|
|
||||||
self.updateSkipButtonsVisibility()
|
self.updateSkipButtonsVisibility()
|
||||||
|
|
||||||
|
Logger.shared.log(fullUrl, type: "Stream")
|
||||||
UserDefaults.standard.set(self.currentTimeVal, forKey: "lastPlayedTime_\(self.fullUrl)")
|
UserDefaults.standard.set(self.currentTimeVal, forKey: "lastPlayedTime_\(self.fullUrl)")
|
||||||
UserDefaults.standard.set(self.duration, forKey: "totalTime_\(self.fullUrl)")
|
UserDefaults.standard.set(self.duration, forKey: "totalTime_\(self.fullUrl)")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ class VideoPlayerViewController: UIViewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
addPeriodicTimeObserver(fullURL: fullUrl)
|
addPeriodicTimeObserver(fullURL: fullUrl)
|
||||||
|
Logger.shared.log(fullUrl, type: "Stream")
|
||||||
let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(fullUrl)")
|
let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(fullUrl)")
|
||||||
if lastPlayedTime > 0 {
|
if lastPlayedTime > 0 {
|
||||||
let seekTime = CMTime(seconds: lastPlayedTime, preferredTimescale: 1)
|
let seekTime = CMTime(seconds: lastPlayedTime, preferredTimescale: 1)
|
||||||
|
|
@ -208,7 +209,6 @@ class VideoPlayerViewController: UIViewController {
|
||||||
override func viewDidAppear(_ animated: Bool) {
|
override func viewDidAppear(_ animated: Bool) {
|
||||||
super.viewDidAppear(animated)
|
super.viewDidAppear(animated)
|
||||||
|
|
||||||
// Only start normal playback if not launched from SharePlay
|
|
||||||
if !isLaunchedFromSharePlay {
|
if !isLaunchedFromSharePlay {
|
||||||
player?.play()
|
player?.play()
|
||||||
setInitialPlayerRate()
|
setInitialPlayerRate()
|
||||||
|
|
@ -217,7 +217,6 @@ class VideoPlayerViewController: UIViewController {
|
||||||
await checkForFaceTimeAndPromptSharePlay()
|
await checkForFaceTimeAndPromptSharePlay()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// For SharePlay launches, the playback will be coordinated
|
|
||||||
setInitialPlayerRate()
|
setInitialPlayerRate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
// Created by Francesco on 05/01/25.
|
// Created by Francesco on 05/01/25.
|
||||||
//
|
//
|
||||||
|
|
||||||
import Foundation
|
|
||||||
import Network
|
import Network
|
||||||
|
import Foundation
|
||||||
|
|
||||||
class FetchDelegate: NSObject, URLSessionTaskDelegate {
|
class FetchDelegate: NSObject, URLSessionTaskDelegate {
|
||||||
private let allowRedirects: Bool
|
private let allowRedirects: Bool
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ struct ModuleAdditionSettingsView: View {
|
||||||
.fill(Color(.systemGray5))
|
.fill(Color(.systemGray5))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.frame(width: 32, height: 32)
|
.frame(width: 40, height: 40)
|
||||||
.clipShape(Circle())
|
.clipShape(Circle())
|
||||||
.shadow(
|
.shadow(
|
||||||
color: colorScheme == .dark
|
color: colorScheme == .dark
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,6 @@ struct AllBookmarks: View {
|
||||||
}
|
}
|
||||||
Button(action: {
|
Button(action: {
|
||||||
if isSelecting {
|
if isSelecting {
|
||||||
// If trash icon tapped
|
|
||||||
if !selectedBookmarks.isEmpty {
|
if !selectedBookmarks.isEmpty {
|
||||||
for id in selectedBookmarks {
|
for id in selectedBookmarks {
|
||||||
if let item = libraryManager.bookmarks.first(where: { $0.id == id }) {
|
if let item = libraryManager.bookmarks.first(where: { $0.id == id }) {
|
||||||
|
|
|
||||||
|
|
@ -266,12 +266,17 @@ struct AllWatchingView: View {
|
||||||
UserDefaults.standard.set(99999999.0, forKey: key)
|
UserDefaults.standard.set(99999999.0, forKey: key)
|
||||||
UserDefaults.standard.set(99999999.0, forKey: totalKey)
|
UserDefaults.standard.set(99999999.0, forKey: totalKey)
|
||||||
ContinueWatchingManager.shared.remove(item: item)
|
ContinueWatchingManager.shared.remove(item: item)
|
||||||
loadContinueWatchingItems()
|
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
loadContinueWatchingItems()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func removeItem(item: ContinueWatchingItem) {
|
private func removeItem(item: ContinueWatchingItem) {
|
||||||
ContinueWatchingManager.shared.remove(item: item)
|
ContinueWatchingManager.shared.remove(item: item)
|
||||||
loadContinueWatchingItems()
|
DispatchQueue.main.async {
|
||||||
|
loadContinueWatchingItems()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1508,7 +1508,7 @@ struct MediaInfoView: View {
|
||||||
|
|
||||||
alert.addAction(UIAlertAction(title: title, style: .default) { _ in
|
alert.addAction(UIAlertAction(title: title, style: .default) { _ in
|
||||||
guard self.activeFetchID == fetchID else { return }
|
guard self.activeFetchID == fetchID else { return }
|
||||||
self.playStream(url: streamUrl, fullURL: href, subtitles: subtitles, headers: headers, fetchID: fetchID)
|
self.playStream(url: streamUrl, fullURL: fullURL, subtitles: subtitles, headers: headers, fetchID: fetchID)
|
||||||
})
|
})
|
||||||
|
|
||||||
streamIndex += 1
|
streamIndex += 1
|
||||||
|
|
@ -1528,6 +1528,7 @@ struct MediaInfoView: View {
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
guard self.activeFetchID == fetchID else { return }
|
guard self.activeFetchID == fetchID else { return }
|
||||||
|
Logger.shared.log(fullURL, type: "Stream")
|
||||||
|
|
||||||
let externalPlayer = UserDefaults.standard.string(forKey: "externalPlayer") ?? "Sora"
|
let externalPlayer = UserDefaults.standard.string(forKey: "externalPlayer") ?? "Sora"
|
||||||
var scheme: String?
|
var scheme: String?
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,7 @@ struct SubtitleSettingsSection: View {
|
||||||
icon: "captions.bubble",
|
icon: "captions.bubble",
|
||||||
title: NSLocalizedString("Enable Subtitles", comment: ""),
|
title: NSLocalizedString("Enable Subtitles", comment: ""),
|
||||||
isOn: $subtitlesEnabled,
|
isOn: $subtitlesEnabled,
|
||||||
showDivider: false
|
showDivider: true
|
||||||
)
|
)
|
||||||
.onChange(of: subtitlesEnabled) { newValue in
|
.onChange(of: subtitlesEnabled) { newValue in
|
||||||
SubtitleSettingsManager.shared.update { settings in
|
SubtitleSettingsManager.shared.update { settings in
|
||||||
|
|
@ -454,4 +454,4 @@ struct SubtitleSettingsSection: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue