| Index: third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html b/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1cae503623cc367b6f7fa46ff5a9baa810745c75
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/media/resources/autoplay-crossorigin-iframe.html
|
| @@ -0,0 +1,49 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../../media-resources/media-file.js"></script>
|
| +<body></body>
|
| +<script>
|
| +window.internals.settings.setCrossOriginMediaPlaybackRequiresUserGesture(true);
|
| +window.internals.runtimeFlags.autoplayMutedVideosEnabled = true;
|
| +
|
| +{
|
| + var video = document.createElement('video');
|
| + video.id = 'video';
|
| + video.src = findMediaFile('video', 'test');
|
| + video.autoplay = true;
|
| + video.loop = true;
|
| + document.body.appendChild(video);
|
| +}
|
| +
|
| +{
|
| + var video = document.createElement('video');
|
| + video.id = 'video-muted';
|
| + video.src = findMediaFile('video', 'test');
|
| + video.muted = true;
|
| + video.autoplay = true;
|
| + video.loop = true;
|
| + document.body.appendChild(video);
|
| +}
|
| +
|
| +var video = document.querySelector("#video");
|
| +var videoMuted = document.querySelector("#video-muted");
|
| +
|
| +video.addEventListener('canplay', _ => {
|
| + console.log('video canplay');
|
| + window.parent.postMessage({
|
| + msg: 'canplay',
|
| + videoId: video.id,
|
| + isPaused: video.paused,
|
| + readyState: video.readyState
|
| + }, "*");
|
| +});
|
| +
|
| +videoMuted.addEventListener('play', _ => {
|
| + console.log('videoMuted play');
|
| + console.log(videoMuted.id);
|
| + window.parent.postMessage({
|
| + msg: 'play',
|
| + videoId: videoMuted.id,
|
| + }, "*");
|
| +});
|
| +
|
| +</script>
|
|
|