1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
<!doctype html>
<html>
<head>
<title>Full Screen Example</title>
<style type="text/css">
/* make the video stretch to fill the screen in WebKit */
:-webkit-full-screen #myvideo {
width: 100%;
height: 100%;
}
</style>
<script>
function toggleFullScreen() {
var vivi = document.getElementById("myvideo");
var dv = document.getElementById("mydiv");
if (!document.mozFullScreen && !document.webkitFullScreen) {
if (dv.mozRequestFullScreen) {
dv.mozRequestFullScreen();
vivi.style.height='100%'
vivi.style.width='100%'
}
else {
dv.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
vivi.style.height='100%'
vivi.style.width='100%'
}
}
else {
if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
vivi.style.height='50%'
vivi.style.width='50%'
}
else {
document.webkitCancelFullScreen();
vivi.style.height='50%'
vivi.style.width='50%'
}
}
}
document.addEventListener("keydown", function(e) {
if (e.keyCode == 13) {
toggleFullScreen();
}
}, false);
</script>
</head>
<body>
<div id="mydiv" style='position:relative;height:100%;width:100%'>
<video id="myvideo" controls src="http://videos-cdn.mozilla.net/serv/webmademovies/Moz_Doc_0329_GetInvolved_ST.webm" style='height:50%;width:50%' >
</video>
<img style='position:absolute;top:0px;left:0px;' src='carte_france.gif' id="myimage"/>
</div>
</body>
</html> |
Partager