Add your own PeerTube video source to Drupal

How to add an oembed provider as an allowed external video platform

Publication date

CMS Garden runs a self-hosted PeerTube instance to serve as a media center. We prefer to include self-hosted videos in our articles to stay independent from any third party's terms of service changes. Drupal's core media entity "External video" only allows Links to YouTube and Vimeo.

Therefore we used the oembed module to replace the core bundle to add our PeerTube to the allowed providers.

Here's a step by step tutorial.

Add a custom provider

Visit this URL on your OpenCulturas instance: /admin/config/media/oembed-providers/custom-providers/ and click button "Add oEmbed provider"

Enter:

Click Save.

Provider bucket

Visit this link /admin/config/media/oembed-providers/buckets

Edit "Remote video" and check "PeerTube" in the list.

Older OpenCulturas versions

In case you are still on version 1.2.x and need this before you can update, you need to add a provider bucket for the remote video first:

  • Bucket name: "Remote video"
  • Machine name: "video" (important! only by this you will replace the core setting for remote videos)
  • Check "PeerTube", "Vimeo", "YouTube" (the latter two for legacy reasons when you already have videos on your platform)

Allow new provider for remote videos

Visit this link /admin/structure/media/manage/remote_video

and check (at least) PeerTube under "Allowed providers".

Cookie consent management

Make sure the external video cookies service entity shows appropriate wording (default settings are unware of your new provider): /admin/config/system/cookies/cookies-service/video/edit

OpenCulturas in version 1.3.x or later uses the following neutralized wording:

  • Label: External video
  • Service placeholder texts
    • This content is blocked because external video cookies have not been accepted.
    • Only accept video cookies

That's it.

If we left any questions open or if you'd simply like to show us how you are using ist, join our next OpenCulturas Dojo.

Author

Stephan Luckow

Open-Source-Evangelist und Tenor