0.1.2 • Published 6 months ago

@cameratag/player v0.1.2

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

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

6 months ago

0.1.1

8 months ago

0.1.0

8 months ago