[whatwg] Full screen for the <video> element

Michael A. Puls II shadow2531 at gmail.com
Mon Oct 29 17:33:52 PDT 2007


On 10/29/07, Dave Singer <singer at apple.com> wrote:
> If we don't have a way for content to request full screen (markup,
> script, whatever), I'm OK with that.  But I think that we should say
> why we left it out, in the spec., and not be silent.  Otherwise we'll
> merely see browser makers doing their own extensions to do it anyway,
> and then we'll also have non-interoperable methods as well as the
> security issues...
> --
> David Singer
> Apple/QuickTime
>

I could imagine it this way:

Global javascript option: allow scripts to enable full screen for
video element = (default unchecked)

user-created site preference for cool.site.com: allow scripts to
enable full screen for video element = checked

Then, the trusted pages could use if (video.canToggleFullScreen()) to
see if they are allowed to toggle full screen. Then, they would use
video.toggleFullScreen() to automatically turn on full screen (they
might use a stored cookie preference or whatever) and or provide a
full screen button on the page.

I could imagine that easily working in Opera and FF3 with site preferences.

The spec would just have to support canToggleFullScreen() and
toggleFullScreen(). It would not have to mention site preferences
specifically. Maybe just recommend that it should be turned off by
default and recommend that UAs supporting toggleFullScreen() should
provide *some* mechanism to enable it on a per-site basis.

A tiny issue with toggleFullScreen() is that if a button on the page
is provided, once you're in full screen, you'll have to use the
browser-provided way to get out. But, toggleFullScreen() would still
be useful for the script to switch back to normal view automatically
when the clip is done playing or toggle for certain clips.

One thing with toggleFullScreen() that might not be funny would be:
while(1) {
video.toggleFullScreen();
}

If so, then perhaps it should not be a toggle and only be
enableFullScreen() (which would do nothing if already in full screen,
which would also make more sense for the tiny button issue mentioned
above, but would make coming out of full screen not possible by the
script.)

Now, for me personally, I just want to be able to double-left-click on
the video area to enter full screen and then do the same in full
screen (or esc) to get back. I probably wouldn't want to automatically
enter full screen. However, sites and others might want that and it
might be cool.

Either way it seems like there's an acceptable way to allow scripts to
switch to full screen, if there's a need for it.

-- 
Michael



More information about the whatwg mailing list