Skip to content

[6.x] Render direct video files in a video element - #15457

Open
edalzell wants to merge 1 commit into
statamic:6.xfrom
edalzell:fix/video-fieldtype-file-preview
Open

edalzell wants to merge 1 commit into
statamic:6.xfrom
edalzell:fix/video-fieldtype-file-preview

Conversation

@edalzell

Copy link
Copy Markdown
Contributor

A direct video URL like https://example.com/clip.mp4 is rendered inside an <iframe> — the same element used for YouTube and Vimeo — so it gets no playback controls and relies on whatever the browser decides to do with a bare video document.

The component already distinguishes these via its isVideo computed, so this renders them in a real <video controls> element instead. Lazy-loading behaviour is unchanged; the src is still gated on isVisible.

Split out of #11871 so it can land on its own.

@jasonvarga

Copy link
Copy Markdown
Member

This needs a rebase and conflict resolution now because of #15456

@jasonvarga

Copy link
Copy Markdown
Member

PS. In every browser I tried to load a direct mp4 file, the iframe seemed to include video controls (on 6.x). Was there a specific situation where this was helping?

Regardless, this looks fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants