The Kotlin camera2 video series describes how to capture video with the Android camera2 API using the Kotlin programming language.
Each episode will be released on a weekly basis. Though there is the option of getting access to all the episodes straight away by buying the series.
The first Kotlin on Andriod camera2 video episode focuses on setting up the layout for the application.
ImageViews and a Chronometer will be added to a ConstraintLayout. Then button on click listeners will added to the ImageViews in the Android fragment file.
The MediaRecorder Kotlin on Android tutorial describes the steps for setting up the MediaRecorder prior to creating a record capture session.
The device rotation and camera sensor orientation must be found to provide the correct orientation to the MediaRecorder.
Also in this Kotlin episode, functions are implemented for the creating of unique timestamped file names.
A camera capture session is created for setting up a recording request. The camera device is used for the session creation.
Surfaces for the MediaRecorder & Preview must be provided to the session creation and CaptureRequest builder.
The onConfigured callback will provide an intialized camera capture session.
A new Android fragment will be created for video playback.
To pass the video Uri from the preview fragment to the video playback fragment the Android ViewModel will be used.
And the video playback fragment will be called from the preview fragment.
The Android ExoPlayer will be used for video player. And in this Kotlin on Android tutorial we describe how to attach the player to a view and then prepare the MediaSource prior to starting video playback.
This Kotlin on Android episode will describe how to implement Picture in Picture mode during video playback.
The Android ViewModel will be used to pass the video playback state to the main activity.
The ExoPlayer also provides the video aspect ratio to the Picture in Picture parameters.
This Kotlin episode describes how to switch between cameras. Similar to the preview tutorial the navigation drawer will provide an icon for switching between cameras.
Additional support is also added for the MediaRecorder set up.
Audio support is described in this Kotlin on Android tutorial.
Audio has been classed a critical permission. So runtime permission support will be provided by the EasyPermissions library.
This Kotlin tutorial also describes how to access permissions from the application settings.