Last active
June 26, 2016 15:48
-
-
Save CesarBarros/60731990711bbdf3d4a2400ccb04d5f7 to your computer and use it in GitHub Desktop.
Vídeo Html5 entrar em Fullscreen pelo navegador automaticamente ao carregar a página!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Teste2</title> | |
</head> | |
<body> | |
<div id="videos"> | |
<!-- | |
preload = inicia o carregamento automatico do vídeo; | |
autoplay = inicia player automatico do vídeo (após carregar o vídeo); | |
controls = adicionado controle de navegação no vídeo; | |
loop = loop infinito no vídeo; | |
poster = especifica qual será a imagem a ser exibida enquanto o vídeo é carregado (URL); | |
muted = deixa o vídeo mudo; | |
--> | |
<video onload="goFullscreen('0'); return false" id="0" name="0" preload autoplay controls> | |
<source src="videos/html5/institucional2012/institucional2012.ogv" type='video/ogg; codecs="theora, vorbis"'/> | |
<source src="videos/html5/institucional2012/institucional2012.webm" type='video/webm' > | |
<source src="videos/html5/institucional2012/institucional2012.mp4" type='video/mp4'> | |
</video> | |
</div> | |
<!-- include jQuery library --> | |
<script type="text/javascript" src="files/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
function goFullscreen(id) { | |
var element = document.getElementById(id); | |
if (element.mozRequestFullScreen) { | |
element.mozRequestFullScreen(); | |
} else if (element.webkitRequestFullscreen) { | |
element.webkitRequestFullscreen(); | |
} | |
} | |
goFullscreen('0'); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment