shopos-player
v0.1.0
Published
Vanilla JavaScript player for ShopOS shoppable video (hotspots, embed analytics hooks, optional signed API reads).
Downloads
9
Maintainers
Readme
shopos-player
Small browser bundle for ShopOS: <video>, tap hotspots from published tags, optional view / click events to your API.
Install
npm install shopos-playerOr from a checkout of this repo:
npm install ./ShopOS/packages/playerUse (script tag)
Expose ShopOSPlayer globally when loaded via <script src="…/shopos-player.js"> (see dist/shopos-player.js).
<div id="player-root"></div>
<script src="node_modules/shopos-player/dist/shopos-player.js"></script>
<script>
ShopOSPlayer.mount({
container: "#player-root",
videoId: "YOUR_VIDEO_UUID",
apiBase: "https://your-shopos-api.example.com",
onProductPeek: function (tag) { console.log(tag); },
embedPayloadToken: "", // if server uses SHOPOS_EMBED_SIGNING_SECRET
embedPublishableKey: "", // if server uses SHOPOS_EMBED_PUBLISHABLE_KEY
}).reload();
</script>CDN after publish (example): https://unpkg.com/[email protected]/dist/shopos-player.js
API surface
ShopOSPlayer.mount(opts)→{ element, video, reload, destroy }- opts:
container(selector or element),videoId,apiBase,onProductPeek, optionalembedPayloadToken,embedPublishableKey
Full demo and checkout UI live in the ShopOS repo: examples/embed.html.
Maintainers: publishing to the npm registry → docs/npm-publish.md (from repo root).
