Debian Codegraph @

testing/web-platform/mozilla/tests/service-workers/resources/crossorigin_media_iframe.html

raw
1 <!DOCTYPE html>
2 <body>
3 <script>
4
5 'use strict';
6
7 function remoteize(relpath) {
8 let curdir = location.href.replace(/\/[^\/]*$/, '/')
9 return curdir.replace('://', '://www1.') + relpath
10 }
11
12 function create_media_promise() {
13 return new Promise((resolve, reject) => {
14 let video = document.createElement('video')
15 video.autoplay = true
16 video.muted = true
17 video.onplay = () => resolve('ok')
18 video.onerror = () => reject('video error')
19 video.src = remoteize('fetch_video.py')
20 })
21 }
22
23 </script>
24 </body>