Package Exports
- @cameratag/microphone
- @cameratag/microphone/microphone.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cameratag/microphone) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
CameraTag's Audio Recorder
This library allows you to embed a CameraTag <microphone> audio recorder in your product.
Initialize A Recorder
'Magically' initialize your recorder using HTML
<microphone
id='myFirstMicrophone'
data-app-id='a-6793d070-dbac-013b-f57a-529b7d4fe95c'>
</microphone>
<script>
CameraTagMicrophone.setup(); // Scan DOM for new <microphone> tags
// if you need to access the newly initialized <:microphone>
// you can get a handle with.
myMicrophone = CameraTagMicrophone.instances["myFistMicrophone"];
</script>
Manually initialize your recorder using JS
<div id="load_recorder_here"></div>
<script>
CameraTagMicrophone = require("@cameratag/microphone");
var el = document.getElementById("load_recorder_here");
var myMicrophone = new CameraTagMicrophone();
myMicrophone.init(el {
id: 'myFirstMicrophone'
appUuid: 'a-6793d070-dbac-013b-f57a-529b7d4fe95c',
})
<script>
Control The Recorder
You can control your <microphone> with methods from our JS API
After you get a handle on a <microphone> you can call methods on it like so:
myMicrophone.record();
Observe The Recorder
You can also observe events fired by the <microphone> and trigger your own code. View our our docs to see the full list of events fired from the <microphone>
myCamera.ovbserve("recordingStarted", function(){
console.log("You are recording!")
});