QEDMediaCaptureAndPlayViewControllerDelegate
public protocol QEDMediaCaptureAndPlayViewControllerDelegate : AnyObject
A class conforming to this protocol will receive the necessary method calls to handle the lifecycle for the media playback, capture and deletion from a QEDMediaCaptureAndPlayViewController.
-
Asks the delegate if a local media file can be deleted.
Important
Returningtruedoes not trigger file deletion, but a delete button will be made available to the user. File deletion can then be triggered by the user by tapping on the delete button.Declaration
Swift
func mediaCaptureAndPlayViewController(_ controller: QEDMediaCaptureAndPlayViewController, allowToDeleteFileAt fileURL: URL) -> BoolParameters
controllerThe controller object informing the delegate of this event
fileURLThe local URL for the file the request is made for
Return Value
trueif the file atfileURLcould be deleted by the user, otherwisefalse. -
Tells the delegate a file deletion has been requested for a local file.
Note
The controller implementation will attempt to delete the file from the file system, but if it fails, will do silently. It is up to your implemnetation to check that the file has been actually deleted if necessary.
After calling this method the controller will clear its reference to the reported
fileURLDeclaration
Swift
func mediaCaptureAndPlayViewController(_ controller: QEDMediaCaptureAndPlayViewController, fileDeletionRequestedFor fileURL: URL)Parameters
controllerThe controller object informing the delegate of this event
fileURLThe local URL for the file that has been requested for deletion
-
Tells the delegate the user has finished capturing a new media file
Important
When this method is called, the user has ended capturing a media file which is now available atfileURL. You must not delete this file as the controller has now switched to playback mode and expects the existence of the media file atfileURLYou can choose to act on this request and trigger your logic for new media files, but be aware that the user can still trigger file deletion for the new media. It is recommended instead to handle new media logic once the user has requested to dismiss the controller. For more info on this, see
mediaCaptureAndPlayViewController(_:dismissalRequestWithNewRecordedFileAt:reason:)Declaration
Swift
func mediaCaptureAndPlayViewController(_ controller: QEDMediaCaptureAndPlayViewController, userCapturedFileAt fileURL: URL)Parameters
controllerThe controller object informing the delegate of this event
fileURLThe local URL for the new media file captured by the user
-
Tells the delegate the user has requested dismissal of the controller.
Important
It is thedelegateresponsibility to actually dismiss the controller.fileURLwhen notnilis the local storage URL for a new captured media file.If
reasonissavethe user has indicated intention to save the file by tapping on the save button. Ifreasoniscloseuser has indicated to just dismiss the controller with no intention of saving the file.It is up to the
delegateto delete the file atfileURLfrom the file system whenfileURLis notnilandreason == closeDeclaration
Swift
func mediaCaptureAndPlayViewController(_ controller: QEDMediaCaptureAndPlayViewController, dismissalRequestWithNewRecordedFileAt fileURL: URL?, reason: QEDMediaCaptureAndPlayViewController.DismissReason)Parameters
controllerThe controller object informing the delegate of this event
fileURLThe local URL for the new captured media file (if any).
reasonAn instance of
QEDMediaCaptureAndPlayViewController.DismissReasonindicating the reason for the controller dismissal request. -
Tells the delegate the controller needs to be dismissed due to a setup error.
Declaration
Swift
func mediaCaptureAndPlayViewController(_ controller: QEDMediaCaptureAndPlayViewController, dismissalRequestDueTo error: QEDMediaCaptureAndPlayViewController.SetupError)Parameters
controllerThe controller object informing the delegate of this event
errorAn instance of
QEDMediaCaptureAndPlayViewController.SetupErrorindicating the reason for controller setup failure.
QEDMediaCaptureAndPlayViewControllerDelegate Protocol Reference