Skip to content

[6.x] Look up video providers via oEmbed - #15460

Open
edalzell wants to merge 3 commits into
statamic:6.xfrom
edalzell:feature/video-oembed-lookup
Open

edalzell wants to merge 3 commits into
statamic:6.xfrom
edalzell:feature/video-oembed-lookup

Conversation

@edalzell

@edalzell edalzell commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Stacked on #15458 and #15459. GitHub can't target a fork branch as a base, so this diff includes those PRs' commits too. Only the last commit is new here — 9e595ca (+372). Merge the other two first and this will shrink to just that.

The video fieldtype only understands YouTube and Vimeo, because those are the two providers CoreModifiers::embedUrl() knows how to rewrite by hand. This adds oEmbed lookup via mpratt/embera so Loom, Wistia, TikTok, Streamable, Rumble, Vidyard, SproutVideo, DailyMotion, Coub, Ted and Bunny work too, resolved through a new CP endpoint as you type.

On the dependency, since that was the open question. Embera can resolve a URL to an embed URL from rules built into the library rather than calling the provider's API, so YouTube, Vimeo, DailyMotion, Loom, Streamable, Rumble, Coub and Ted make zero HTTP requests — there's a test asserting that under Http::preventStrayRequests(). Only Wistia, TikTok, Vidyard and SproutVideo need a request, and those are cached for an hour. So the runtime cost for the common case is nothing; the dependency earns its keep for the long tail.

Embera's own HTTP client sets CURLOPT_SSL_VERIFYPEER => 0 and no timeout, so it isn't used — Statamic\Fieldtypes\Video\HttpClient implements Embera's HttpClientInterface over Laravel's Http client instead, with verification on and 5s connect / 10s total timeouts. Embera's oEmbed html is never rendered: the src is extracted, validated as an https URL, and the iframe is built in Vue, so no provider-supplied markup reaches the CP. Lookups are debounced, aborted on change, and discarded if they resolve after the value has moved on.

@edalzell
edalzell force-pushed the feature/video-oembed-lookup branch from 29f66c6 to e05f376 Compare September 14, 2026 23:10
@edalzell
edalzell force-pushed the feature/video-oembed-lookup branch from e05f376 to 9e595ca Compare September 14, 2026 23:16
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.

1 participant