diff --git a/app/src/main/java/com/urkob/wittrail_android/RecordingService.kt b/app/src/main/java/com/urkob/wittrail_android/RecordingService.kt index 80617f2..948c50c 100644 --- a/app/src/main/java/com/urkob/wittrail_android/RecordingService.kt +++ b/app/src/main/java/com/urkob/wittrail_android/RecordingService.kt @@ -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 -> {