Skip to content

Commit

Permalink
Update Vidstack stream template (#4134)
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 authored Nov 13, 2023
1 parent baa76e7 commit be36619
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
8 changes: 6 additions & 2 deletions templates/stream/playback/vidstack/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Template: Cloudflare Stream + Video.js Playback
# Template: Cloudflare Stream + Vidstack

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/stream/playback/vidstack)

Example of Video.js playback with Cloudflare Stream
A very simple CDN example of HLS playback with Cloudflare Stream and Vidstack. You can find more
installation options and examples at:

- [Vidstack Site](https://www.vidstack.io)
- [Vidstack Examples Repo](https://github.com/vidstack/examples)
35 changes: 22 additions & 13 deletions templates/stream/playback/vidstack/src/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
<html>
<head>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/vidstack@next/player/styles/default/theme.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/vidstack@next/player/styles/default/layouts/video.min.css"
/>
<script
src="https://cdn.jsdelivr.net/npm/vidstack@next/cdn/with-layouts/vidstack.js"
type="module"
src="https://cdn.jsdelivr.net/npm/@vidstack/player@next/cdn/bundle.js"
></script>
</head>
<body>
<vds-media>
<vds-hls
controls
poster="https://customer-m033z5x00ks6nunl.cloudflarestream.com/b236bde30eb07b9d01318940e5fc3eda/thumbnails/thumbnail.jpg"
>
<video
controls
src="https://customer-m033z5x00ks6nunl.cloudflarestream.com/b236bde30eb07b9d01318940e5fc3eda/manifest/video.m3u8"
preload="none"
></video>
</vds-hls>
</vds-media>
<!-- See https://vidstack.io and https://github.com/vidstack/examples for more options. -->
<media-player
title="Cloudflare Stream Demo"
src="https://customer-m033z5x00ks6nunl.cloudflarestream.com/b236bde30eb07b9d01318940e5fc3eda/manifest/video.m3u8"
>
<media-provider>
<media-poster
class="vds-poster"
src="https://customer-m033z5x00ks6nunl.cloudflarestream.com/b236bde30eb07b9d01318940e5fc3eda/thumbnails/thumbnail.jpg"
></media-poster>
</media-provider>
<media-video-layout></media-video-layout>
</media-player>
</body>
</html>

0 comments on commit be36619

Please sign in to comment.