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 SummaryModifier and TypeMethodDescriptionvoideffectSwitched(String slot) Called when an effect has been switched on a slot.voiderror(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.voidfaceVisibilityChanged(boolean faceVisible) Called when the user's face becomes visible or invisible.voidframeAvailable(android.media.Image frame) Each processed frame will be available here as an Image object.voidimageVisibilityChanged(String gameObjectName, boolean imageVisible) Called when a natural image is being tracked and the visibility has changed.voidCalled when the DeepAR is initialized.voidscreenshotTaken(android.graphics.Bitmap screenshot) Called when the screen capture is finished.voidCalled when engine shutdown is finished after callingrelease.voidCalled if the video recording fails.voidCalled when the video recording is finished.voidCalled when the video recording is prepared.voidThe start of the video recording process is not synchronous, so this method will be called when the video recording is started.
- 
Method Details- 
screenshotTakenvoid 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.
 
- 
videoRecordingStartedvoid videoRecordingStarted()The start of the video recording process is not synchronous, so this method will be called when the video recording is started.
- 
videoRecordingFinishedvoid videoRecordingFinished()Called when the video recording is finished.
- 
videoRecordingFailedvoid videoRecordingFailed()Called if the video recording fails.
- 
videoRecordingPreparedvoid videoRecordingPrepared()Called when the video recording is prepared.
- 
shutdownFinishedvoid shutdownFinished()Called when engine shutdown is finished after callingrelease.
- 
initializedvoid initialized()Called when the DeepAR is initialized. DeepAR methods should not be called before the initialization is completed.
- 
faceVisibilityChangedvoid 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.
 
- 
imageVisibilityChangedCalled 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.
 
- 
frameAvailablevoid frameAvailable(android.media.Image frame) Each processed frame will be available here as an Image object. Make sure to callstartCaptureonDeepARobject otherwise this method will not be called.- Parameters:
- frame- The processed frame.
 
- 
errorCalled 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.
 
- 
effectSwitchedCalled when an effect has been switched on a slot.- Parameters:
- slot- The slot name where the effect has been switched.
 
 
-