Initiating Video Playback from the Browser Process

29 views
Skip to first unread message

Eric Sum

unread,
Nov 21, 2022, 5:15:47 AM11/21/22
to medi...@chromium.org
Hi everyone,

I was wondering if it's possible to initiate video playback from the browser process. In this case, the UI we're trying to incorporate the video into is a native UI living in the browser process that uses the ui/views framework; it's not web-based. There is no user interactivity planned; the video just plays on a loop indefinitely. For simplicity right now, we can assume it's just an mp4 (or other supported format) file loaded from disc, and there's no content encryption.

Is something like this supported today? Could someone please point me in the right direction if so?

One path I thought of is creating just a few lines of HTML with a <video> element, whose "source" points to the video file, and creating a views::WebView (which fits nicely into the existing framework) to render it. IIUC, this would basically be directing the playback through the render process such that it looks like any other video playback in Chrome. But I'm wondering if there's a better option out there?

Thank you so much!

--
-Eric

Eric Sum

unread,
Nov 29, 2022, 1:17:48 PM11/29/22
to medi...@chromium.org
Hi there,

Are there any thoughts on this? I got the WebView solution that I described earlier working. If this is the way to go, I'm completely fine with that. I'm just checking for peace of mind that there's no other obvious solution I'm missing that's more suitable.

Thank you!
--
-Eric

Dale Curtis

unread,
Nov 29, 2022, 3:19:43 PM11/29/22
to Eric Sum, medi...@chromium.org
Sorry lots of folks have been out on holiday.

The views approach is likely the easiest. If the content is untrusted you must go this route. If it's trusted, you could scaffold the guts of the media element in the browser process if you really wanted to, but unless there's a significant need to go this route I wouldn't try it -- pipeline spin up should be fairly easy (see PipelineIntegrationTest), but compositing and audio rendering will be more difficult. 

- dale

--
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/CAJTMNZquBLZuhQSzKyJBQnKf2y-fah1v0__N-%2BAYF7hkRZ7UiQ%40mail.gmail.com.

Eric Sum

unread,
Nov 29, 2022, 4:11:53 PM11/29/22
to Dale Curtis, medi...@chromium.org
That makes sense. Thank you! I'll reach out again if a significant need arises, but it sounds unlikely we'll ultimately attempt something like that.
--
-Eric
Reply all
Reply to author
Forward
0 new messages