| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>video-orientation-canvas</title> |
| <script>requirePixelDump = true;</script> |
| <script src="video-test.js"></script> |
| <script> |
| window.addEventListener('load', async event => { |
| video1 = document.createElement('video'); |
| video1.src = 'content/rotation-90.mp4'; |
| await waitFor(video1, 'canplay', true); |
| |
| video2 = document.createElement('video'); |
| video2.src = 'content/rotation-180.mp4'; |
| await waitFor(video2, 'canplay', true); |
| |
| video3 = document.createElement('video'); |
| video3.src = 'content/rotation-270.mp4'; |
| await waitFor(video3, 'canplay', true); |
| |
| var canvas1 = document.querySelector('#canvas1'); |
| canvas1.width = video1.videoWidth; |
| canvas1.height = video1.videoHeight; |
| canvas1.getContext('2d').drawImage(video1, 0, 0); |
| |
| var canvas2 = document.querySelector('#canvas2'); |
| canvas2.width = video2.videoWidth; |
| canvas2.height = video2.videoHeight; |
| canvas2.getContext('2d').drawImage(video2, 0, 0); |
| |
| var canvas3 = document.querySelector('#canvas3'); |
| canvas3.width = video3.videoWidth; |
| canvas3.height = video3.videoHeight; |
| canvas3.getContext('2d').drawImage(video3, 0, 0); |
| |
| endTest(); |
| }); |
| </script> |
| </head> |
| <body> |
| <canvas id=canvas1></canvas> |
| <canvas id=canvas2></canvas> |
| <canvas id=canvas3></canvas> |
| </body> |
| </html> |