video-stream-merger
video-stream-merger copied to clipboard
Example from README not working
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.
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>
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