This library allows you to embed a CameraTag <player> in your product.
'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 <: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>
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();
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!")
});