Package Exports
- @cameratag/react_camera
- @cameratag/react_camera/react_camera.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/react_camera) 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 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'/>
}