Introducing the oEmbed Providers Module

In Drupal 8.6, support for oEmbed was added to core’s Media module. This addition represented a big step forward for the Media Initiative; however, key functionality gaps have remained as unresolved core issue.

Stepping into the void is the new oEmbed Providers module, which provides several of these features:

Add Custom Providers

Core Media provides no option for adding custom providers.

The oEmbed Providers module provides a user interface for site builders to define custom oEmbed providers:

Custom oEmbed Providers provider edit page
 

Custom oEmbed Providers listing page

These provider definitions are stored in configuration (and are thus exportable).

Customize oEmbed Providers URL

By default, Media fetches a list of oEmbed providers from https://oembed.com/providers.json. This is problematic as some jurisdictions (e.g. Russia) block access to this URL. Media already stores this URL in configuration.

The oEmbed Providers module exposes the URL in its admin user interface:

Config page screenshot showing providers URL feature

Disable External Fetch of Providers

Media attempts to fetch providers from the aforementioned oEmbed Providers URL. In some instances, this is not necessary. For example, if a site only uses custom providers, then there is no need to fetch the providers list from an external source.

The oEmbed Providers module allows for this external fetch to be disabled:

Config page screenshot showing disable feature

Enable and Disable Providers

By default, YouTube and Vimeo are the only two oEmbed providers enabled by Media. While it is possible to enable and disable providers programmatically, there is no user interface for doing so.

The oEmbed Providers module provides a user interface for enabling and disabling providers:

Screenshot of Allowed Providers screen

Core Issues

Below are the core issues addressed by the oEmbed Providers module:

Add new comment