record çaudio on video recording
This commit is contained in:
parent
5dee3a20bb
commit
cc9c080012
|
@ -1,5 +1,6 @@
|
|||
package com.urkob.wittrail_android
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Notification
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
|
@ -93,7 +94,6 @@ class RecordingService : LifecycleService() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun createNotification(): Notification {
|
||||
val notificationIntent = Intent(this, MainActivity::class.java)
|
||||
val pendingIntent = PendingIntent.getActivity(
|
||||
|
@ -157,6 +157,7 @@ class RecordingService : LifecycleService() {
|
|||
}
|
||||
|
||||
// Implements VideoCapture use case, including start and stop capturing.
|
||||
@SuppressLint("MissingPermission")
|
||||
private fun captureVideo() {
|
||||
if (!isCameraInitialized) {
|
||||
Log.e(tag, "Camera not initialized yet.")
|
||||
|
@ -199,6 +200,9 @@ class RecordingService : LifecycleService() {
|
|||
Log.e(tag, "mediaStoreOutputOptions")
|
||||
recording = videoCapture.output
|
||||
.prepareRecording(this, mediaStoreOutputOptions)
|
||||
.apply {
|
||||
withAudioEnabled()
|
||||
}
|
||||
.start(ContextCompat.getMainExecutor(this)) { recordEvent ->
|
||||
when(recordEvent) {
|
||||
is VideoRecordEvent.Start -> {
|
||||
|
|
Loading…
Reference in New Issue