Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(396)

Side by Side Diff: LayoutTests/fullscreen/resources/video.html

Issue 208483002: Implement the activation behavior of media elements (click to play/pause) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: cancel activation behavior in a failing fullscreen test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/media/activation-behavior.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/media/activation-behavior.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698