Newsletter

Hear about new files and fixes

I send an email when I publish something new or release a fix for a file you might already use. There’s no fixed schedule.

Every email has a one-click unsubscribe link, and none of them contain tracking pixels.

Etch component

Video Player

This Etch video player for WordPress plays MP4 and WebM files, HLS streams, YouTube and Vimeo, or a muted background video behind a hero. It comes with accessible controls and captions, and it can ask for privacy consent before YouTube or Vimeo connect.

Download .jsonSee the demo

Paste it on the Etch canvas with Ctrl+V or ⌘V, then click Save.

Lite is the same player without HLS, for sites with files, YouTube and Vimeo only.

Download Lite .json

Stay up to date. Etch won’t update a pasted component for you. Subscribe and get one email when a new version is out.

Free on unlimited personal, client and commercial sites. Modify it however you like.License: FSL-1.1-MIT
Version
1.0.0-beta.1Changelog
Options
39 settings+ 60 CSS variablesSee all
Tested on Etch
1.8.0
Tested on WordPress
7.1.4
Live demo

10 players in real layouts

Press Play on any of them; most pause the others when they start. The YouTube player asks before it connects, and Mobile switches to a phone width.

Live
  • Players: 10
  • Sources: File, HLS, YouTube, Vimeo
  • Modes: Player, Background
  • Versions: Video Player, Lite
Open in a new tab
Features

What it does

The whole Etch video player is one pasted component. Media Chrome, hls.js and the Vimeo Player SDK are bundled, and the CSS and scripts travel with it, so you need no plugin, no CDN and no API key.

  • Four sources in one component

    MP4 and WebM files and HLS streams play with Media Chrome controls. YouTube and Vimeo links play with the provider’s own controls, so their captions and quality menu keep working. You need no API key.

  • Background video for heroes

    Background mode plays a muted, looping file or stream behind the Content slot, under your heading and button. Its one pause button always stays visible. Under reduced motion it shows the poster until the visitor presses Play.

  • Consent before YouTube and Vimeo

    With Privacy Consent on, the page asks first and requests nothing from YouTube or Vimeo before the visitor agrees, not even an image. A Consent Cookie field or a short script connects your cookie banner.

  • Loads the video when it’s needed

    When Visible loads the video once the player is within 200px of the screen. Eager loads it with the page. On Interaction requests no video, stream or caption file until the first Play press.

  • Captions and a large play button

    WebVTT captions, one row per language, in a menu that works before the first Play. A large play button sits over the poster, and a loading ring shows when a start takes longer than 300 ms.

  • Accessible by default

    The player is a region named by Video Title. Every control works from the keyboard with a visible focus ring, and it follows reduced motion and forced colors. Checked with TalkBack on an Android emulator and VoiceOver on a Mac.

  • 60 styling variables

    Colors and sizes of the frame, controls, timeline, play button, Background mode and consent panel, set on any parent element. ACSS 4 tokens with plain fallbacks, so it works without Automatic.css too.

  • A Lite version without HLS

    ED Video Player Lite leaves out HLS, for sites with only files, YouTube and Vimeo. It carries about 70 KB of gzipped JavaScript instead of about 260 KB, with the same CSS, runtime and other props.

Install

Add it in four steps

This WordPress video component installs like any other Etch component, with a paste, and needs no plugin, no CDN and no API key. The paste brings the CSS and three scripts with Media Chrome, hls.js and the Vimeo Player SDK bundled; Lite has two and leaves out hls.js. Your videos stay in your Media Library or on your video host. It works with or without Automatic.css 4.

Video Player or Lite? ED Video Player plays video files, HLS streams, YouTube and Vimeo. Lite plays files, YouTube and Vimeo. Etch puts a component’s scripts on every page that uses it, so a page with ED Video Player carries about 260 KB of gzipped JavaScript, even when its only player shows a YouTube link. With Lite it is about 70 KB. Take Lite when no player needs an .m3u8 stream. Take ED Video Player for a live stream or adaptive quality from a video platform, or when you’re not sure. Both can sit on one site, even on one page, as long as they are the same version.

Shows without its styles? It was pasted but not saved, and pasting again won’t repair it. Delete ED Video Player from your components, paste it again, click Save and reload the builder. The same goes for Lite.

  1. Copy the componentUse Copy component at the top of this page, or Copy Lite for the version without HLS. You can also download the .json file.
  2. Paste, save and reloadSelect where it should go, press Ctrl+V or ⌘V and click Save. Then reload the builder before you go on: Etch has lost edits saved later in the same session.
  3. Choose the sourceSet Source Type and fill the field that matches: Video File, HLS URL or YouTube / Vimeo URL. Add a Poster from your own site, in the shape of the video.
  4. Name it and saveGive it a Video Title, such as Product tour, so screen readers can tell the players apart. Add Captions rows for a file or a stream, then save.
Options

39 settings in the Etch props panel

In the order of the Etch props panel, where each setting has help text too. Only the source needs filling in: everything else has a working default, and empty labels fall back to built-in English text.

Only the matching source is used

Source Type decides which field plays: Video File, HLS URL or YouTube / Vimeo URL. The player ignores the other two. A player without a usable source is hidden on the published page, and the builder shows a prompt in its place.

The switches marked Video File and HLS, the Captions rows and Object Fit don’t change YouTube and Vimeo, which use the provider’s own controls and captions. Privacy Consent applies to YouTube and Vimeo only. Lite has no HLS URL and no HLS option in Source Type.

Video and source

Video Titletitle
Names the player for screen readers and titles the YouTube or Vimeo frame, such as Product tour. Give each player on a page its own title.Default: Video
Display ModedisplayMode
Player shows the video with controls. Background fills its container behind the Content slot, muted and looping, with only a pause button. Background works with Video File and HLS only.Default: Player
Source TypesourceType
Video File plays a file, HLS a stream, and YouTube and Vimeo embed a pasted link. Only the source field that matches is used.Default: Video File
Video Filevideo
An MP4 or WebM from the Media Library, or a direct http(s) URL. A file on another site needs CORS only when a Captions row comes from another origin. Empty hides the player on the page.Empty by default.
HLS URLhlsUrl
Video Player only. The http(s) URL of the stream manifest, usually ending in .m3u8. Signed URLs with a query string work. The host must allow CORS.Empty by default.
YouTube / Vimeo URLembedUrl
The video link, such as a youtu.be or vimeo.com address. Watch, share, Shorts, live and embed links work; a playlist on its own does not. For an unlisted Vimeo video, keep the full link with its hash.Empty by default.
Posterposter
Image shown before playback. Use an image from your own site: with Privacy Consent on, one hosted by YouTube or Vimeo stays hidden until consent. Match the shape of the video to avoid a size change.Empty by default.

Shape

Aspect RatioaspectRatio
Shape of the whole player, controls included: 16 / 9, 4 / 3, 1 / 1, 9 / 16, Auto or Custom. Auto follows the poster or video for files and HLS, and uses 16 / 9 for YouTube and Vimeo.Default: 16 / 9
Custom Aspect RatiocustomAspectRatio
Used when Aspect Ratio is Custom: width / height, such as 21 / 9 or 2.35, from 0.1 to 10. Anything else falls back to 16 / 9.Default: 21 / 9
Object FitobjectFit
Video File and HLS. Contain shows the whole picture with bars; Cover fills the frame and crops the edges. YouTube and Vimeo always contain.Default: Contain

Playback

Autoplayautoplay
Starts playing as soon as the video loads. Browsers usually block autoplay with sound, so turn on Muted too. A blocked file or stream shows the large play button and never mutes itself. It never autoplays in the Etch builder.Default: Off
Mutedmuted
Starts without sound, which reliable autoplay needs. Visitors can still turn the sound on with the mute button.Default: Off
Looploop
Starts again from the beginning when the video ends.Default: Off
Load MedialoadMedia
When Visible loads the video once the player is within 200px of the screen. Eager loads it with the page. On Interaction loads nothing until the first Play press. It defers the video, not the scripts or the poster of a file or stream.Default: When Visible

Controls

Show Large Play ButtonshowBigPlay
Video File and HLS. A large play button over the poster until playback starts. Not used in Background mode.Default: On
Show TimelineshowTimeline
Video File and HLS. The seek bar, in its own row above the buttons.Default: On
Show TimeshowTime
Video File and HLS. The current time and duration, hidden automatically when the player is narrower than 480px.Default: On
Show VolumeshowVolume
Video File and HLS. The volume slider, hidden when the player is narrower than 480px. The mute button always stays.Default: On
Show Playback RateshowPlaybackRate
Video File and HLS. A speed button that cycles through 0.5×, 1×, 1.5× and 2×.Default: On
Show CaptionsshowCaptions
Video File and HLS. The captions menu, shown when the Captions list has at least one valid row. Without rows, an HLS player offers the subtitles inside the stream; turned off, they stay off.Default: On
Show Picture in PictureshowPictureInPicture
Video File and HLS. The picture-in-picture button, where the browser supports it. Hidden below 360px player width.Default: On
Show FullscreenshowFullscreen
Video File and HLS. The fullscreen button, where the browser supports it.Default: On
Auto Pause Other PlayersautoPauseOtherPlayers
Starting this player pauses other ED Video and Audio Players on the page. Turned off, it pauses no other player, but others can still pause it.Default: On

Captions

Captionscaptions
Video File and HLS. WebVTT caption files, one row per language. YouTube and Vimeo show the captions uploaded to their own service.Empty by default.
Sourcecaptions.source
URL of a WebVTT (.vtt) file served as text/vtt. A file on another domain must allow CORS.Empty by default.
Languagecaptions.language
Language code of the captions, such as en, pl or de-AT. A row with an invalid code is ignored.Default: en
Labelcaptions.label
Name shown in the captions menu, such as English or Polski. Empty uses the language code.Default: English
Defaultcaptions.default
Turns this track on automatically. When several rows are marked, the first valid one wins, unless the visitor has already chosen in the captions menu.Default: Off

Button labels and Background mode

Play Button LabelplayLabel
Screen-reader name of the large play button, and of the Background button while paused, in your site language. Empty uses Play video.Empty by default.
Pause Button LabelpauseLabel
Screen-reader name of the Background button while playing, in your site language. Empty uses Pause video.Empty by default.
Pause Button PositionpausePosition
Background mode: Bottom End, Bottom Start, Top End or Top Start. Pick the corner away from your content. End is the right side on left-to-right pages.Default: Bottom End

Privacy Consent

Consentconsent.mode
YouTube and Vimeo only. Off connects as Load Media says. Ask shows a consent message on every page load. Ask and Remember adds a checkbox that keeps the choice in this browser for 12 months.Default: Off
Messageconsent.text
Message shown before the page connects, in your site language. Empty names the service and says that it may set cookies and process personal data.Empty by default.
Button Textconsent.loadLabel
Text of the button that gives consent and loads the video. Empty uses Load video.Empty by default.
Remember Textconsent.rememberLabel
Text of the Ask and Remember checkbox. Empty uses Always load YouTube videos, or Always load Vimeo videos.Empty by default.
Withdraw Textconsent.forgetLabel
Text of the button under a remembered video that withdraws consent. Empty uses Stop loading YouTube videos automatically, or the same for Vimeo.Empty by default.
Privacy URLconsent.privacyUrl
Optional link to your privacy policy, as an http(s) or relative URL. Empty hides the link.Empty by default.
Privacy Textconsent.privacyLabel
Text of the privacy link. Empty uses Privacy policy.Empty by default.
Consent Cookieconsent.cookie
Connects a cookie banner without code, as cookie name=text, such as cmplz_marketing=allow. The video loads once that cookie contains the text. It hides the remember checkbox.Empty by default.
Styling: 60 CSS variables

Set them on any parent element or class, such as a Section or a Div around one player, or on :root for the whole site. Etch gives a component instance no class field. The component’s root style starts with a commented guide that lists all 60 with their defaults; uncomment the lines you need. A default of inherit takes the value from the page around the player, so leave that variable unset to keep it. Check contrast when you change colors.

Frame

--ed-video-player-max-width
Maximum width of the player. It stays left-aligned; add margin-inline: auto on your own class to center it.Default: 100%
--ed-video-player-bg
Background behind the picture: the letterbox bars, an empty player and fullscreen.Default: #000
--ed-video-player-radius
Corner radius of the frame. In Background mode the default is 0.Default: var(--radius, 0.25rem)
--ed-video-player-border
Border shorthand around the frame, such as var(--border) or 1px solid var(--border-color-dark).Default: 0
--ed-video-player-shadow
Box shadow of the frame, such as var(--box-shadow-1).Default: none
--ed-video-player-font-family
Font of the time, speed, captions menu, tooltips, load button, consent panel and status.Default: inherit

Control bar

--ed-video-player-control-color
Icons and text of the controls. The track, buffered and hover colors, the menu, the tooltips, the buttons over the picture and the consent panel derive from it.Default: var(--text-light, #fff)
--ed-video-player-control-bg
Background of the whole control area, both rows. The menu, the tooltips, the buttons over the picture and the consent panel follow it.Default: var(--bg-dark, #17191c)
--ed-video-player-control-hover-bg
Hover background of the buttons, on devices that can hover.Default: control color at 15%
--ed-video-player-text-size
Size of the time and speed text.Default: var(--text-s, 0.875rem)

Timeline and volume

--ed-video-player-accent
Played part of the timeline and volume, their handles, the focus ring and the consent checkbox.Default: var(--text-light, #fff)
--ed-video-player-progress-color
Played part of the timeline and the volume level. It overrides the accent there.Default: accent
--ed-video-player-thumb-color
Round handle of the timeline and volume.Default: progress color
--ed-video-player-track-color
Unplayed part of the tracks.Default: control color at 20%
--ed-video-player-buffered-color
Already downloaded part of the timeline.Default: control color at 40%
--ed-video-player-track-height
Track thickness. Keep it at 24px or less.Default: 4px
--ed-video-player-track-radius
Track corner radius, such as 999px for a pill.Default: 1px
--ed-video-player-thumb-size
Handle diameter. Keep it at 24px or less.Default: 10px
--ed-video-player-volume-width
Width of the volume slider.Default: 72px

Keyboard focus

--ed-video-player-focus-color
Inset focus ring on the controls and on the buttons over the picture, and the ring on the consent checkbox and privacy link. Keep 3:1 contrast with the control background, those buttons and the consent panel.Default: accent
--ed-video-player-focus-width
Focus ring thickness.Default: 2px

Captions menu and tooltips

--ed-video-player-menu-bg
Background of the captions menu.Default: control background
--ed-video-player-menu-color
Text and icons of the captions menu.Default: control color
--ed-video-player-menu-radius
Corner radius of the captions menu.Default: frame radius
--ed-video-player-tooltip-bg
Background of the control tooltips.Default: control background
--ed-video-player-tooltip-color
Text of the control tooltips.Default: control color

YouTube and Vimeo load button

--ed-video-player-launch-bg
Background of the load, retry and consent button.Default: control background
--ed-video-player-launch-color
Text of the load, retry and consent button.Default: control color
--ed-video-player-launch-hover-bg
Hover background of the button, on devices that can hover.Default: background mixed 20% toward the text color
--ed-video-player-launch-border
Border shorthand of the button.Default: 1px solid currentColor
--ed-video-player-launch-radius
Corner radius of the button, such as 999px.Default: frame radius

Status message

--ed-video-player-status-color
Color of the messages under the player: load errors on the page, and setup prompts in the builder.Default: inherit
--ed-video-player-status-size
Size of those messages, such as var(--text-s).Default: inherit

Large play button

--ed-video-player-big-play-size
Width of the button; a percentage refers to the player width. Its height follows, up to the height of the picture, so it stays above the control rows.Default: clamp(3rem, 14%, 5.5rem)
--ed-video-player-big-play-bg
Background of the button, and of the disc behind the loading ring.Default: control background at 80%
--ed-video-player-big-play-hover-bg
Hover background of the button, on devices that can hover.Default: control background
--ed-video-player-big-play-color
Color of the play icon.Default: control color
--ed-video-player-big-play-border
Border shorthand of the button.Default: 0
--ed-video-player-big-play-radius
Corner radius of the button.Default: 50%

Loading indicator

--ed-video-player-spinner-size
Diameter of the ring; the disc around it is 1rem wider. Keep it at or below the smallest picture height, which caps the disc and the ring.Default: 3rem
--ed-video-player-spinner-width
Thickness of the ring.Default: 4px
--ed-video-player-spinner-color
The turning part of the ring.Default: control color
--ed-video-player-spinner-track-color
The rest of the ring.Default: control color at 25%

Background mode

--ed-video-player-background-min-height
Minimum height of the frame. Taller content grows it.Default: min(70svh, 40rem)
--ed-video-player-background-position
Which part of the picture stays when the frame crops it, as object-position, such as top or 50% 20%.Default: center
--ed-video-player-overlay
Tint over the picture, under the slot content: a color or a gradient.Default: transparent
--ed-video-player-content-padding
Padding of the Content slot.Default: var(--section-space-m, 4rem) var(--gutter, 1.5rem)
--ed-video-player-content-color
Text color of the Content slot. It recolors inherited text only, so a heading with a theme color of its own keeps that color.Default: inherit
--ed-video-player-toggle-size
Width and height of the Background button. Keep it at 24px or more.Default: 44px
--ed-video-player-toggle-bg
Background of the Background button.Default: control background at 80%
--ed-video-player-toggle-hover-bg
Hover background of the button, on devices that can hover.Default: control background
--ed-video-player-toggle-color
Color of the icon.Default: control color
--ed-video-player-toggle-radius
Corner radius of the button.Default: 50%
--ed-video-player-toggle-offset
Distance of the button from its corner of the frame.Default: var(--space-s, 1rem)

Consent panel

--ed-video-player-consent-bg
Background of the panel over the poster. Keep the text at 4.5:1 over your poster: a lighter panel lets more of it through.Default: control background at 88%
--ed-video-player-consent-color
Text of the message and the checkbox label, and the default color of the link.Default: control color
--ed-video-player-consent-text-size
Text size in the panel.Default: var(--text-s, 0.875rem)
--ed-video-player-consent-link-color
Color of the privacy link.Default: consent color
--ed-video-player-consent-padding
Padding of the panel.Default: var(--space-s, 1rem)
--ed-video-player-consent-max-width
Maximum width of the panel. On narrower players it takes the whole frame.Default: 46ch
Good to know

Before you publish a video

Things that are easy to miss when a video goes onto a real site.

  • YouTube doesn’t play in the Etch builder. The builder canvas sends no Referer, and YouTube answers with its Error 153 screen. So the builder shows the poster, or the video’s own thumbnail, with a hint. The published page plays the video as usual. Vimeo plays in the builder too.
  • Reload the builder after the paste. After a component with a new definition was pasted and saved, later edits saved in the same builder session were gone after a reload. It is Etch behavior: a plain paragraph is lost too. Reload once before you paste another component or keep editing.
  • Keep Video Player and Lite at the same version. Both use the same styles of .ed-video-player, matched by selector, and Etch keeps a style it already has when you paste. A second paste at another version would run on the older CSS.
  • Every page that uses it carries its scripts. Etch adds a component’s scripts to each page with an instance, whatever that page plays. Load Media defers the video, not the JavaScript: about 260 KB gzipped for Video Player, about 70 KB for Lite. A Content Security Policy must allow the inline scripts Etch delivers.
  • Privacy Consent is a mechanism, not legal advice. You decide whether you need consent, what the message says and which banner category a video belongs to. It holds back only this component’s requests, shows no site-wide banner, keeps no log of consents and can’t remove cookies the service has already set.
  • A background video is decoration. It has no sound, no captions and no name for screen readers, so it must not carry information the page doesn’t give elsewhere. Give it a poster, keep slot text at 4.5:1 over the lightest frame of the video, and don’t hide its pause button.
  • Some built-in text is English only. Media Chrome’s control names and tooltips, the status messages and the load and retry buttons have no translation in this version. Video Title, the two button labels, the consent texts and the caption labels are props, so write those in your site language.
  • Without JavaScript, files still get a link. A video file or HLS stream shows its poster above a link to the source. A YouTube or Vimeo source shows only an empty frame. Background mode keeps its poster and the slot content.
  • Not tested yet: NVDA, VoiceOver on iOS and real devices. NVDA was used only to check the control order around picture in picture. Physical phones and tablets, real 400 % zoom and the real cookie banner plugins are untested too. It ran in Chromium, Firefox, Edge and Safari 27, in the iPhone and iPad Simulator, with TalkBack on an Android emulator and with VoiceOver on a Mac.
License

Free to use. Not for resale.

Licensed under FSL-1.1-MIT, the Functional Source License with an MIT future license. Each version becomes MIT-licensed two years after its release.

You can
  • Use it on unlimited personal, client and commercial websites
  • Modify and adapt it however you like
  • Use it in paid design and development work for your clients
You can’t
  • Sell it, or a modified version, as a component: in a library, bundle, template kit, plugin or marketplace listing
  • Offer it in another commercial product or service that competes with it

Keep the copyright and license notices in the code, and link to this page instead of re-hosting the download, so everyone gets fixes and updates. Read the full license

Third-party code

This component bundles the open-source libraries below. They keep their own licenses, and FSL-1.1-MIT does not apply to them. Each script carries the full notices of what it bundles; keep them when you use or change the component. The code is unchanged except for one fix in hls-video-element, which removes a listener when its hls.js instance is destroyed. Lite leaves out hls.js, hls-video-element, custom-media-element and media-tracks. The YouTube IFrame API is not bundled: YouTube serves it when a YouTube player loads.

Updates

How to update

Etch has no update button for pasted components. Pasting a newer version over an installed one changes nothing: Etch keeps the component and the CSS it already has. To update, reinstall in five steps. If your site has both ED Video Player and Lite, update them together.

  1. Note what you setWrite down the settings of each player, including its source, poster, Captions rows and Privacy Consent fields, and copy any CSS you changed in the component’s own styles.
  2. Delete the componentsIn Etch, delete ED Video Player and ED Video Player Lite, whichever you have, from your components. Every player disappears from every page that used it.
  3. Delete their stylesIn the Style Manager, search for ed-video-player and delete the 20 styles listed below. Both versions share them.
  4. Paste the new versionCopy or download the new JSON from this page, paste it on the canvas, click Save and reload the builder. If you use Lite, do the same with the Lite JSON.
  5. Put your players backInsert a player wherever one was, re-enter its settings and save. Reload any other open builder tab.

Styles to delete in step 3

  • .ed-video-player
  • .ed-video-player__controller
  • .ed-video-player__source
  • .ed-video-player__track
  • .ed-video-player__captions-menu
  • .ed-video-player__controls
  • .ed-video-player__timeline
  • .ed-video-player__seek
  • .ed-video-player__bar
  • .ed-video-player__play
  • .ed-video-player__time
  • .ed-video-player__mute
  • .ed-video-player__volume
  • .ed-video-player__captions
  • .ed-video-player__rate
  • .ed-video-player__pip
  • .ed-video-player__fullscreen
  • .ed-video-player__content
  • .ed-video-player__status
  • .ed-video-player__fallback

Trade-offs

  • Placements are not kept. Etch doesn’t link old players to the new component, so you insert each one again and re-enter its settings.
  • Edits inside the component’s CSS are replaced. Keep overrides on a parent class with the --ed-video-player-* variables; those survive an update.
  • Skipping a step leaves a mix. Without step 2, Etch keeps the old component. Without step 3, the new version runs on the old CSS.

Nothing to update yet. 1.0.0-beta.1 is the first public version. Subscribe and you’ll get one email when the next one is out.

Changelog

What changed

Versions follow semantic versioning. When an update changes how existing options behave, its entry says so.

1.0.0-beta.1Latest
  • ReleasedFirst public version, as ED Video Player and ED Video Player Lite. It stays a beta until NVDA, VoiceOver on iOS, physical phones and tablets, real 400 % zoom and real cookie banner plugins are checked.
Feedback

Tell me what this component needs

A bug, a missing option, or anything that made the component awkward to use in a real build — it all belongs here. The versions above are the ones it was tested on; if yours differ, say so.