Open misos1 opened 5 days ago
Thanks for the report @misos1 Please check https://github.com/flutter/flutter/issues/131127 and https://github.com/flutter/flutter/issues/132560#issuecomment-1678949111 to see if it helps in your case or not.
No, those 2 are about phone calls during playing in the video player, this one is about camera recording as should be clear from title and description. Video player is used only to make it easy to see corrupted video.
Thanks for the update. The video seems to be paused during the time phone call or alarm goes off. Can you check if VideoPlayerController
still reports "isPlaying" as true
during this time ?
@darshankawar No, a phone call or alarm goes off during recording and not during playback, of course isPlaying
is true
all the time.
@misos1 I checked with native iOS camera and set a timer which went off during camera recording and the recording does pause. Can you check at your end as well ? You may also confirm on native Android as well.
@darshankawar If you mean the pre-installed camera app from apple it behaves differently for me, but what does that have to do with this issue? Does yours also produce video where audio is shifted?
but what does that have to do with this issue?
By referring to native behavior, I was trying to indicate that the behavior also occurs in native app, so it may not be specific to Flutter only. Are you experiencing this on iOS or Android ?
Does yours also produce video where audio is shifted?
The recording goes blur when alarm goes off in native.
So let's compare them (this can be also triggered by just placing an app in the background during recording).
Camera app from apple ("native"):
Flutter code sample provided above using camera plugin (wait at least 5 seconds before each step so it is actually visible and also do not put app in background during these steps except you test this instead of alarm or phone call):
I would say there is a big difference between native which produces usable video and flutter which will produce garbage in such case and you have to dump it. It would be ok if it just stopped or paused and continued normally without that audio shifting after the alarm is dismissed.
Steps to reproduce
After you try to stop the alarm or phone call it may often crash due to #132073, you can either try to reproduce it again (and it may need some considerable amount of tries) or use patch from https://github.com/flutter/packages/pull/6901.
Expected results
Video and audio synchronized. Recording should be probably paused during such an event as an alarm or phone call.
Actual results
In the attached video is recording of counting. What is actually recorded here is the screen of the device after step 5. At number 11 in the video the alarm started and at 24 stopped. It can be heard that audio is seemingly properly handled but video just shows a static frame between 11 and 24 and only after those 13 seconds for which alarm sounded continues from 24 and up.
Code sample
Code sample
```dart import "dart:io"; import "package:flutter/material.dart"; import "package:camera/camera.dart"; import "package:video_player/video_player.dart"; void main() { runApp(const MaterialApp(home: MyHomePage())); } class MyHomePage extends StatefulWidget { const MyHomePage({super.key}); @override StateScreenshots or Video
Screenshots / Video demonstration
https://github.com/flutter/flutter/assets/30872003/c424aa9e-3691-433f-8342-df8216ad42f3Logs
Logs
```console [Paste your logs here] ```Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-x64) ```