- From: Kang-Hao (Kenny) Lu <kennyluck@w3.org>
- Date: Tue, 16 Aug 2011 11:52:21 +0800
- To: John Hax <johnhax@gmail.com>
- CC: Zi Bin Cheah <zibin@opera.com>, 中文HTML5同樂會ML <public-html-ig-zh@w3.org>
- Message-ID: <4E49E975.9090905@w3.org>
(11/08/06 2:16), John Hax wrote:
> 这个API很有用。
>
> 这里顺便发一下我的fullscreen的兼容脚本(window.fullScreen属性和
> fullscreenchange 事件)。
感謝你的代碼,總之先收錄起來了
https://developer.mozilla.org/zh_tw/HTML5_Cross_Browser_Polyfills
> if (!('onfullscreenchange' in window))
> window.addEventListener('resize', function() {
> var f = window.fullScreen
> if (f != _fullScreen) {
> _fullScreen = f
> fireSimpleEvent('fullscreenchange', document, {bubbles:true})
這邊可以試 DOM4 [1]兼容嗎?
document.dispatchEvent(new Event('fullscreenchange', {bubbles: true}));
以後應該也會漸漸廢棄 document.createEvent 和 event.initEvent 吧。
[1]
http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-event-constructor
> fullscreen应用实例:我自己的演讲slides都是用HTML5的,在全屏时进入
> slides状态。例子见:http://hax.github.com/2011/es5_safety/ ,Chrome/FF
> 中按F11可以看到效果。
推薦一下,Mac 是 cmd+shift+F
你這個演講的應用似乎完全就切中整個提案提出的所有功能,所以你何不試著多做
一點,比如說
gotoSlide 就是 element.requestFullScreen
.current 就是 :full-screen(這又需要 CSS 解析就是了)
用 alternate stylesheet 似乎有點多餘了?
Kenny
>
> 2011/8/5 Zi Bin Cheah <zibin@opera.com <mailto:zibin@opera.com>>
>
> 全屏对HTML5 apps发展应该是很重要的,apps如果没法控制全屏就没有办法
> 达到native的效果,比方html5游 戏还是给人网页的感觉,而非一个game。
>
> Mozilla提出了Fullscreen API[1],webkit也会使用它[2]。
>
> 比方调用video全屏
>
> <video src="pelican.webm" autoplay
> onclick="event.target.requestFullScreen()"
> onended="document.cancelFullScreen()">
> </video>
>
> 最大的隐忧是全屏是否应该得到用户的允许下才能进行(explicit
> permission),而且也存在这其他安全问题。
>
>
> [1]https://wiki.mozilla.org/Gecko:FullScreenAPI
> [2]http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May
> /031538.html
>
>
>
>
Received on Tuesday, 16 August 2011 03:52:53 UTC