Ember addon providing cross browser access to getUserMedia
- Ember.js v3.28 or above
- Ember CLI v3.28 or above
- Node.js v14 or above
ember install ember-cli-usermedia
To get a simple HTML5 autoplay video element that grabs the webcam use
{{user-media-src}}
To capture either video or audio use mediaConstraints
. The value should be a valid constraints object for getUserMedia. The minimum requirement is the default of { video: true, audio: false }
.
myConstraints: { video: true; audio: false; } // default
...
{{user-media-src mediaConstraints=myConstraints}}
To do something more sophisticated in markup, use the block form:
{{#user-media-src mediaConstraints=myConstraints as |media| }}
<video class="webcam" autoplay=true src={{media.videoUrl}} />
<!-- or -->
<video class="webcam" autoplay=true srcObject={{media.videoStream}} />
{{/user-media-src}}
npm run lint:js
npm run lint:js -- --fix
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versions
ember serve
- Visit the dummy application at http://localhost:4200.
This project is licensed under the MIT License.