Questions about webview

653 views
Skip to first unread message

Graeme Whyte

unread,
Nov 14, 2023, 3:30:57 PM11/14/23
to android-webview-dev
Hi, I had some questions about Android Webview to understand the capabilities.

Would it be possible to a clarification on on the following. If there are plans in future to provide the capability, I'd be interested to hear!

  • Does Android WebView use SurfaceTexture on all Android versions for video playback including video playback with WebRTC?
  • Does this mean that HDR isn't possible? (I think this needs SurfaceView)
  • Is there a zero-copy solution for webview video playback? This is needed for 4k to work performantly?
  • Is there a way to use SurfaceView instead of SurfaceTexture for the internal player in chromium and for WebRTC video playback use case?
  • Does SurfaceTexture prevent 4k video playback on an Android TV device because it would be stuck at 1080p resolution on the UI layer? Also, could it affect the picture quality compared to SurfaceView?
  • Does WebView provide support for L1 WideVine DRM? Would this require SurfaceView to be used instead of SurfaceTexture?
  • Any planned support for any other DRM solutions such as PlayReady or FairPlay?
  • Are there plans for the full HLS standard to be supported? I can see that the built-in HLS is being worked on but I'm wondering if this is just to be at parity with Android MediaPlayer or if it will support the full standard.
  • Does WebView operate differently in any significant ways between Android TV & Tablet that I should be aware of?

If I should post in another group for certain questions, please let me know!

Graeme

Bo Liu

unread,
Nov 14, 2023, 4:19:18 PM11/14/23
to Graeme Whyte, android-webview-dev
On Tue, Nov 14, 2023 at 3:31 PM 'Graeme Whyte' via android-webview-dev <android-w...@chromium.org> wrote:
Hi, I had some questions about Android Webview to understand the capabilities.

Would it be possible to a clarification on on the following. If there are plans in future to provide the capability, I'd be interested to hear!

  • Does Android WebView use SurfaceTexture on all Android versions for video playback including video playback with WebRTC?
Webview should only use SurfaceTexture on older versions of android for video. Replacement APIs are AImageReader and AHardwareBuffer. I don't know much about webrtc though.
  • Does this mean that HDR isn't possible? (I think this needs SurfaceView)
SurfaceControl is the lower level thing that SurfaceView is implemented on top of (on recent Android versions). And HDR requires SurfaceControl.

HDR is possible for webview, but it's not implemented for webview, and not currently on the roadmap.
  • Is there a zero-copy solution for webview video playback?
Yes, using SurfaceControl, with a long list of conditions when it needs to be turned off.
  • This is needed for 4k to work performantly?
Who knows. Depends on the device.
  • Is there a way to use SurfaceView instead of SurfaceTexture for the internal player in chromium and for WebRTC video playback use case?
Don't know about webrtc.
  • Does SurfaceTexture prevent 4k video playback on an Android TV device because it would be stuck at 1080p resolution on the UI layer? Also, could it affect the picture quality compared to SurfaceView?
I imagine those are compromises made by TV OEMs, not behavior mandated by Android. Eg phones generally have enough CPU and GPU power to render at full display resolution.
  • Does WebView provide support for L1 WideVine DRM? Would this require SurfaceView to be used instead of SurfaceTexture?
Webview doesn't support L1. 
  • Any planned support for any other DRM solutions such as PlayReady or FairPlay?
No 
  • Are there plans for the full HLS standard to be supported? I can see that the built-in HLS is being worked on but I'm wondering if this is just to be at parity with Android MediaPlayer or if it will support the full standard.
You can ask the chromium media team. Afaik on android, chromium just uses what's provided by the OS (MediaCodec, not MediaPlayer), but I don't know how much of the missing pieces is due to things chromium vs things in the OS.
  • Does WebView operate differently in any significant ways between Android TV & Tablet that I should be aware of?
No in chromium code, which isn't really meaningful to you.

I know on TV, mediacodec often gives out buffers that cannot be accessed by GPU, which often means webview cannot render it. I think a lot of TV apps just use webview to draw the UI, and a hole where the video goes, and use whatever media player that works efficiently (MediaPlayer + SurfaceView I guess).

If I should post in another group for certain questions, please let me know!

Graeme

--
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 view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/a64ca744-b7ef-4b0f-8468-68bef49fc48fn%40chromium.org.
Reply all
Reply to author
Forward
0 new messages