Can we pause the camera while recording - android

In my application I have timer driven video recording functionality. When the camera is in recording mode and if I click on a button on anywhere on the screen the recording should pause. I should be able to continue recording on clicking again.
But there is no pause action for recording video in many of the android devices.
Is there any other ways of doing it? I found this link but it doesn't give me any hope.
can anybody help me?

you can't do that as no inbuilt function is there what you can do it is that whenever you want to pause your app, stop it and start another part, then combine all parts of it...
Edit: If you are using the MediaRecorder, you can use MediaRecorder.Pause() + .Resume() from Android 7.0 (Nougat, API 24) or higher

Related

Flutter Stops screen recording but the voice is still recorded

I just used flutter package flutter_windowmanager to stop screen recording and screenshots the app works properly but when i record screen it appears black screen but the voice is still running
i tried to stop screen recording it worked but the voice is still working
You can check this article for disabling the audio in Android:
Link of the article

Can you pause all apps making an audio output in Android Studio?

I was wandering if it would be possible to pause all audio outputs in Android Studio.
As an example, let's say you were listening to Youtube Music or Spotify, what code wouldbe able to pause them. Not mute them. Pause them. Additionally, if it's possible could you make it that it goes back a few seconds (etc. 5s or 2s). Also, I would like it not to require to use any API's as I'd like it to be universal but if that's not possible, I would like it to be able to pause and revert a few seconds in Youtube Music (Premium) and the default Android Music Player.
Thank you.

Android record camera and music from players

I am trying to do following functionality in my mobile app:
1) In my app I have record button. When pressed it starts camera recording
2) if I have music playing in my mobile phone in any of
players - this music should overlay the video
3) External microphone
in this situation should also record additional sound
So as a result we will have video record+music+microphone sound
Right now, I got stuck while trying to get access to android.permission.CAPTURE_AUDIO_OUTPUT
(I am not using root access btw and can't use it)
Is there a way to solve 1+2+3(record+music+microphone) ? If yes, how can one solve it?
Not really an answer, but too long for a comment.
Guess you should take a look at MediaRecorder here and the android.permission.RECORD_AUDIO permission. But MediaRecorder is only working with MediaPlayer. So if you are using Exoplayer or similar it's not a solution. Be aware, that this might not work on all hardware devices and with all Android Versions (I think you should test with Android 10 first)!
Be aware of AudioFocusManager on Android. If you start the camera, it will request the AudioFocus, so other music apps on your device will stop playing music if you request the camera with sound. (There are differences between Android 10 and below).
Furthermore, camera is using device microphone, so I think recording microphone and camera input at the same time might not work, but you can always use the video-sound in this case.

How to prevent my app from capturing screen recording in android?

I am working on video player app and I want no other app can record my video and audio as well. I am using simple VideoView to run videos in my app.
I have tried this code, this code prevents from taking the screenshot only.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
Problem
But when I downloaded a screen recording app i.e. DU Recorder and check by recording, it's recording my video's screen and audio as well, this i don't want.
Could anyone help me from this? Thanks in advance
If you are using SurefaceView with media player then use SurfaceView.setSecure(true) , then your video will be secured from any other apps.
Pull down your bar on the screen go to settings and find shortcut keys then you can turn off the automatic screenshot setting

Is the video recording possible in the background service?

I've tried video recording in the background.
But had failed.
Under normal circumstances, the recording works properly.
However, if HOME key down-> Home screen or Other Activity is running,
recording terminates.
In such a situation, I want to record continuously.
I want to record whole process!
What should I do?
thanks.
-Michael
You cannot video record in the background as far as I know. This is partially for privacy reasons.

Categories

Resources