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
Returningtrue
does 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) -> Bool
Parameters
controller
The controller object informing the delegate of this event
fileURL
The local URL for the file the request is made for
Return Value
true
if the file atfileURL
could 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
fileURL
Declaration
Swift
func mediaCaptureAndPlayViewController(_ controller: QEDMediaCaptureAndPlayViewController, fileDeletionRequestedFor fileURL: URL)
Parameters
controller
The controller object informing the delegate of this event
fileURL
The 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 atfileURL
You 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
controller
The controller object informing the delegate of this event
fileURL
The 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 thedelegate
responsibility to actually dismiss the controller.fileURL
when notnil
is the local storage URL for a new captured media file.If
reason
issave
the user has indicated intention to save the file by tapping on the save button. Ifreason
isclose
user has indicated to just dismiss the controller with no intention of saving the file.It is up to the
delegate
to delete the file atfileURL
from the file system whenfileURL
is notnil
andreason == close
Declaration
Swift
func mediaCaptureAndPlayViewController(_ controller: QEDMediaCaptureAndPlayViewController, dismissalRequestWithNewRecordedFileAt fileURL: URL?, reason: QEDMediaCaptureAndPlayViewController.DismissReason)
Parameters
controller
The controller object informing the delegate of this event
fileURL
The local URL for the new captured media file (if any).
reason
An instance of
QEDMediaCaptureAndPlayViewController.DismissReason
indicating 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
controller
The controller object informing the delegate of this event
error
An instance of
QEDMediaCaptureAndPlayViewController.SetupError
indicating the reason for controller setup failure.