-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
video player can not play on Android 6.0.1 and older devices #16178
Comments
do they work normally on those phones? I mean natively? I suggest to look how video plugin works underneath and use exoplayer in the same way. |
@charafau The flutter pages don't work on the Chinese Android 6.0.1 and older devices. The native pages are fine. |
@sigurdm or @mravn-google would know. |
First step is to find out if this is a MediaPlayer problem (possibly resolvable by further configuration or by switching to ExoPlayer), or if there is a more fundamental problem with the way we consume the texture stream on the Flutter side. @korbin-w (or anyone else with a Chinese Android 6.0.1 device): can I ask you to try and run the external_ui integration test on such a device? After "calibration" and pushing the floating action button, you should see red digits on a black background. Closer to video streaming, there is also a camera plugin example. It would be great to know, whether that one works, too. |
@mravn-google I've assigned this to you since you seem to be taking point on this, but let me know if there's anything you need from me to help with this. |
@mravn-google Thanks for your suggestion. I tried external_ui, camera plugin, and I once switched the player to IJKPlayer, they all do not work on the Android 6.0.1 Chinese device. Here are the screen snapshots. |
@korbin-w Thanks for the quick turnaround, very helpful! The general failure to render external textures might be related to https://bugs.chromium.org/p/skia/issues/detail?id=7713. We're verifying whether the fix of that issue has been rolled into Flutter's master branch. |
@korbin-w OK, so the skia fix has been rolled into Flutter master. That fix was done to address blank video textures on a Samsung Galaxy Note 4 (SM-N9100) running Android 5.0.1. We've just verified that videos work on that device when using Flutter master. |
@mravn-google Thanks very much. We have done the test with your fix and it is OK for our devices now. |
@mravn-google I found the problem still exists in some devices. So I reopen this issue. Could you take a look?
|
cc @sigurdm |
@brianosman do you have ideas for helping out here? |
@mravn-google
We dug more and noticed several devices in which the video fails to play. For a device running Android6.0 (Huawei Rom)
For another device running Android 4.4.2(Huawei Honor):
For another device running Android4
Are those messages useful? Is it possible for us to use the texture mechanism to play video on these devices? |
Hi @kangwang1988 . Thanks for the details. This looks to me similar to #14053 (comment) . Flutter currently contains the initial Skia fix https://skia.googlesource.com/skia/+/91fba61f24943a6e12f69732d9308beb76f8a7c6 from 4 weeks ago. There is an update to the fix still not rolled into Flutter https://skia.googlesource.com/skia/+/c585e20f5a7a49808ddf6ac12af287f226bb26dc . @brianosman would you expect the updated fix to help in the cases seen here? If yes, then we need to roll Skia (to at least c585e20f5a7a49) in Engine, and Engine in Flutter to include the fix. |
Hi @kangwang1988 , yes - those messages are very helpful. The updated fix that @sigurdm mentioned will be rolling into Flutter soon, but I think it will only fix some of these devices. It looks like there are two kinds of problems: The Android 4 & 4.4 devices that report "Extension 'GL_OES_EGL_image_external' not supported" are going to be unable to play video. That extension is required to be able to treat a video frame as a texture in OpenGL and draw it. The Android 6 device (anything that says "... requires extension GL_OES_EGL_image_external_essl3") should start working. That's a newer extension that is also required to treat video frames as textures, when using a newer version of OpenGL ES. On some devices, the driver does not include that extension when we ask it for a list of supported extensions, even though it does work (and is required to be able to import video frames). Our current workaround is to enable that extension on Adreno & Mali devices. If your device has a GPU from a different manufacturer, it may not work, but we could include more devices in that workaround. I think the Android 5 devices will start working, but I can't be sure - I haven't been able to test on one of those. |
@sigurdm |
@brianosman Do we have a sense as to how common it is for devices to be missing this extension? Trying to get a sense as to what % of android devices which we previously thought would work with our video approach are now believed to not? Do we know if there are any "backup" approaches we could try when missing this extension? :) FYI @chinmaygarde @cbracken |
@brianosman discovered that on at least some devices that don't support the ..._essl3 extension we still must use the ..._essl3 extension name in the shaders than sample from the video texture. The second change does that. So more devices should work after the second CL. |
@bsalomon |
We suspect that an engine with https://skia.googlesource.com/skia/+/c585e20f5a7a49808ddf6ac12af287f226bb26dc should work on all those devices. |
The "options.fPreferExternalImagesOverES3 = true" approach works fine for us. |
Thank all, we've verified this fix. It can be closed. |
Going to leave this open, since we still expect an unmodified Flutter to work on all of these phones. @brianosman still has some patches in flight I believe? |
Yes. I'm still waiting to receive some more devices (although my Meizu device order was cancelled by the seller), to see if we can narrow down the set of devices where an ES2 fallback would be necessary. It's good to know that it works, though - that gives us a fallback, once we know how/when to trigger it. |
@brianosman I am still having same issue as before on my Xiaomi device, waiting for you to see if you can reproduce it once you have received your orders |
Update: I've received an Oppo device, and it's going to require the ES2 fallback. I've also received a Xiaomi device, but I can't actually use it - it requires a Mi account (which requires connecting to an inaccessible Chinese server) in order to enable installing apps over USB. Regardless, I suspect it's also going to require the ES2 fallback. @eseidelGoogle Ultimately, I think Flutter is going to want to ship the engine with the ES2 fallback enabled. Skia may land additional patches to make the ES2 fallback happen less often (when we know other fallbacks work), but Skia isn't going to want to force that behavior on all other clients - it's only necessary if a particular client needs external image support to work. For many clients, ES3 is probably more important/useful. |
sgtm unless @eseidelGoogle has specific objections. |
@brianosman are you sure that you need to have Mi account? some of the Mi phone come with modified ROM (loaded with all kinds of adware), please flash it with original MIUI ROM from http://en.miui.com/download.html , I did the same for mine, don't use the ROM that comes with the phone, it is probably not the original one |
@lotux Yup. I installed the ROM from there, looks identical to the one that came on the phone (I think it just went from MIUI 9.5.3 to 9.5.4). I can enable developer mode and USB debugging, but attempting to enable 'Install via USB' pops up a 'Sign in to your Mi account first' notice, and then takes me to the Mi account sign-in UI. |
@brianosman I checked again and it seems I have created MI account too ( didn't know that 🤕), may be if you use a proxy from Canada it works? |
Hi everyone, I have the same problem on Samsung Tab 10 2014 edition, running Android 5.1. Blank video screen. Do we have a fix for this yet? Thanks |
@brianosman I can confirm that is working on Xiaomi device, both video plugin and camera plugin is working
|
I have faced with this issue on my Meizu M3 Note (Android 5.1). I'm confused by the comments above. Can anyone tell me how to fix this issue in short?
|
@ngoan98tv your Flutter version is quite outdated. Are you using the newest plugin version? |
@zoechi Because some packages in my project only run on Dart versions <2 so I avoid to upgrade Flutter and the plugins using Dart 2. |
@ngoan98tv not really, except updating the packages yourself to Dart 2 that are not yet compatible. |
How to implement the video player buffer? |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
1, Run the example of video player plugin. https://github.com/flutter/plugins/tree/master/packages/video_player/example
2, On Chinese Android 6.0.1 and older devices, the video can not be played( it was filled white), the sound is OK.
Test result on devices are as below, most problem devices are made for China. The Nexus with Android 6.0.1 device is OK.
Logs
I did not find the significant logs and there are lots of logs. Below are some info:
Flutter Doctor
The text was updated successfully, but these errors were encountered: