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

Example from README not working #85

Open
istng opened this issue Mar 15, 2022 · 2 comments
Open

Example from README not working #85

istng opened this issue Mar 15, 2022 · 2 comments

Comments

@istng
Copy link

istng commented Mar 15, 2022

Hi! as described in the title. Steps for reproduction:

- new folder, npm init
- npm install video-stream-merger
- copy and try to use the first example

Result:
"TypeError: VideoStreamMerger is not a constructor" error.

@t-mullen
Copy link
Owner

npm installation is for projects that are using a bundler (like Browserify). Otherwise the browser has no way of knowing you’ve installed an NPM package.

If you’re not using a bundler, include the script through HTML:
<script src="dist/video-stream-merger.js"></script>

@miller-kevin
Copy link

I can confirm that the example from the readme is not working despite using webpack. Looks like it sets a global variable called "VideoStreamMerger" which conflicts with the import.

Changing it to import "video-stream-merger";
makes const merger = new VideoStreamMerger(); work

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