Fullscreen request not working in Android Stock browser
I have my own HTML5 video player and my problem is that I cannot enter full screen mode in Android Stock Browser (tested on Huawei ascend mate, htc desire, galaxy s2 / s3). It works in other browsers (Chrome, Safari, etc.). I opened Youtube with android browser and no problem with this option. I noticed that you don't have a turntable, but another standard player.
window.onload=function(){
var video = document.getElementById("video-player");
function enterFullscreen() {
if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {
if (video.requestFullscreen) {
video.requestFullscreen();
} else if (video.msRequestFullscreen) {
video.msRequestFullscreen();
} else if (video.mozRequestFullScreen) {
video.mozRequestFullScreen();
} else if (video.webkitRequestFullscreen) {
video.webkitRequestFullscreen();
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
}
return false;
}
var rF = document.getElementById("fullscreen-btn");
rF.addEventListener("click", function() {
enterFullscreen();
});
};
<video id="video-player" width="640" height="390" src="video.mp4" controls></video>
<button id="fullscreen-btn" type="button">Fullcsreen</button>
+3
source to share
No one has answered this question yet
Check out similar questions: