why android overlay dialog be displayed under another base_application window , which is not their attached window

208 views
Skip to first unread message

Allen Gu

unread,
Jun 26, 2021, 3:21:12 AM6/26/21
to media-dev
As I know, 
There is a flag called force-video-overlays  for chromium developer to force media player using SurfaceView instead of SurfaceTexture on Android
// Force media player using SurfaceView instead of SurfaceTexture on Android.
const char kForceVideoOverlays[] = "force-video-overlays";

and when we open the  force-video-overlays flag, it will use Dialog as default AndroidOverlay impl
Because dialogs are not part of the view hierarchy, do not need to be synchronized on the main thread, and can be managed directly by the GPU process rather than the browser process. These are not features that most apps would benefit from, but they are very relevant in Chromium's multi-process architecture


But  we I open the force-video-overlays, and rebuild chromium public apk, and install chromium public apk to Android TV.
we I click chromium public apk icon from Android TV launcher, and then open a H5 video website with my chromium public apk.

it will create a WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA  Dialog, and then get a Surface via mDialog.getWindow().takeSurface, and set the Surface to MediaPlayer.

The weirdly thing that I meet  is that, I can only hear video voice, but I can't see video frame.

With my debug, when we set WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA, the video frame is not also show under contentviewsuface, but also it show under Android TV Launcher, which is also with a TYPE_BASE_APPLICATION window type.

So my question is that:
 as the definiton of TYPE_APPLICATION_MEDIA, it is just be  displayed behind their attached window.
The Android Tv Lanucher is not their attached window,
Wy the Android Overlay Dialog (aka DialogOverlayCore)  also be displayed under another TYPE_BASE_APPLICATION window (aka Android TV Launcher with leanback mode) ?

Chris Cunningham

unread,
Jun 27, 2021, 4:58:19 PM6/27/21
to Allen Gu, Frank Liberato, media-dev
+Frank Liberato for overlay expertise

--
You received this message because you are subscribed to the Google Groups "media-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to media-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/media-dev/3a565a06-8409-4ae0-92cb-5f3ee60a306en%40chromium.org.

Frank Liberato

unread,
Jun 29, 2021, 6:08:08 PM6/29/21
to Chris Cunningham, Allen Gu, media-dev
Sorry for the delay -- just got back into the office.

The behavior you describe is not expected.  TYPE_APPLICATION_MEDIA is supposed to be z-ordered below the other surfaces for the current window, as you said.  The launcher should be underneath all of it.

If you don't rebuild the chrome apk, does it work as intended then?

Also, do you know what version of android you are using?

thanks
-fl
--
I sometimes work nonstandard hours.  Please don't feel any urgency to respond outside of your working hours.

Allen Gu

unread,
Jul 5, 2021, 8:25:58 PM7/5/21
to media-dev, Frank Liberato, Allen Gu, media-dev, Chris Cunningham
If you don't rebuild the chrome apk, does it work as intended then?
---------------The default chrome apk works fine, because defaultly, it is based on SurfaceTexture otherwise based on Dialog-Overlay

Also, do you know what version of android you are using?
---------------My Android Version is Android TV OS。
Reply all
Reply to author
Forward
0 new messages