blob: ceda986553bbfc7337548d1a00eb65b495d1f025 (
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
|
<html class="reftest-wait">
<head>
<script>
async function start () {
const canvas = document.createElement("canvas")
const context = canvas.getContext("2d")
context.fillStyle = "blue"
context.fillRect(0, 0, canvas.width, canvas.height)
const stream = canvas.captureStream()
const track = stream.getTracks()[0]
const recorder = new MediaRecorder(stream)
recorder.start()
await new Promise(r => recorder.onstart = r)
recorder.pause()
stream.removeTrack(track)
recorder.resume()
await new Promise(r => recorder.onstop = r)
document.documentElement.removeAttribute("class")
}
window.addEventListener('load', start)
</script>
</head>
</html>
|