0.1.2 • Published 6 months ago

@cameratag/microphone v0.1.2

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
6 months ago

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 &lt: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!")
});
0.1.2

6 months ago

0.1.1

8 months ago

0.1.0

8 months ago