JSPM

@cameratag/react_camera

0.1.7
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 118
    • Score
      100M100P100Q60968F
    • License UNLICENSED

    A React Component wrapping CameraTag's video recorder (<camera>). Allows users to record or upload videos from your product using their webcam or mobile device. Requires a CameraTag account.

    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'/>
    }