0.1.6 • Published 6 months ago

@cameratag/react_camera v0.1.6

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

CameraTag's Video Recorder

This react component allows you to embed a CameraTag <Camera> video recorder in your React app.

Initialize A Recorder

Below is an example of how to load a <Camera> in your app and (optionally) grab a handle to the object to be able to call methods / observe events from our JS API.

import Camera from "@cameratag/react_camera";

export default function App() {
  return <Camera appUuid='a-6793d070-dbac-013b-f57a-529b7d4fe95c' id='myCamera'/>
}

Call Methods / Observe Events

If you want to call methods on the <Camera> from our JS API you can pass a function into the onInit prop and the function will be passed a handle to the newly initialized <Camera>.

import Camera from "@cameratag/react_camera";

export default function App() {

  function getHandle(recorder) {
    // you can call then call API methods or observe events
    recorder.record();
    recorder.observe("recordingStarted", ()=>{
      console.log("You're recording!");
    });
  }

  return <Camera onInit={getHandle} appUuid='a-6793d070-dbac-013b-f57a-529b7d4fe95c' id='myCamera'/>
}
0.1.6

6 months ago

0.1.5

8 months ago

0.1.4

8 months ago

0.1.3

8 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago