Package ai.deepar.ar
Interface AREventListener
public interface AREventListener
Listener for asynchronous actions returned from the DeepAR class like receiving screenshot results etc. All listener methods are called on the main thread.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
effectSwitched
(String slot) Called when an effect has been switched on a slot.void
error
(ARErrorType errorType, String error) Called when an error occurs, for example, if the model path is not found or the effect file has failed to load.void
faceVisibilityChanged
(boolean faceVisible) Called when the user's face becomes visible or invisible.void
frameAvailable
(android.media.Image frame) Each processed frame will be available here as an Image object.void
imageVisibilityChanged
(String gameObjectName, boolean imageVisible) Called when a natural image is being tracked and the visibility has changed.void
Called when the DeepAR is initialized.void
screenshotTaken
(android.graphics.Bitmap screenshot) Called when the screen capture is finished.void
Called when engine shutdown is finished after callingrelease
.void
Called if the video recording fails.void
Called when the video recording is finished.void
Called when the video recording is prepared.void
The start of the video recording process is not synchronous, so this method will be called when the video recording is started.
-
Method Details
-
screenshotTaken
void screenshotTaken(android.graphics.Bitmap screenshot) Called when the screen capture is finished. The result is given as an Android Bitmap object.- Parameters:
screenshot
- The taken screenshot.
-
videoRecordingStarted
void videoRecordingStarted()The start of the video recording process is not synchronous, so this method will be called when the video recording is started. -
videoRecordingFinished
void videoRecordingFinished()Called when the video recording is finished. -
videoRecordingFailed
void videoRecordingFailed()Called if the video recording fails. -
videoRecordingPrepared
void videoRecordingPrepared()Called when the video recording is prepared. -
shutdownFinished
void shutdownFinished()Called when engine shutdown is finished after callingrelease
. -
initialized
void initialized()Called when the DeepAR is initialized. DeepAR methods should not be called before the initialization is completed. -
faceVisibilityChanged
void faceVisibilityChanged(boolean faceVisible) Called when the user's face becomes visible or invisible. This event can be used to show a hint to the user to position the face in the camera field of view.- Parameters:
faceVisible
- Indicates whether any face is visible or not.
-
imageVisibilityChanged
Called when a natural image is being tracked and the visibility has changed.- Parameters:
gameObjectName
- The name of the node with the natural image tracking component.imageVisible
- The current image visibility.
-
frameAvailable
void frameAvailable(android.media.Image frame) Each processed frame will be available here as an Image object. Make sure to callstartCapture
onDeepAR
object otherwise this method will not be called.- Parameters:
frame
- The processed frame.
-
error
Called when an error occurs, for example, if the model path is not found or the effect file has failed to load.- Parameters:
errorType
- DeepAR error type.error
- DeepAR error message.
-
effectSwitched
Called when an effect has been switched on a slot.- Parameters:
slot
- The slot name where the effect has been switched.
-