SurfaceRecorder
Deprecated
Use CameraView/MiSnapView recording capabilities instead
The SurfaceRecorder acts as an adapter between the Android camera and the SurfaceView that the preview will be displayed on. This allows it to record a video of the preview and save it to the file system.
Restarting video recording will overwrite the original video rather than appending to it.
Throws Exception if there was an error while instantiating.
NOTE: if using this class for low level video recording capabilities, it is necessary to customize the MiSnapSettings.Camera.VideoRecord to match the desired video resolution in the correct orientation by using the MiSnapSettings.Camera.VideoRecord.videoResolution property.
Functions
Binds the SurfaceRecorder to the provided SurfaceView, once bound and initialized the resulting SurfaceTexture will be posted to surfaceLiveData.
Binds the SurfaceRecorder to the provided TextureView, once bound and initialized the resulting SurfaceTexture will be posted to surfaceLiveData.
Resets the video's settings and output path. If a video was already being recorded, it will be closed and recording will need to be started again.
Enables recording of the preview from the camera. If the preview has not yet started, then recording will begin as soon as it does.
Disables recording of the preview from the camera. The preview will continue to display to the user, but the video file will no longer be updated.
Releases the currently bound View. This is handled automatically when the Surface or SurfaceTexture is destroyed, and so the method only needs to be called if switching from one View to another. NOTE: Releasing the surface automatically stops recording video, and rebinding to a new View and then restarting video recording will overwrite the old video.
Properties
The fully initialized SurfaceTexture to be passed to the camera after a SurfaceView or TextureView have been bound.