| <!DOCTYPE html> |
| <html> |
| <style> |
| :-webkit-full-screen #controls { |
| position: absolute; |
| bottom: 0; |
| left: 0; |
| width: 100%; |
| background-color: red; |
| } |
| :-webkit-full-screen #container { |
| width: 100%; |
| background-color: red; |
| padding-top: 100px; |
| padding-bottom: 100px; |
| } |
| |
| :-webkit-full-screen #container > video { |
| width: 100%; |
| } |
| |
| </style> |
| <div id='player'> |
| <div id='container'> |
| <video></video> |
| </div> |
| <div id='controls'> |
| <button>foo</button><button>bar</button> |
| </div> |
| </div> |
| <div id='fs'>fullscreen</div> |
| <script> |
| var video = document.querySelector('video'); |
| video.src = 'content/test.ogv'; |
| |
| document.querySelector('#fs').addEventListener('click', e => { |
| document.querySelector('#player').webkitRequestFullscreen(); |
| }); |
| |
| if (window.testRunner && window.eventSender && window.internals) { |
| testRunner.waitUntilDone(); |
| |
| video.addEventListener('loadedmetadata', e => { |
| var bounding = document.querySelector('#fs').getBoundingClientRect(); |
| eventSender.mouseMoveTo(bounding.left + bounding.width / 2, |
| bounding.top + bounding.height / 2); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| }); |
| |
| document.addEventListener('webkitfullscreenchange', e => { |
| internals.setPersistent(video, true); |
| testRunner.notifyDone(); |
| }); |
| } |
| </script> |
| </html> |