Android的HTML5视频的全屏模式 [英] Android HTML5 Video in Fullscreen Mode
问题描述
我试图让我的视频流在全屏模式在Android上运行。对于iOS我使用本机<视频>
标签,它完美的作品。
I'm trying to get my video stream to work on android in fullscreen mode. For iOS I use a native <video>
tag, which works perfectly.
我可以发挥我的android的视频,但我没有一个全屏按钮。我也试过来为Android设备自身的模板,只需将播放器窗口大小(假全屏)的宽度和高度。我这里的问题是,当我旋转设备,调整大小不能正常工作,这样我可以在视频上滚动。
I can play the video on my android, but I don't have a fullscreen button. I also tried to create a own template for the android devices and simply set the width and height of the player to the window size (Fake Fullscreen). The problem I have here is, that when I rotate the device, the resize doesn't work correctly, so that i can scroll over the video.
继承人我的尝试:
$(document).ready(function() {
$(window).on('resize orientationchange', function() {
$('#myPlayer').width( $(window).width() ).height( $(window).height() );
});
}
谁能帮我得到这个在Android上工作?
Can anyone help me to get this to work on Android?
我希望你能理解我的问题,我的英文并不好...
I hope you can understand my question, my english isn't that good ...
推荐答案
<一个href=\"http://stackoverflow.com/questions/15223777/html5-video-full-screen-on-mobile-browsers-android/22010582#22010582\">HTML5在移动浏览器的视频全屏(机器人)
似乎同样的问题。
您需要的事件有:webkitbeginfullscreen(进入全屏)和webkitendfullscreen(退出全屏)
The events you need are: webkitbeginfullscreen (enter fullscreen) and webkitendfullscreen (exit fullscreen)
var player = document.getElementsByTagName("video")[0];
player.addEventListener('webkitbeginfullscreen', onVideoBeginsFullScreen, false);
player.addEventListener('webkitendfullscreen', onVideoEndsFullScreen, false);
这篇关于Android的HTML5视频的全屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!