Embedding Youtube videos in Bludit

Author Christian Reading time ~1 minute

Photo by freestocks.org: https://www.pexels.com/photo/person-holding-space-gray-iphone-5-34407/

  1. Make sure your Content-Security-Policy header allows it. This should be enough to see the thumbnail and play the video:
    • In your CSP configuration: frame-src youtube.com www.youtube.com
    • If you want CSS, etc. you may need to configure additional headers
    • If you omit this step and you DO have a CSP in place, your browser will just show a "This content has been blocked by a policy"-message or similar. Open your browsers developer console to check for CSP related errors.
  2. In Bludit, go to: Plugins -> TinyMCE -> Settings
  3. Add media to the "Toolbar top" and "Plugins" fields. Now the button for easier embedding of videos will show up.
    • Of course you can also copy&paste the iFrame-code from the Youtube-Share link and use the source code view (<> Button) to insert it manually.
  4. Profit!