oEmbed ?
oEmbed is a protocol that allows you to easily integrate dynamic content (videos, images, tweets…) from different websites into any other website or application, by simply providing a URL.
Streamlike supports oEmbed since version 5.53
To learn more about the oEmbed protocol: https://oembed.com
oEmbed in Drupal
Since version 8.8, Drupal Core offers a media module that allows users with the appropriate permissions to upload, manage and reuse media of all types.
Among the media types offered is the « Remote Video » type, which allows you to declare the URL of a video from a streaming service, and to generate the display automatically.
This functionality is based on oEmbed. By default, the « URL » field of this media type accepts YouTube and Vimeo URLs, but Streamlike can be added as an « oEmbed provider » using a simple community module.
Declaration of Streamlike as oEmbed provider in Drupal
Step 1/3: Installing the « oEmbed Providers » module
Go to the « oEmbed Providers » module page on drupal.org: https://www.drupal.org/project/oembed_providers
This page also provides a complete description of the features and settings of the module.
Install the module in the usual way (preferably using composer):
Step 2/3: Setting up the « oEmbed Providers » module
Go to the module settings form at : /admin/config/media/oembed-providers
> « General » tab
Leave the default settings.
> « Custom Providers » tab
Add an oEmbed provider(« + Add oEmbed provider » at the top right)
Fill in the fields with the following values:
- Provider name: Streamlike
- Provider URL: https://cdn.streamlike.com
- Endpoints / Endpoint #1
- Endpoint schemes = https://cdn.streamlike.com/play?med_id=*
- Endpoint URL = https://cdn.streamlike.com/oembed
- Discovery = enable
- Available formats = check JSON and XML
Save the settings.
> « Provider Buckets » Tab
Les « providers buckets » sont des groupes de providers utilisés pour l’intégration.
Ajoutez un « provider bucket » (« + Add provider bucket » en haut à droite)
Renseignez les champs avec les valeurs suivantes :
- Bucket name = video (system name : video)
NB : this naming must be strictly respected because the media type » Remote Video » only uses this one. - Description (optional) = for example, Streamlike
- Allowed Providers = in the list of all the proposed providers, check « Streamlike » as well as all the other providers you wish to integrate.
NB: this list will replace the default services (Youtube and Vimeo). If you want to offer support for these services, you have to re-select them here.
Save the settings.
Step 3/3: Select available providers for « Remote Video »
Edit the « Remote Video » media type: /admin/structure/media/manage/remote_video
In the « Media source configuration » section, check the authorized providers in « Allowed Providers ».
The media type « Remote Video » is now ready to use Streamlike.
Entering a Streamlike « Remote Video » media type
Add a new media of type » Remote Video » : /media/add/remote_video
Below the field is a list of currently supported services, of which « Streamlike » must be included:
Paste the url of a Streamlike media and save the media.
Your Streamlike media is now available in Drupal media, and available to all related features.
How do I get the Streamlike media URL?
The Streamlike media url is of the form
https://cdn.streamlike.com/play?med_id=<id_du_media>
The media ID can be copied directly from the Streamlike console’s « Media » view by hovering over the media thumbnail and clicking on the icon at the bottom right: