Player API

Embeddable AppVideoStudio player

Load the app-owned <avs-player> element from /player/api, send it a document, and use these pages when you need a concrete example.

Runtime /player/api
Element <avs-player>
Scope Playground, live demos, component docs
<script type="module" src="https://create.appvideostudio.com/player/api"></script>

<avs-player id="player" class="api-player"></avs-player>

<script type="module">
  const player = document.getElementById('player');
  await player.ready;
  await player.load(documentData);
  await player.preloadAssets();
  await player.play();
</script>
npm install @appvideostudio/sdk
import { createEmptyVideoDocument } from '@appvideostudio/sdk';
import { defineAVSPlayerElement } from '@appvideostudio/sdk/player';

defineAVSPlayerElement();

const doc = createEmptyVideoDocument({ width: 1920, height: 1080 });
// ... add layers, assets, components ...

const player = document.createElement('avs-player');
document.body.appendChild(player);
await player.ready;
await player.load(doc);

The <avs-player> element supports HTML attributes for declarative playback control.

Attribute Type Description
src String Custom player URL. Defaults to /player/ from the script origin.
autoplay Boolean Automatically starts playback after load() or loadFromUrl() resolves. Controls are hidden initially but appear on hover or keyboard interaction.
loop Boolean Automatically seeks to the start and replays when playback ends.
no-controls Boolean Completely hides the scrubber and transport controls. They will not appear on hover or keyboard interaction.
<!-- Auto-play and loop a preview -->
<avs-player autoplay loop></avs-player>

<!-- Auto-play with no visible controls -->
<avs-player autoplay loop no-controls></avs-player>

<script type="module">
  const player = document.querySelector('avs-player');
  await player.ready;
  await player.load(myDocument);
  // Playback starts automatically, no player.play() needed
</script>