Yoav
Yoav

Reputation: 11

MediaStreamTrackGenerator available in Chrome DevTools but not in react app

I want to use the experimental Insertable Stream for MediaStreamTrack API in my project, specifically, the MediaStreamTrackGenerator.

The compatibility chart says it's supported from Chrome 94, and I'm using Chrome 109 (on Windows) so I figured it would be okay.

However, when ran new MediaStreamTrackGenerator({kind: video}) in my local development version of my react app, I got the error: 'MediaStreamTrackGenerator' is not defined no-undef.

First thought this is a problem with my chrome version so I ran the same line in my devtools console, and it worked there.

Then I thought this is because my node, npm, or react version not supporting this feature, so I updated them all to the latest version and it didn't help.**

A weird detail is that this error only appears after I make changes in my code (and it hot-reloads) or that I open devtools for my react app.

Upvotes: 0

Views: 272

Answers (1)

Yoav
Yoav

Reputation: 11

Update: it seems like I just had to add windows. to it.

Upvotes: 0

Related Questions