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

Add MediaStreamTrack Content Hints IDL file + test #12502

Merged
merged 2 commits into from Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions interfaces/mst-content-hint.idl
@@ -0,0 +1,8 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
// Source: MediaStreamTrack Content Hints (https://w3c.github.io/mst-content-hint/)

partial interface MediaStreamTrack {
attribute DOMString contentHint;
};
3 changes: 3 additions & 0 deletions mst-content-hint/META.yml
@@ -0,0 +1,3 @@
spec: https://w3c.github.io/mst-content-hint/
suggested_reviewers:
- alvestrand
19 changes: 19 additions & 0 deletions mst-content-hint/idlharness.window.js
@@ -0,0 +1,19 @@
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// META: script=/webrtc/RTCPeerConnection-helper.js

'use strict';

idl_test(
['mst-content-hint'],
['mediacapture-streams', 'dom'],
async idl_array => {
idl_array.add_objects({
MediaStreamTrack: ['audioTrack', 'videoTrack'],
});

const stream = await getNoiseStream({ audio: true, video: true });
self.audioTrack = stream.getAudioTracks()[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Pull stream.getAudioTracks()[0] into a variable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it has to be on the global object for add_objects to work, I presume using eval(). Am I misunderstanding?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DW - Irrelevant given that there should have been 2 different values :)

self.videoTrack = stream.getAudioTracks()[0];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above nit assumes it was intended to re-use the same value. Is it? Or is there a getVideoTracks equivalent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, copypasta, will fix.

}
);