diff --git a/content/collections/fieldtypes/video.md b/content/collections/fieldtypes/video.md index 6c34e8c8f..00b0301a2 100644 --- a/content/collections/fieldtypes/video.md +++ b/content/collections/fieldtypes/video.md @@ -1,8 +1,8 @@ --- title: Video -description: Extract embed URLs from Youtube, Vimeo, and HTML5 compatible video links and preview them right inline. +description: Extract embed URLs from Youtube, Vimeo, Cloudflare Stream, and HTML5 compatible video links and preview them right inline. intro: | - Extract embed URLs from Youtube, Vimeo, and HTML5 compatible video links and preview them right inline. Feel free watch the whole thing instead of working – we won't tell. + Extract embed URLs from Youtube, Vimeo, Cloudflare Stream, and HTML5 compatible video links and preview them right inline. Feel free watch the whole thing instead of working – we won't tell. screenshot: fieldtypes/screenshots/v6/video.webp screenshot_dark: fieldtypes/screenshots/v6/video-dark.webp id: ced8b901-95bd-4006-b70e-4ea04d72fcb7 @@ -15,8 +15,11 @@ You may enter: - YouTube URLs: `https://www.youtube.com/watch?v=s9F5fhJQo34` - Vimeo URLs: `https://vimeo.com/22439234` +- Cloudflare Stream URLs: `https://customer-abc123.cloudflarestream.com/b209b1484821fff0ed2e5535fbb4ff7b/watch` - mp4, ogv, mov, or webm URLs: `http://example.com/video.mp4` +For Cloudflare Stream, use the URL from the **Video Link** button in the Cloudflare dashboard. The `/iframe` URL from the embed code works too, and keeps any player options (like `autoplay` or `muted`) from its query string. Manifest URLs (`.m3u8` and `.mpd`) can't be embedded. + ## Data Structure The Video field will save the URL of the video you've entered. If you paste embed code into the field, it will extract the proper URL for you. @@ -35,7 +38,7 @@ You can use the [is_embeddable](/modifiers/is_embeddable) and ::tab antlers ```antlers {{ if video | is_embeddable }} - + {{ else }} @@ -45,7 +48,7 @@ You can use the [is_embeddable](/modifiers/is_embeddable) and ::tab blade ```blade @if (Statamic::modify($video)->isEmbeddable()->fetch()) - + @else @@ -79,10 +82,10 @@ The video field is augmented into an object that still outputs the URL you enter | Variable | Description | |----------|-------------| | `url` | The URL that was entered. | -| `provider` | `youtube`, `vimeo`, `file` (a direct link to a video file), or `unsupported`. | -| `id` | The YouTube or Vimeo video ID. `null` for other providers. | +| `provider` | `youtube`, `vimeo`, `cloudflare`, `file` (a direct link to a video file), or `unsupported`. | +| `id` | The YouTube, Vimeo, or Cloudflare Stream video ID. `null` for other providers. | | `privacy_hash` | The privacy hash of an unlisted Vimeo video (e.g. the `abc123` in `vimeo.com/22439234/abc123`). `null` otherwise. | -| `embed_url` | The embeddable player URL for YouTube and Vimeo, the URL itself for video files, or `null` for anything unsupported. | +| `embed_url` | The embeddable player URL for YouTube, Vimeo, and Cloudflare Stream, the URL itself for video files, or `null` for anything unsupported. | This lets you check the provider directly rather than reaching for modifiers: diff --git a/content/collections/modifiers/embed_url.md b/content/collections/modifiers/embed_url.md index 9ad82baeb..21f357142 100644 --- a/content/collections/modifiers/embed_url.md +++ b/content/collections/modifiers/embed_url.md @@ -5,7 +5,7 @@ modifier_types: - string title: 'Embed Url' --- -Converts a Youtube or Vimeo link to their embed URLs. +Converts a Youtube, Vimeo, or Cloudflare Stream link to their embed URLs. Plays nicely with the [Video fieldtype](/fieldtypes/video) and the [is_embeddable modifier](/modifiers/is_embeddable). diff --git a/content/collections/modifiers/is_embeddable.md b/content/collections/modifiers/is_embeddable.md index 146c4abd1..e66c71a25 100644 --- a/content/collections/modifiers/is_embeddable.md +++ b/content/collections/modifiers/is_embeddable.md @@ -5,7 +5,7 @@ modifier_types: - string title: 'Is Embeddable' --- -Recognizes YouTube and Vimeo URLs as supported embed sources. This does not check whether the video exists or whether its owner permits embedding. +Recognizes YouTube, Vimeo, and Cloudflare Stream URLs as supported embed sources. This does not check whether the video exists or whether its owner permits embedding. Plays nicely with the [Video fieldtype](/fieldtypes/video) and the [embed_url modifier](/modifiers/embed_url).