まず video 要素を作成し、poster 属性でプレビュー用のサムネイル画像を設定します。サムネイル画像の生成手順は サムネイルを表示する を参照してください。
<video
id="video"
width="640"
poster="https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.jpg"
controls
autoplay
></video>次に DOMContentLoaded イベントを待ち、Shaka Player の新しいインスタンスを作成して、マニフェスト URI を読み込みます。
// Replace the manifest URI with an HLS or DASH manifest from Cloudflare Stream
const manifestUri =
'https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.mpd';
document.addEventListener('DOMContentLoaded', () => {
const video = document.getElementById('video');
const player = new shaka.Player(video);
await player.load(manifestUri);
});詳細は Shaka Player のドキュメント ↗ を参照してください。