The Kotlin camera2 front video capture Android development tutorial describes how to switch between cameras for video recording.
This Kotlin on Android development tutorial follows on from the Picture in Picture tutorial.
The front video portion is based on the switching cameras tutorial.
There will be git instructions provided on how to pull down the front camera changes. Before making the additional changes for capturing video from the front camera.
In this Kotlin on Android tutorial we will cover:
- Recap of the changes made for front preview
- MediaRecorder changes
- Stepping throught the code changes
Episodes
- Icons
- MediaRecorder
- Rear Camera Record
- Round preview thumbnail
- Sharing Uri with ViewModel
- Video Playback with ExoPlayer
- Video PIP
- Front Camera Record (Premium)
- Video Record with Audio (Premium)
- Replace TextureView with SurfaceView (Premium)
Disclaimer, it is recommended to follow this Kotlin on Android tutorial series using a Google Pixel or Nexus device.
Please do not try it with the Android Emulator. Bugs have also been observed in camera stacks of none Google devices, which may be exposed by this tutorial series.
Conclusion
The Kotlin camera2 front video capture Android development tutorial described how to switch between forward and rear-facing cameras.
References to the front camera were provided because it was basically the same implementation.
The following Kotlin tutorial will describe how to enable audio support for video recording.