mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 00:22:12 +00:00
This commit is contained in:
parent
4ace715a8f
commit
ec6c8c94eb
1 changed files with 10 additions and 1 deletions
|
|
@ -626,9 +626,15 @@ struct MediaInfoView: View {
|
||||||
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
||||||
Logger.shared.log("Opening external app with scheme: \(url)", type: "General")
|
Logger.shared.log("Opening external app with scheme: \(url)", type: "General")
|
||||||
} else {
|
} else {
|
||||||
|
guard let url = URL(string: url) else {
|
||||||
|
Logger.shared.log("Invalid stream URL: \(url)", type: "Error")
|
||||||
|
DropManager.shared.showDrop(title: "Error", subtitle: "Invalid stream URL", duration: 2.0, icon: UIImage(systemName: "xmark.circle"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let customMediaPlayer = CustomMediaPlayerViewController(
|
let customMediaPlayer = CustomMediaPlayerViewController(
|
||||||
module: module,
|
module: module,
|
||||||
urlString: url,
|
urlString: url.absoluteString,
|
||||||
fullUrl: fullURL,
|
fullUrl: fullURL,
|
||||||
title: title,
|
title: title,
|
||||||
episodeNumber: selectedEpisodeNumber,
|
episodeNumber: selectedEpisodeNumber,
|
||||||
|
|
@ -644,6 +650,9 @@ struct MediaInfoView: View {
|
||||||
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 {
|
||||||
findTopViewController.findViewController(rootVC).present(customMediaPlayer, animated: true, completion: nil)
|
findTopViewController.findViewController(rootVC).present(customMediaPlayer, animated: true, completion: nil)
|
||||||
|
} else {
|
||||||
|
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"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue