mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-03-25 09:05:52 +00:00
Added new delegate function
This commit is contained in:
parent
a94043d5ac
commit
a98f190828
2 changed files with 17 additions and 1 deletions
|
|
@ -1049,6 +1049,9 @@ extension SwiftyCamViewController : AVCaptureFileOutputRecordingDelegate {
|
|||
}
|
||||
if error != nil {
|
||||
print("[SwiftyCam]: Movie file finishing error: \(error)")
|
||||
DispatchQueue.main.async {
|
||||
self.cameraDelegate?.swiftyCam(self, didFailToRecordVideo: error)
|
||||
}
|
||||
} else {
|
||||
//Call delegate function with the URL of the outputfile
|
||||
DispatchQueue.main.async {
|
||||
|
|
|
|||
|
|
@ -58,6 +58,15 @@ public protocol SwiftyCamViewControllerDelegate: class {
|
|||
|
||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishProcessVideoAt url: URL)
|
||||
|
||||
|
||||
/**
|
||||
SwiftyCamViewControllerDelegate function called when SwiftyCamViewController fails to record a video.
|
||||
|
||||
- Parameter swiftyCam: Current SwiftyCamViewController session
|
||||
- Parameter error: An error object that describes the problem
|
||||
*/
|
||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFailToRecordVideo error: Error)
|
||||
|
||||
/**
|
||||
SwiftyCamViewControllerDelegate function called when SwiftyCamViewController switches between front or rear camera.
|
||||
|
||||
|
|
@ -65,6 +74,7 @@ public protocol SwiftyCamViewControllerDelegate: class {
|
|||
- Parameter camera: Current camera selection
|
||||
*/
|
||||
|
||||
|
||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection)
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +117,10 @@ public extension SwiftyCamViewControllerDelegate {
|
|||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishProcessVideoAt url: URL) {
|
||||
// Optional
|
||||
}
|
||||
|
||||
|
||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFailToRecordVideo error: Error) {
|
||||
// Optional
|
||||
}
|
||||
|
||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection) {
|
||||
// Optional
|
||||
|
|
|
|||
Loading…
Reference in a new issue