summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mediacapture-record/MediaRecorder-video-key-frame-distance.html
blob: b986b3075ff6d9e71ff83033dadf96ca0d8037c0 (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
33
34
35
36
37
38
39
<!doctype html>
<html>
<head>
    <title>MediaRecorder Stop</title>
    <link rel="help" href="https://w3c.github.io/mediacapture-record/MediaRecorder.html#mediarecorder">
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="utils/sources.js"></script>
</head>
<body>
<script>
    promise_test(async t => {
        const {stream: video} = createVideoStream(t);
        let videoKeyFrameIntervalDurationUsed = false;
        var options = {
            get videoKeyFrameIntervalDuration() {
                videoKeyFrameIntervalDurationUsed = true;
                return 1000;
            }
        }
        const recorder = new MediaRecorder(video, options);
        assert_true(videoKeyFrameIntervalDurationUsed);
    }, "MediaRecorder interprets videoKeyFrameIntervalDuration");

    promise_test(async t => {
        const {stream: video} = createVideoStream(t);
        let videoKeyFrameIntervalCountUsed = false;
        var options = {
            get videoKeyFrameIntervalCount() {
                videoKeyFrameIntervalCountUsed = true;
                return 5;
            }
        }
        const recorder = new MediaRecorder(video, options);
        assert_true(videoKeyFrameIntervalCountUsed);
    }, "MediaRecorder interprets videoKeyFrameIntervalCount");
</script>
</body>
</html>