Using external video surface for all HTML5 inline videos.

613 views
Skip to first unread message

webkit...@gmail.com

unread,
Jun 22, 2015, 12:49:59 PM6/22/15
to android-w...@chromium.org
Hello,

As per my understanding, chrome for android and WebView uses separate SurfaceView for full-screen video and also for inline EME videos but not for non-EME inline videos, is it correct?

Any way to force using SurfaceView for all the videos? I did see one preference use_view_overlay_for_all_video in code but I don't see any public WebVIew API available to do this in WebView based apps.

Regards
Arun

Alexandre Elias

unread,
Jun 22, 2015, 2:57:28 PM6/22/15
to webkit...@gmail.com, android-w...@chromium.org
This seems like an implementation detail of WebView so I don't think we'd want to provide an app-side API to force a particular behavior.  Note that it's impossible to support all HTML/CSS features correctly when using SurfaceView, so EME inline video using it is a compromise we're not especially happy with.  On the other hand, I realize texture-based video consumes more power.  We want to maintain the flexibility to keep experimenting with different approaches on this.

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To post to this group, send email to android-w...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/6d6771be-49ce-4b3f-ac31-09cecad9bdc9%40chromium.org.

webkit...@gmail.com

unread,
Jul 8, 2015, 4:50:55 AM7/8/15
to android-w...@chromium.org, webkit...@gmail.com
Thanks for your reply Alexandre!

Actually we are seeing some issues on Android TVs with 4K display because of video not using SurfaceView, here is the problem:
Some of the video streaming apps on ATV are using HTML5 libraries like GTV UI library and when the video is shown full screen, it just re-sizes video to 100% window width and height and doesn't actually switch to full screen. And if the main SurfaceView is of smaller size than 4k, even if videos are decoded at 4k size, they are down-scaled to the smaller size and then display up-scales it to 4K again to match the display size. So, here 4K videos are not actually shown as 4K. Workaround here could be to scale complete WebView to display size which doesn't look the best solution. But with the separate SurfaceView it could have just created a YUV SurfaceView of size matching video width/height(4K) and we wouldn't have seen this problem. Other option is to use full screen Video which creates separate SurfaceView but like inline video, I am not sure if we can do styling and all properly with that, there are some use cases where apps want to display transparent webview on top of full screen video and wants it to handed all JS events etc, like normal inline mode. So from this it looks like we need separate surface even for inline videos and looks like there should have been some way to specify it.

Do you see any way to fix such issues with current WebView or are there any ATV specific webview changes that are coming in future WebView updates?

Thanks
Arun


On Tuesday, June 23, 2015 at 12:27:28 AM UTC+5:30, Alexandre Elias wrote:
This seems like an implementation detail of WebView so I don't think we'd want to provide an app-side API to force a particular behavior.  Note that it's impossible to support all HTML/CSS features correctly when using SurfaceView, so EME inline video using it is a compromise we're not especially happy with.  On the other hand, I realize texture-based video consumes more power.  We want to maintain the flexibility to keep experimenting with different approaches on this.
On Mon, Jun 22, 2015 at 9:49 AM, <webkit...@gmail.com> wrote:
Hello,

As per my understanding, chrome for android and WebView uses separate SurfaceView for full-screen video and also for inline EME videos but not for non-EME inline videos, is it correct?

Any way to force using SurfaceView for all the videos? I did see one preference use_view_overlay_for_all_video in code but I don't see any public WebVIew API available to do this in WebView based apps.

Regards
Arun

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.

Alexandre Elias

unread,
Jul 8, 2015, 2:32:51 PM7/8/15
to webkit...@gmail.com, android-w...@chromium.org
On Wed, Jul 8, 2015 at 1:50 AM, <webkit...@gmail.com> wrote:
Other option is to use full screen Video which creates separate SurfaceView but like inline video, I am not sure if we can do styling and all properly with that, there are some use cases where apps want to display transparent webview on top of full screen video and wants it to handed all JS events etc, like normal inline mode.


I believe this option should work for you.  If you promote a video to fullscreen with the HTML5 fullscreen API, you'll get both a fullscreen SurfaceView for the video (provided to you via onShowCustomView), and the WebView will draw the other web content transparently onto the default application surface on top of the video (and JS touch handlers should work as you expect).
 
Thanks
Arun


On Tuesday, June 23, 2015 at 12:27:28 AM UTC+5:30, Alexandre Elias wrote:
This seems like an implementation detail of WebView so I don't think we'd want to provide an app-side API to force a particular behavior.  Note that it's impossible to support all HTML/CSS features correctly when using SurfaceView, so EME inline video using it is a compromise we're not especially happy with.  On the other hand, I realize texture-based video consumes more power.  We want to maintain the flexibility to keep experimenting with different approaches on this.
On Mon, Jun 22, 2015 at 9:49 AM, <webkit...@gmail.com> wrote:
Hello,

As per my understanding, chrome for android and WebView uses separate SurfaceView for full-screen video and also for inline EME videos but not for non-EME inline videos, is it correct?

Any way to force using SurfaceView for all the videos? I did see one preference use_view_overlay_for_all_video in code but I don't see any public WebVIew API available to do this in WebView based apps.

Regards
Arun

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.

To post to this group, send email to android-w...@chromium.org.

webkit...@gmail.com

unread,
Jul 9, 2015, 6:00:03 AM7/9/15
to android-w...@chromium.org, webkit...@gmail.com
Ok, thanks for your help, we should try this out!

Neha Kushwah

unread,
Apr 9, 2018, 3:07:19 AM4/9/18
to android-webview-dev, webkit...@gmail.com
Hi,

I am also getting issue while playing 4K video on WebView, and showing a green line over top when playing video with >720p. did you find any solution?
Thanks


On Thursday, 9 July 2015 15:30:03 UTC+5:30, webkit...@gmail.com wrote:
Ok, thanks for your help, we should try this out!

On Thursday, July 9, 2015 at 12:02:51 AM UTC+5:30, Alexandre Elias wrote:
On Wed, Jul 8, 2015 at 1:50 AM, <webkit...@gmail.com> wrote:
Other option is to use full screen Video which creates separate SurfaceView but like inline video, I am not sure if we can do styling and all properly with that, there are some use cases where apps want to display transparent webview on top of full screen video and wants it to handed all JS events etc, like normal inline mode.


I believe this option should work for you.  If you promote a video to fullscreen with the HTML5 fullscreen API, you'll get both a fullscreen SurfaceView for the video (provided to you via onShowCustomView), and the WebView will draw the other web content transparently onto the default application surface on top of the video (and JS touch handlers should work as you expect).
 
Thanks
Arun


On Tuesday, June 23, 2015 at 12:27:28 AM UTC+5:30, Alexandre Elias wrote:
This seems like an implementation detail of WebView so I don't think we'd want to provide an app-side API to force a particular behavior.  Note that it's impossible to support all HTML/CSS features correctly when using SurfaceView, so EME inline video using it is a compromise we're not especially happy with.  On the other hand, I realize texture-based video consumes more power.  We want to maintain the flexibility to keep experimenting with different approaches on this.
On Mon, Jun 22, 2015 at 9:49 AM, <webkit...@gmail.com> wrote:
Hello,

As per my understanding, chrome for android and WebView uses separate SurfaceView for full-screen video and also for inline EME videos but not for non-EME inline videos, is it correct?

Any way to force using SurfaceView for all the videos? I did see one preference use_view_overlay_for_all_video in code but I don't see any public WebVIew API available to do this in WebView based apps.

Regards
Arun

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview-dev+unsub...@chromium.org.

To post to this group, send email to android-w...@chromium.org.
Reply all
Reply to author
Forward
0 new messages