mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 08:32:00 +00:00
parent
50640acb19
commit
26fce675aa
1 changed files with 10 additions and 9 deletions
|
|
@ -1352,8 +1352,9 @@ struct MediaInfoView: View {
|
||||||
videoPlayerViewController.aniListID = itemID ?? 0
|
videoPlayerViewController.aniListID = itemID ?? 0
|
||||||
videoPlayerViewController.modalPresentationStyle = .fullScreen
|
videoPlayerViewController.modalPresentationStyle = .fullScreen
|
||||||
|
|
||||||
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, let rootVC = windowScene.windows.first?.rootViewController {
|
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
||||||
rootVC.present(videoPlayerViewController, animated: true, completion: nil)
|
let rootVC = windowScene.windows.first?.rootViewController {
|
||||||
|
findTopViewController.findViewController(rootVC).present(videoPlayerViewController, animated: true, completion: nil)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
|
|
@ -1392,13 +1393,13 @@ struct MediaInfoView: View {
|
||||||
customMediaPlayer.modalPresentationStyle = .fullScreen
|
customMediaPlayer.modalPresentationStyle = .fullScreen
|
||||||
Logger.shared.log("Opening custom media player with url: \(url)")
|
Logger.shared.log("Opening custom media player with url: \(url)")
|
||||||
|
|
||||||
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
||||||
let rootVC = windowScene.windows.first?.rootViewController {
|
let rootVC = windowScene.windows.first?.rootViewController {
|
||||||
rootVC.present(customMediaPlayer, animated: true, completion: nil)
|
findTopViewController.findViewController(rootVC).present(customMediaPlayer, animated: true, completion: nil)
|
||||||
} else {
|
} else {
|
||||||
Logger.shared.log("Failed to find root view controller", type: "Error")
|
Logger.shared.log("Failed to find root view controller", type: "Error")
|
||||||
DropManager.shared.showDrop(title: "Error", subtitle: "Failed to present player", duration: 2.0, icon: UIImage(systemName: "xmark.circle"))
|
DropManager.shared.showDrop(title: "Error", subtitle: "Failed to present player", duration: 2.0, icon: UIImage(systemName: "xmark.circle"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue