StreamRecorder
An object that writes media data to a file.
Usages.
AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Content copied to clipboard
Code
var recorder = StreamRecorder(context)
if (recorder.isRecording) {
recorder.stopRecording()
} else {
recorder.attachStream(stream)
recorder.startRecording(
File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "output.mp4").toString(),
MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4
)
}
Content copied to clipboard