Cloudflare Docs
Visit Stream on GitHub
Set theme to dark (⇧+D)

Shaka Player

Example of video playback with Cloudflare Stream and Shaka Player

Run and edit this code in your browser on StackBlitz.

First, create a video element, using the poster attribute to set a preview thumbnail image. Refer to Display thumbnails for instructions on how to generate a thumbnail image using Cloudflare Stream.


Then listen for DOMContentLoaded event, create a new instance of Shaka Player, and load the manifest URI.

// Replace the manifest URI with an HLS or DASH manifest from Cloudflare Stream
const manifestUri =
document.addEventListener('DOMContentLoaded', () => {
const player = new shaka.Player(video);
const video = document.getElementById('video');
await player.load(manifestUri);

Refer to the Shaka Player documentation for more information.