Skip to main content
VideoField ← Back to Table of Contents

Summary

Custom video player with optional YouTube embed, skip controls, PiP, fullscreen, and compact control layout.

Basic usage

HTML5 video with poster

YouTube embed from state


State & validation

Stored value

State string = direct video URL or YouTube/Vimeo URL.

Validation rules

Built-in validation ensures the URL is a valid string and matches supported media patterns.

Configuration API

All methods accept Closure unless noted.

ratio()

Supports standard aspect ratios. Invalid strings throw an InvalidArgumentException.

controlsLayout()

Use compact for a minimal control bar:

Real-world examples

Background video (Hero)

YouTube training video


Playground

/admin/flex-fields-playground/video-field See Playground for setup.

CSS classes (reference)


Performance