Fullscreen from a webview? (i.e., YouTube embeds)

672 views
Skip to first unread message

Oren Blasberg

unread,
Jan 16, 2015, 6:26:12 PM1/16/15
to apps...@chromium.org, Fady Samuel
Hi there,

I want to embed a YouTube video in my Chrome packaged app. This works fine with a webview tag. However, the fullscreen button on the player in the webview doesn't do anything.

I couldn't find any info about fullscreen support from webview tags. Is it supported? Or has anyone else had experience with YouTube embeds in a Chrome packaged app?

Thanks!

Oren

Fady Samuel

unread,
Jan 17, 2015, 12:25:51 AM1/17/15
to Oren Blasberg, apps-dev
<webview> does not support fullscreen mode as far as I'm aware. This has been a long standing bug: https://code.google.com/p/chromium/issues/detail?id=141198

It sounds like proper solution required some non-trivial refactoring and so we didn't pursue it at the time because we didn't have requests coming in for its support. I don't object to adding support for fullscreen, but my team doesn't have the cycles to take on adding this support at the moment. I'm happy to provide technical guidance to implement this feature, however.

Thanks,

Fady

To unsubscribe from this group and stop receiving emails from it, send an email to apps-dev+u...@chromium.org.

Oren Blasberg

unread,
Jan 20, 2015, 1:12:06 PM1/20/15
to Fady Samuel, apps-dev
Thanks for the quick response Fady. Do you have a rough estimate of how difficult / how long it might take a reasonably competent^W^Wgreat engineer to add such a feature to Chromium's webview implementation?

Alternatively, has anyone had any experience with YouTube embeds in general in Chrome apps or know of a non-webview based approach that work and also support fullscreen? It would be rather hard to explain to users why the fullscreen button isn't working on the YT player :(

Thanks,
Oren

Fady Samuel

unread,
Jan 20, 2015, 1:16:22 PM1/20/15
to Oren Blasberg, apps-dev
I haven't thought too deeply about the problem lately, but I would guesstimate that with a few pointers (to code), one should allocate one to two weeks of time (let's say two to be safe) to familiarize himself with the code and the code paths, identify a good solution, test it, upload a patch and iterate a couple of times through code review.

Thanks,

Fady

Oren Blasberg

unread,
Jan 20, 2015, 1:22:05 PM1/20/15
to Fady Samuel, apps-dev
Got it. One more related question since you're being super helpful -- I noticed in that bug you linked to a mention of the 'fullscreen' permission, but can't find reference to it on either the Chrome Apps permissions page [1] or the Chrome Extensions permissions page [2].  Is this "fullscreen" permission obsolete? Did it ever exist? 

Basically I'm wondering: say we went ahead and implemented fullscreen support for webview. As an app developer, would I also need to specify the "fullscreen" permission in the manifest in order for the webview to be able to get fullscreen access (once it gets implemented)?

Benjamin Kalman

unread,
Jan 20, 2015, 1:54:22 PM1/20/15
to Oren Blasberg, Joel Weinberger, Ben Wells, scheib, Fady Samuel, apps-dev
I'd imagine you'd require something similar to an iframe's allowfullscreen property (in the webview case, probably an async version of that, to allow the embedder to implement infobars etc). Then yes I'd imagine the app would need the permission to go fullscreen too, though I'm not even sure what the status of app fullscreen is.

λ Ken Rockot

unread,
Jan 20, 2015, 2:04:26 PM1/20/15
to Benjamin Kalman, Oren Blasberg, Joel Weinberger, Ben Wells, scheib, Fady Samuel, apps-dev
I believe the lack of documentation for fullscreen permission is a documentation bug, and a "fullscreen" manifest permission still exists and is still required for app windows to be created with |state| set to "fullscreen" in their options.

I would recommend implementing fullscreen as a webview permission request like several other webview features. That way apps have freedom and flexibility to handle web fullscreen requests from the embedded content however they like -- you may just want to expand the webview to the full size of the embedding window, or you may want to create a new fullscreen app window and reattach the webview to it, etc.

Vincent Scheib

unread,
Jan 20, 2015, 2:14:14 PM1/20/15
to λ Ken Rockot, Benjamin Kalman, Oren Blasberg, Joel Weinberger, Ben Wells, Fady Samuel, apps-dev
https://developer.chrome.com/apps/api_other
"In Chrome Apps, fullscreen is entered without prompting the user or providing exit instructions. HTML5 fullscreen requires the app.window.fullscreen permission in the manifest. In normal webpages, the browser intercepts the ESC key to exit pointer lock ensuring a consistent escape method for users. That is also the behavior in Chrome Apps unless the app.window.fullscreen.overrideEsc permission is used to enable the app to call preventDefault on keydown and keyup events.
"

Chrome.app.window fullscreen doesn't require a permission. 

Oren Blasberg

unread,
Feb 9, 2015, 3:25:31 PM2/9/15
to Vincent Scheib, λ Ken Rockot, Benjamin Kalman, Joel Weinberger, Ben Wells, Fady Samuel, apps-dev, str...@chromium.org, jleic...@chromium.org
Hi Fady,

Thanks for the estimate. After conferring with the interested parties, we were wondering if it would be a much lower-cost (easier to implement) solution to make the following change: fullscreen requests coming from elements within a <webview> would simply maximize the element requesting fullscreen to take up the entire webview, rather than actually doing a fullscreen. This might be useful because it could be combined with, say, message passing so that when this occurs, the webview could notify its owning container of this, which would itself do chrome.app.window.current().fullscreen() to carry out a true fullscreen.

Would this be easier to implement?  If the difficulty of making webview use the fullscreen request comes from the need to plumb permission handling through from the browser to the webview code, this alternative approach would sidestep permissions altogether, so maybe it'd be a much smaller change to make.

Thanks!
Oren

Fady Samuel

unread,
Feb 9, 2015, 3:35:03 PM2/9/15
to Oren Blasberg, Vincent Scheib, Ken Rockot, Benjamin Kalman, Joel Weinberger, Ben Wells, apps-dev, Andrew Stromme, Jake Leichtling, Istiaque Ahmed


Plumbing the actual permission into the <webview> permission API is trivial.

+lazyboy@ who has looked at fullscreen in the past. Does this seem like it's reasonable to you?

If this sounds reasonable, does this sound like something you could own Oren? My team is currently swamped with other tasks. Thanks,

Fady

Oren Blasberg

unread,
Feb 12, 2015, 1:16:27 PM2/12/15
to Fady Samuel, Vincent Scheib, Ken Rockot, Benjamin Kalman, Joel Weinberger, Ben Wells, apps-dev, Andrew Stromme, Jake Leichtling, Istiaque Ahmed
lazyboy@ - friendly ping, thanks

@Fady: It's certainly a possibility but I am not sure yet, as I am pretty swamped as well :( The situation appears quite common these days doesn't it.

Cheers,
Oren

Istiaque Ahmed

unread,
Feb 13, 2015, 4:29:01 PM2/13/15
to Oren Blasberg, Vincent Scheib, λ Ken Rockot, Benjamin Kalman, Joel Weinberger, Ben Wells, Fady Samuel, apps-dev, str...@chromium.org, jleic...@chromium.org
Sorry I missed this thread, replies inline:

On Mon, Feb 9, 2015 at 3:25 PM, Oren Blasberg <or...@chromium.org> wrote:
Hi Fady,

Thanks for the estimate. After conferring with the interested parties, we were wondering if it would be a much lower-cost (easier to implement) solution to make the following change: fullscreen requests coming from elements within a <webview> would simply maximize the element requesting fullscreen to take up the entire webview, rather than actually doing a fullscreen. This might be useful because it could be combined with, say, message passing so that when this occurs, the webview could notify its owning container of this, which would itself do chrome.app.window.current().fullscreen() to carry out a true fullscreen.
​Actually, when I was playing with trying fullscreen in webview, this is exactly what was in
my mind. The only thing I remember is I got into a weird layout state inside webview trying to
do that, but I don't remember any other things. If you want to try this out, I can give you
pointers to where to start looking.​
 

Would this be easier to implement?  If the difficulty of making webview use the fullscreen request comes from the need to plumb permission handling through from the browser to the webview code, this alternative approach would sidestep permissions altogether, so maybe it'd be a much smaller change to make.
​As a first step, this sounds feasible to implement.
​IIUC, If you want the chrome app to automagically make the webview fullscreen, it should
be do-able from app's JS shim[1] that drives <webview>, so that's not too bad. I'm assuming
we can fire an internal event to the shim and the shim can ​request the <webview> element
to go full screen (shim run's on the app's context) if it has proper manifest permission.

Reply all
Reply to author
Forward
0 new messages