YouTube Element

Add YouTube videos to your website.

Overview

The YouTube Element is used to embed YouTube videos into your website. This is done on the most privacy friendly and performance optimized way. The Element is using youtube-nocookies out of privacy reasons and does only preload the image, not the video itself.


Usage Examples

  • Add any YouTube videos to your website.

YouTube Element Properties

  1. YouTube Video Id: The video ID you want to embed. This is part of the URL of the YouTube video. For the URL https://www.youtube.com/watch?v=YCFbTTuKbyg, the Video Id is YCFbTTuKbyg.
  2. Auto-play: Should the video automatically start. 
  3. Play in loop: Choose if the video should be shown in a endless loop.
  4. Aspect Ratio: Select the aspect ratio of the video. (16 / 9 by default)
  5. Show Controls: Show the YouTube controls
  6. Allow Full Screen: Choose if the user should be allowed to view the video in full screen.
Everything else, like spacing, is configured with the common general properties. 

See it in action

Style / CSS Selectors


.mame-youtube {
  /* The YouTube elements */
}

JavaScript

The YouTube elements require the Mame JavaScript and use Dimitris Grammatikos fork of lite-youtube-embed for performance and privacy reasons..

Was this article helpful?