Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the mediacapture-record IDL file #9907

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 60 additions & 0 deletions interfaces/mediacapture-record.idl
@@ -0,0 +1,60 @@
// GENERATED CONTENT - DO NOT EDIT
// Content of this file was automatically extracted from the MediaStream Recording spec.
// See https://w3c.github.io/mediacapture-record/

[Exposed=Window,
Constructor(MediaStream stream, optional MediaRecorderOptions options)]
interface MediaRecorder : EventTarget {
readonly attribute MediaStream stream;
readonly attribute DOMString mimeType;
readonly attribute RecordingState state;
attribute EventHandler onstart;
attribute EventHandler onstop;
attribute EventHandler ondataavailable;
attribute EventHandler onpause;
attribute EventHandler onresume;
attribute EventHandler onerror;
readonly attribute unsigned long videoBitsPerSecond;
readonly attribute unsigned long audioBitsPerSecond;

void start(optional long timeslice);
void stop();
void pause();
void resume();
void requestData();

static boolean isTypeSupported(DOMString type);
};

dictionary MediaRecorderOptions {
DOMString mimeType;
unsigned long audioBitsPerSecond;
unsigned long videoBitsPerSecond;
unsigned long bitsPerSecond;
};

enum RecordingState {
"inactive",
"recording",
"paused"
};

[Exposed=Window, Constructor(DOMString type, BlobEventInit eventInitDict)]
interface BlobEvent : Event {
[SameObject] readonly attribute Blob data;
readonly attribute DOMHighResTimeStamp timecode;
};

dictionary BlobEventInit {
required Blob data;
DOMHighResTimeStamp timecode;
};

dictionary MediaRecorderErrorEventInit : EventInit {
required DOMException error;
};

[Exposed=Window, Constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict)]
interface MediaRecorderErrorEvent : Event {
[SameObject] readonly attribute DOMException error;
};
71 changes: 5 additions & 66 deletions mediacapture-record/idlharness.html
Expand Up @@ -12,72 +12,11 @@
</head>
<body>
<canvas id='canvas' width=10 height=10/>

<pre id="idl" style="display: none">
// https://w3c.github.io/mediacapture-record/MediaRecorder.html

[Constructor(MediaStream stream, optional MediaRecorderOptions options)]
interface MediaRecorder : EventTarget {
readonly attribute MediaStream stream;
readonly attribute DOMString mimeType;
readonly attribute RecordingState state;
attribute EventHandler onstart;
attribute EventHandler onstop;
attribute EventHandler ondataavailable;
attribute EventHandler onpause;
attribute EventHandler onresume;
attribute EventHandler onerror;
readonly attribute unsigned long videoBitsPerSecond;
readonly attribute unsigned long audioBitsPerSecond;

void start(optional long timeslice);
void stop();
void pause();
void resume();
void requestData();

static boolean isTypeSupported(DOMString type);
};

dictionary MediaRecorderOptions {
DOMString mimeType;
unsigned long audioBitsPerSecond;
unsigned long videoBitsPerSecond;
unsigned long bitsPerSecond;
};

enum RecordingState {
"inactive",
"recording",
"paused"
};

[Constructor(DOMString type, BlobEventInit eventInitDict)]
interface BlobEvent : Event {
[SameObject] readonly attribute Blob data;
readonly attribute DOMHighResTimeStamp timecode;
};

dictionary BlobEventInit {
required Blob data;
DOMHighResTimeStamp timecode;
};

dictionary MediaRecorderErrorEventInit : EventInit {
required DOMException error;
};

[Exposed=Window, Constructor(DOMString type, MediaRecorderErrorEventInit eventInitDict)]
interface MediaRecorderErrorEvent : Event {
[SameObject] readonly attribute DOMException error;
};

</pre>
<script>
promise_test(async function() {
const main = await fetch('/interfaces/mediacapture-main.idl').then(r => r.text());
const html = await fetch('/interfaces/html.idl').then(r => r.text());
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
promise_test(async () => {
const srcs = ['mediacapture-record', 'mediacapture-main', 'html', 'dom'];
const [idl, main, html, dom] = await Promise.all(
srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));

var canvas = document.getElementById('canvas');
var context = canvas.getContext("2d");
Expand All @@ -86,7 +25,7 @@
var stream = canvas.captureStream();

var idl_array = new IdlArray();
idl_array.add_idls(document.getElementById("idl").textContent);
idl_array.add_idls(idl);
idl_array.add_dependency_idls(main);
idl_array.add_dependency_idls(html);
idl_array.add_dependency_idls(dom);
Expand Down