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

MediaStreamTrackProcessor Constructor #4109

Closed
nicopowa opened this issue Aug 14, 2023 · 5 comments
Closed

MediaStreamTrackProcessor Constructor #4109

nicopowa opened this issue Aug 14, 2023 · 5 comments

Comments

@nicopowa
Copy link

nicopowa commented Aug 14, 2023

I've been compiling a project using MediaStreamTrackProcessor instances for a long time, it was not included in the compiler so I was using a custom extern file with the following content :

/**
 * @constructor 
 * @param {MediaStreamTrack} track : 
 */
var MediaStreamTrackProcessor = function(track) {};

The latest version returned a redeclared variable error, so I removed my extern file and got a new error : MediaStreamTrackProcessor is not constructor.

externs.zip//w3c_rtc.js:3645:9

I added two suppress annotations and re-included my externs file.

/**
 * @suppress {duplicate}
 * @suppress {checkTypes}
 * @constructor 
 * @param {MediaStreamTrack} track : 
 */
var MediaStreamTrackProcessor = function(track) {};

My project is compiling properly but I still get warnings about MediaStreamTrackProcessor not being a constructor.

@niloc132
Copy link
Contributor

niloc132 commented Aug 14, 2023

According to the linked externs, the MediaStreamTrackProcessor is not a real class, but an interface that describes structure only. This doesn't seem to be correct according to mdn's docs (edit: and the spec too), which looks somewhat similar to what you've shared, except that the first arg should not be MediaStreamTrack track, but an options object (a @struct/@record in closure's terms) which includes that track.

The linked externs conflict with yours, but both appear to be technically wrong. Perhaps make a PR to propose fixes to the linked file? Since commits come from inside of Google, it isn't clear who wrote or reviewed 70bd4d0 to ask about this discrepancy, maybe a maintainer can take a look?

@h-joo
Copy link

h-joo commented Aug 16, 2023

Would you mind sending a PR to update what correctly reflects the spec?

@nicopowa
Copy link
Author

It would be my first pull request :-D
According to the docs, MediaStreamTrackProcessor should be a constructor.
Closure is one of the best programs I ever used.
Maybe I should share the code I built on top of it to compile all my vanilla ice cream projects with one click :)

@niloc132
Copy link
Contributor

I'd be happy to work with you to get the PR ready to go.

Sharing how you run the compiler would be great too - maybe a good post to discussions?

@nicopowa
Copy link
Author

That would be nice, maybe this week-end ? Should I clone the repository ?

I opened a discussion !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants