Vue

A thin Vue 3 component over <pb-play>, loaded through the same loader as the snippet.

Use it

<script setup lang="ts">
import { PbPlay } from '@pb-play/vue';
import { ref } from 'vue';

const player = ref<InstanceType<typeof PbPlay> | null>(null);
const play = () => player.value?.element?.play();
</script>

<template>
    <PbPlay
        ref="player"
        licence-key="pbp_live_…"
        loader="https://<your delivery host>/sdk/web/index"
        playlist="ply_…"
        style="aspect-ratio: 16 / 9"
        @ready="() => console.log('ready')"
        @timeupdate="({ currentTime }) => console.log(currentTime)" />
    <button @click="play">Play</button>
</template>

The component adds the loader's script tag to a container it owns and exposes the element the loader mounts. The player is never bundled into your app, so licensing, version rollout and the fallback that keeps video playing all arrive through the loader.

Props, events and the element

Props: loader (required), licence-key, playlist, media, player and start. Changing any of them mounts a fresh player.

Events are emitted under the element's own names — @ready, @play, @timeupdate, @error — with the same payloads. The component exposes element: the <pb-play> itself, or null until mounted.

Server rendering

Safe in Nuxt and any server renderer: the loader is added in onMounted, which a server render never runs.