检测退出全屏HTML视频 [英] detect exit fullscreen html video

查看:189
本文介绍了检测退出全屏HTML视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打开从我的Andr​​oid上的HTML5视频和自动进入全屏,我希望当用户点击后退按钮和失控的视频检测,我试过了一堆听众为<一个href=\"http://developer.apple.com/library/safari/#sample$c$c/HTML5VideoEventFlow/Listings/events_js.html#//apple_ref/doc/uid/DTS40010085-events_js-DontLinkElementID_5\"相对=nofollow>在这个DOC
另外随着webkitfullscreenchange并在此网址所有事件受审。在结束事件的作品,但我需要在用户返回并退出视频也被检测到。

When I open a html5 video from my Android and automatically goes to full screen, I want to detect when the user taps on back button and gets out of the video, I had tried a bunch of listeners as IN THIS DOC Also tried with webkitfullscreenchange and with all events in this URL. the "ended" event works but I need to detect also when the user goes back and exits the video.

格外我的问题是Android 2.3.5,当用户点击播放,autmatically进入全屏,然后改变视频的方向,然后点击后面。在这一点上我的页面全部拧紧,因为它不火一次在视频里的onorientationchange事件,这就是为什么我需要rezise我的层。如果有人知道或遇到过类似的问题,请让我知道你是如何解决它,谢谢

Particulary my problem is in android 2.3.5 when user clicks on play, autmatically goes to fullscreen, then change the orientation of the video, and then clicks on back. at that point my page is all screwed, as it doesnt fire the onorientationchange event once inside the video and thats why I need to rezise my layers. If someone knows or faced a similar problem please let me know how you solved it, thanks

编辑
我也想知道是否有用于海报的任何解决方案正在减少其大小,一旦影片播放

EDIT I would also like to know if there is any solution for the poster being reduced its size once the video played

推荐答案

我想不出一个直接的解决你的问题,但有我只是想到了一个变通。试试这个:

I cannot think of a direct solution to your problem, however there's a work-around I just thought of. Try this:

当用户点击视频开始播放它,可以触发一些JavaScript函数处理您的显示器/页重新大小。具备的功能重复每一秒左右。这个功能可以检查屏幕宽度,以确定是否显示的是在横向模式,然后相应地重新大小的层。当视频完成后,页面布局将已经被重置。该功能可以继续收听一个方向变回画像,当时它只会重新大小的层,然后停止调用/重演。

When a user clicks the video to start playing it, you can trigger a little JavaScript function that handles your display/page re-size. Have the function repeat every second or so. This function could check the screen width to determine if the display is in landscape mode and then re-size your layers accordingly. When the video is done, your page layout would have been reset already. The function could continue listening for an orientation change back to portrait, at which time it will simply re-size your layers and then stop calling/repeating itself.

我认识一些设备可能会杀死/停止你页面上的任何JS的进程一旦你点击电影,在这种情况下,你可以简单地中断用户的点击,执行你重新大小,然后调用通过JavaScript电影。

I realize some devices may kill/stop any JS processes on you page once you click the movie, in which case you can simply interrupt the user's click, execute your re-size, then call the movie via JavaScript.

我希望这有助于。祝你好运。

I hope this helps. Good Luck.

这篇关于检测退出全屏HTML视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆