mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
This commit is contained in:
parent
da6106ab3b
commit
b7260b41b1
3 changed files with 8 additions and 6 deletions
|
|
@ -47,17 +47,19 @@ class VideoPlayerViewController: UIViewController {
|
|||
let playerItem = AVPlayerItem(asset: asset)
|
||||
|
||||
player = AVPlayer(playerItem: playerItem)
|
||||
|
||||
playerViewController = NormalPlayer()
|
||||
playerViewController?.player = player
|
||||
addPeriodicTimeObserver(fullURL: fullUrl)
|
||||
|
||||
if let playerViewController = playerViewController {
|
||||
playerViewController.view.frame = self.view.frame
|
||||
self.view.addSubview(playerViewController.view)
|
||||
self.addChild(playerViewController)
|
||||
addChild(playerViewController)
|
||||
playerViewController.view.frame = view.bounds
|
||||
playerViewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
||||
view.addSubview(playerViewController.view)
|
||||
playerViewController.didMove(toParent: self)
|
||||
}
|
||||
|
||||
addPeriodicTimeObserver(fullURL: fullUrl)
|
||||
let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(fullUrl)")
|
||||
if lastPlayedTime > 0 {
|
||||
let seekTime = CMTime(seconds: lastPlayedTime, preferredTimescale: 1)
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ struct MediaInfoView: View {
|
|||
}
|
||||
|
||||
private func openSafariViewController(with urlString: String) {
|
||||
guard let url = URL(string: urlString) else {
|
||||
guard let url = URL(string: urlString), UIApplication.shared.canOpenURL(url) else {
|
||||
Logger.shared.log("Unable to open the webpage", type: "Error")
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@
|
|||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:/Users/Francesco/Documents/GitHub/Sora/Sulfur.xcodeproj">
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
|
|||
Loading…
Reference in a new issue