| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../media/media-file.js"></script> | 2 <script src="../../media/media-file.js"></script> |
| 3 <script> | 3 <script> |
| 4 function canplaythrough() { | 4 function canplaythrough() { |
| 5 parent.postMessage("Video loaded", "*"); | 5 parent.postMessage("Video loaded", "*"); |
| 6 } | 6 } |
| 7 | 7 |
| 8 function fullscreenChanged() { | 8 function fullscreenChanged() { |
| 9 parent.postMessage("SUCCEED - entered full screen!", "*"); | 9 parent.postMessage("SUCCEED - entered full screen!", "*"); |
| 10 } | 10 } |
| 11 | 11 |
| 12 onload = function() { | 12 onload = function() { |
| 13 var video = document.getElementById('video'); | 13 var video = document.getElementById('video'); |
| 14 var mediaFile = findMediaFile("video", "../../media/content/test"); | 14 var mediaFile = findMediaFile("video", "../../media/content/test"); |
| 15 video.src = mediaFile; | 15 video.src = mediaFile; |
| 16 video.addEventListener('canplaythrough', canplaythrough); | 16 video.addEventListener('canplaythrough', canplaythrough); |
| 17 video.addEventListener('webkitfullscreenchange', fullscreenChanged); | 17 video.addEventListener('webkitfullscreenchange', fullscreenChanged); |
| 18 video.onclick = function() { | 18 video.onclick = function(event) { |
| 19 video.webkitRequestFullscreen(); | 19 video.webkitRequestFullscreen(); |
| 20 // cancel the activation behavior (click to play/pause) |
| 21 event.preventDefault(); |
| 20 }; | 22 }; |
| 21 } | 23 } |
| 22 </script> | 24 </script> |
| 23 <video id="video" controls width="320" height="240"></video> | 25 <video id="video" controls width="320" height="240"></video> |
| OLD | NEW |