@cameratag/player

0.1.1 • Public • Published

CameraTag's Video Player

This library allows you to embed a CameraTag <player> in your product.

Initialize A Booth

'Magically' initialize your player using HTML

<player
  id='myFirstPlayer'
  data-uuid='v-6793d070-dbac-013b-f57a-529b7d4fe95c'>
</player>

<script>
  CameraTagPlayer.setup(); // Scan DOM for new <player> tags 
  // if you need to access the newly initialized &lt:player> 
  // you can get a handle with.
  myPlayer = CameraTagPlayer.instances["myFistBooth"];
</script>

Manually initialize your player using JS

<div id="load_player_here"></div>
<script>
  CameraTagPlayer = require("@cameratag/player");
  var el = document.getElementById("load_player_here");
  var myPlayer = new CameraTagPlayer();
  myPlayer.init(el {
    id: 'myFirstPlayer'
    uuid: 'v-6793d070-dbac-013b-f57a-529b7d4fe95c', 
  })
<script>

Control The Player

You can control your <player> with methods from our JS API

After you get a handle on a <player> you can call methods on it like so:

myPlayer.play();

Observe The Player

You can also observe events fired by the <player> and trigger your own code. View our our docs to see the full list of events fired from the <player>

myPlayer.ovbserve("ready", function(){
  console.log("Player is loaded!")
});

/@cameratag/player/

    Package Sidebar

    Install

    npm i @cameratag/player

    Weekly Downloads

    7

    Version

    0.1.1

    License

    UNLICENSED

    Unpacked Size

    352 kB

    Total Files

    3

    Last publish

    Collaborators

    • cdanzig