-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
much improvements to the video player UI + to the settingts
- Loading branch information
Showing
10 changed files
with
273 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// PlayerExtension.swift | ||
// Osmium | ||
// | ||
// Created by Francesco on 30/05/24. | ||
// | ||
|
||
import UIKit | ||
|
||
extension VideoPlayerViewController: UIDocumentPickerDelegate { | ||
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) { | ||
guard let url = urls.first else { return } | ||
dismiss(animated: true, completion: nil) | ||
|
||
videoURL = url | ||
playVideo() | ||
} | ||
|
||
func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) { | ||
dismiss(animated: true, completion: nil) | ||
} | ||
} | ||
|
||
extension VideoPlayerViewController { | ||
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { | ||
picker.dismiss(animated: true, completion: nil) | ||
|
||
if let mediaURL = info[.mediaURL] as? URL { | ||
videoURL = mediaURL | ||
playVideo() | ||
} | ||
} | ||
|
||
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { | ||
picker.dismiss(animated: true, completion: nil) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// Save-Debug.swift | ||
// Osmium | ||
// | ||
// Created by Francesco on 30/05/24. | ||
// | ||
|
||
import UIKit | ||
|
||
extension ViewController { | ||
|
||
@objc func handleSaveMedia(_ notification: Notification) { | ||
guard let userInfo = notification.userInfo, | ||
let isEnabled = userInfo["saveMedia"] as? Bool else { | ||
return | ||
} | ||
self.saveMedia = isEnabled | ||
} | ||
|
||
@objc func handleDebug(_ notification: Notification) { | ||
guard let userInfo = notification.userInfo, | ||
let isEnabled = userInfo["debugPlease"] as? Bool else { | ||
return | ||
} | ||
self.debug = isEnabled | ||
} | ||
|
||
} |
Oops, something went wrong.