Most visited

Recently visited

ViroMediaRecorder

public class ViroMediaRecorder
extends Object

java.lang.Object
   ↳ com.viro.core.ViroMediaRecorder


ViroMediaRecorder enables you to take a screenshot or record a video of the scene rendered in your ViroView.

Summary

Nested classes

enum ViroMediaRecorder.Error

Enum indicating what error (if any) was encountered during a recording operation. 

interface ViroMediaRecorder.RecordingErrorListener

Listener for responding to errors when starting a recording, and for responding to errors during a recording. 

interface ViroMediaRecorder.ScreenshotFinishListener

Listener for responding to screenshot capture success and errors. 

interface ViroMediaRecorder.VideoRecordingFinishListener

Listener for responding to video recording success and errors. 

Public methods

void startRecordingAsync(String fileName, boolean saveToCameraRoll, ViroMediaRecorder.RecordingErrorListener errorListener)

Schedules a screen recording to start on the next rendered frame.

void stopRecordingAsync(ViroMediaRecorder.VideoRecordingFinishListener finishListener)

Schedules the conclusion of the current video recording, if any.

void takeScreenShotAsync(String fileName, boolean saveToCameraRoll, ViroMediaRecorder.ScreenshotFinishListener finishListener)

Schedules a screenshot to be taken and saved on the next rendered frame.

Public methods

startRecordingAsync

void startRecordingAsync (String fileName, 
                boolean saveToCameraRoll, 
                ViroMediaRecorder.RecordingErrorListener errorListener)

Schedules a screen recording to start on the next rendered frame. The recording will continue until stopRecordingAsync(VideoRecordingFinishListener) is invoked. When finished, the recording will be saved to the given file. The file will be stored in the device's photos if saveToCameraRoll is true; otherwise it is stored in getFilesDir().

Parameters
fileName String: The name of the file that will store the finished recording.

saveToCameraRoll boolean: True to save the recording to the camera roll. False to save the file in getFilesDir().

errorListener ViroMediaRecorder.RecordingErrorListener: Listener that is invoked if the recording operation encounters an error.

stopRecordingAsync

void stopRecordingAsync (ViroMediaRecorder.VideoRecordingFinishListener finishListener)

Schedules the conclusion of the current video recording, if any. The success or failure of this request are notified through the provided ViroMediaRecorder.VideoRecordingFinishListener.

Parameters
finishListener ViroMediaRecorder.VideoRecordingFinishListener: Callback interface that is invoked on success or failure.

takeScreenShotAsync

void takeScreenShotAsync (String fileName, 
                boolean saveToCameraRoll, 
                ViroMediaRecorder.ScreenshotFinishListener finishListener)

Schedules a screenshot to be taken and saved on the next rendered frame. When finished, the screenshot will be saved to the given file. The file will be stored in the device's photos if saveToCameraRoll is true; otherwise it is stored in getFilesDir().

Parameters
fileName String: The name of the file that will store the screenshot.

saveToCameraRoll boolean: True to save the screenshot to the camera roll. False to save the file in getFilesDir().

finishListener ViroMediaRecorder.ScreenshotFinishListener: Callback interface that is invoked on success or failure.

Hooray!