summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/media/video-canvas-alpha.html
blob: 9ee14545c4718eca888e94a6cd7802e6e3716b91 (plain)
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
<html>
 <head>
  <script src="media-file.js"></script>

  <script>
    if (window.testRunner) {
      testRunner.waitUntilDone();
    }

    function onLoad() {
      video = document.getElementsByTagName('video')[0];
      video.src = findMediaFile("video", "content/test");
    
      canvas = document.getElementsByTagName('canvas')[0];
      ctx = canvas.getContext('2d');

      video.load();
      video.addEventListener("canplay", function (e) {
        ctx.globalAlpha = 0.5;
        ctx.drawImage(video, 0, 0);

        if (window.testRunner) {
          testRunner.notifyDone();
        }
      }); 
    }
  </script>
 </head>
 <body onload="onLoad();">
   <video></video><canvas width="320px" height="240px" style="position:relative;left:-100px;"> </canvas>
 </body>
</html>