video-stream-merger icon indicating copy to clipboard operation
video-stream-merger copied to clipboard

Example from README not working

Open istng opened this issue 2 years ago • 2 comments

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.

istng avatar Mar 15 '22 14:03 istng

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>

t-mullen avatar Mar 15 '22 20:03 t-mullen

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

miller-kevin avatar Dec 01 '22 21:12 miller-kevin