4 minutes reading time (707 words)

Explore the Core: How to easily embed videos in your Joomla Articles

June-Videos

Joomla has built-in functionality for embedding videos from, for example, YouTube or Vimeo or any other platform that provides embed codes. You don’t have to install anything for this; all you need is a little preparation.

In this example I’ll show you how to embed a YouTube video in a Joomla 4 article. There's two ways to do this: the super easy way, and the still pretty easy way. Both ways require a bit of preparation first.

Preparation: do this first

To allow you to embed videos in your website, YouTube uses an IFrame or “inline frame”. That is a common way to embed other content within the current HTML document. 

By default, the Joomla editor (TinyMCE) strips IFrame code. So you need to allow that first.

In your backend, head over to System -> Manage -> Plugins

System -> Manage -> Plugins

In the search field on top of the list, type “Tiny” and the search icon. Your search result should now show the TinyMCE editor plugin.

List of plugins

Click on the title to open it.

TinyMCE has three editor sets in Joomla. Set 0 is the most extensive one, used for site administrators and super users. In this example, I want this group to be able to add IFrames, so I’m going to change the settings for Set 0.

Editor profiles for TinyMCE

Scroll down to Prohibited elements. This shows a small list: script,applet,iframe.

Prohibited elements in TinyMCE

Remove “iframe” and save the settings.

Now you’re all set for embedding your first video!

Embedding your YouTube video - the Super Easy Way

In YouTube (or Vimeo or whichever platform you want to embed videos from), click the Share button below the video you want to embed.

Share button in YouTube video

A popup opens. Below the Share buttons, you'll see the url for the video and a copy button.

Click the copy button to copy the url.

Embedding the video in your Joomla article

Create a new article or open the article that is going to have the video in it.

Put your cursor in the exact spot where you want the video to appear.

In the editor toolbar, click Insert. In the dropdown, choose Media.

Insert button, dropdown to choose media

 

You now get a popup. In the top left corner, you see General is selected. Copy the url in the Source box.

In the boxes Width and Height, the dimensions of your video get pre-filled. You can adjust those if you want to.

If you click on Embed (second option on the left, below General), you'll see the embed code has been filled in for you.

The popup closes and you’ll see your video in the editor text area.

Screenshot backend embedded video

 

Embedding your YouTube video - the Still Pretty Easy Way

In YouTube (or Vimeo or whichever platform you want to embed videos from), click the Share button below the video you want to embed.

Share button in YouTube video

A popup opens. Click the embed button (it’s the first one from the left).

Embed button for YouTube

Another popup opens. It shows your video, and in the right part you’ll see the embed code plus a couple of options.

In the right hand corner at the bottom, there’s a Copy option. Click it. The embed code turns blue (bonus tip: if you’re chaos on legs, like me, now is the time to paste it into Notepad or something so you’ll still have it if you get distracted along the way).

YouTube embed code

Embedding the video in your Joomla article

Create a new article or open the article that is going to have the video in it.

Put your cursor in the exact spot where you want the video to appear.

In the editor toolbar, click Insert. In the dropdown, choose Media.

Insert button, dropdown to choose media

 

You now get a popup. In the top left corner, you see General is selected. Right below that, there’s Embed and Advanced. Choose Embed.

The insert/edit media popup with options

The popup changes and you now have a text area you can paste your embed code in. Click the Save in the bottom on the right. 

The popup closes and you’ll see your video in the editor text area.

Screenshot backend embedded video

Last step: save your article

Save your article with the Save button in the top left corner, or the Save & close button right next to it.

If you now check the site on the frontend, the video should be visible.

Screenshot fronted embedded video

That's it, you're all done!




1
Meet a Joomla User Group: Maastricht, the Netherla...
Explore the Core: Native SEO Options
 

Comments 2

Already Registered? Login Here
Brian Teeman on Tuesday, 20 June 2023 11:09
It's even easier

It's easier than that. You dont need the embed code at all - just the url https://www.youtube.com/watch?v=ul3mcXMX0gA&t=1s&ab_channel=LearnJoomla4

0
It's easier than that. You dont need the embed code at all - just the url https://www.youtube.com/watch?v=ul3mcXMX0gA&t=1s&ab_channel=LearnJoomla4
Anja de Crom on Tuesday, 20 June 2023 13:05
Thanks, I've added it

I am so happy with not having to install an extension to do things like this

0
I am so happy with not having to install an extension to do things like this :)

By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/