mirror of
https://github.com/samsonjs/SwiftyCam.git
synced 2026-04-27 15:07:43 +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 {
|
if error != nil {
|
||||||
print("[SwiftyCam]: Movie file finishing error: \(error)")
|
print("[SwiftyCam]: Movie file finishing error: \(error)")
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.cameraDelegate?.swiftyCam(self, didFailToRecordVideo: error)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//Call delegate function with the URL of the outputfile
|
//Call delegate function with the URL of the outputfile
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,15 @@ public protocol SwiftyCamViewControllerDelegate: class {
|
||||||
|
|
||||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFinishProcessVideoAt url: URL)
|
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.
|
SwiftyCamViewControllerDelegate function called when SwiftyCamViewController switches between front or rear camera.
|
||||||
|
|
||||||
|
|
@ -65,6 +74,7 @@ public protocol SwiftyCamViewControllerDelegate: class {
|
||||||
- Parameter camera: Current camera selection
|
- Parameter camera: Current camera selection
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection)
|
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -108,6 +118,9 @@ public extension SwiftyCamViewControllerDelegate {
|
||||||
// Optional
|
// Optional
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didFailToRecordVideo error: Error) {
|
||||||
|
// Optional
|
||||||
|
}
|
||||||
|
|
||||||
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection) {
|
func swiftyCam(_ swiftyCam: SwiftyCamViewController, didSwitchCameras camera: SwiftyCamViewController.CameraSelection) {
|
||||||
// Optional
|
// Optional
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue