Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Google Pixel stops instantly when trying to capture video #514

Closed
Boyan1912 opened this issue Mar 29, 2018 · 22 comments
Closed

Google Pixel stops instantly when trying to capture video #514

Boyan1912 opened this issue Mar 29, 2018 · 22 comments

Comments

@Boyan1912
Copy link

Boyan1912 commented Mar 29, 2018

Bug Information

Version Number of Plugin: 3.1.3
Device Tested On: Google Pixel
Device Android Version: 8.1.0
Simulator Tested On: does not reproduce on simulators (Genymotion, Android Studio simulators and others)
Version of VS: Visual Studio Enterprise 2015, Version 14.0.25431.01 Update 3
Version of Xamarin: 4.9.0.752
Versions of Xamarin.Android SDK: 8.2.0.16

Expected Behavior

Shooting video should be uninterrupted until either stopped by the user or reached the desired size.

Actual Behavior

When I tap on the button to start recording the device makes the sound for the beginning of the record and right after that the sound for the end of the recording and the recording stops. It generates a MediaFile with the length of 0 seconds. When you play it it looks like a single picture.
Also tried without the DesiredSize property of StoreVideoOptions.

Code snippet

var mediaOptions = new StoreVideoOptions
{
Directory = "HCS",
Name = $"{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.mp4",
SaveToAlbum = true,
Quality = VideoQuality.Medium,
DesiredSize = 45 * 1000000
CompressionQuality = 0,
};

                        MediaFile video = await CrossMedia.Current.TakeVideoAsync(mediaOptions);
@caseyniemann
Copy link

@jamesmontemagno confirming we are seeing this same issue

@caseyniemann
Copy link

@jamesmontemagno @Boyan1912 Do we have a fix or workaround on this? @softsan

@jamesmontemagno
Copy link
Owner

I tried:

var mediaOptions = new StoreVideoOptions
{
Directory = "HCS",
Name = $"{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.mp4",
SaveToAlbum = true,
Quality = VideoQuality.Medium,
DesiredSize = 45 * 1000000
CompressionQuality = 0,
};

When you do this the "DesiredLength" is set to 600, which should be 600 seconds according to documentation, however on the Pixel it is not respected. I would have to not set this specific flag perhaps.

The issue seems to be that previously they wanted an int.. but now want a double. I have a new beta nuget to try: 3.2.0.246-beta

I don't have any other phones except for my pixel here to test, so please test this out and i will push to stable when validated.

@philmoz
Copy link

philmoz commented Apr 27, 2018

3.2.0.246-beta - records video on Pixel phone; but does not stop when 'DesiredLength' value is reached.

@jamesmontemagno
Copy link
Owner

Not all phones and camera apps actually respect the desired length. I think the new camera app is one f them.

@jamesmontemagno
Copy link
Owner

what about other phones?

@softsan
Copy link
Contributor

softsan commented Apr 28, 2018

Tested it on android 6(Moto G) and Pixel 8.1, but it does not respect the desired length on both of the device.

@caseyniemann
Copy link

@jamesmontemagno confirming we tested multiple android devices and the desired length is not respected

@jamesmontemagno
Copy link
Owner

Did they work previously? Interesting.... Did it work previously on 8.0?

@jamesmontemagno
Copy link
Owner

What I will probably will do is turn off the functionality on 8.1+ devices.

@softsan
Copy link
Contributor

softsan commented Apr 28, 2018

@jamesmontemagno - Also is there any possibility (or may be feature suggestion) for showing countdown when taking video? e.x. if desired length is set to 1 minute, then it should show 60,59,58,57.....1 seconds.
if possible, You may also put physical upload limit of xx Mb for video (Max size or something). That might help you to bypass android version issue.

@jamesmontemagno
Copy link
Owner

@softsan that is all dependent on the a camera app, we have no control. You can also request a max size in bytes already.

@Boyan1912
Copy link
Author

@jamesmontemagno I don't think "desired length" was working on Android before. We are using "desired length" for iOS and "desired size" for Android in our project.

@caseyniemann
Copy link

@jamesmontemagno confirming that "desired length" in MB is not working on Android...nor is "desired length" in time.

@jamesmontemagno
Copy link
Owner

Yes, but did it ever work is my question and on what devices? Did it stop working after this "fix" on those devices?

@caseyniemann
Copy link

@jamesmontemagno desired length prior version worked on android 6 and 7. It was not recording at all on Android 8.1 prior to the "fix"...now it captures but doesn't respect your limits.

@BenReierson
Copy link

Confirmed that 3.2.0.246-beta now records successfully on Pixel 2. Previously it would stop immediately.

@philmoz
Copy link

philmoz commented May 7, 2018

3.2.0.246-beta - recorded video on Pixel phone; but whatever was fixed did not make it to 3.2.1, this still stops immediately on Pixel phone.

@jamesmontemagno
Copy link
Owner

I have rolled back 3.2.1

@jamesmontemagno
Copy link
Owner

try 4.x-pre

@philmoz
Copy link

philmoz commented May 14, 2018

Not fixed in 4.0.0.3-beta.

If DesiredLength > 0 on Google Pixel Phone (Oreo 8.0, API 26), then video recording stops immediately.

Samsung S9 also running Oreo 8.0 works correctly using 3.1.3 version of the plugin. So it seems this might be a Google Pixel bug.

@jamesmontemagno
Copy link
Owner

you can try 4.0.0.4-beta, i now filter out all pixel phones

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants