You can add videos to a Joomla article through the editor, an HTML player embed or an extension. Videos hosted on a video platform usually use an iframe, while a file on your own server uses the video element. This guide covers embedding, responsive dimensions and code that disappears after saving.

Choose an embedding method

First decide where the video is hosted. A link to a viewing page and a direct video file URL serve different purposes, so they cannot always be embedded in the same way.

Table: Ways to add videos in Joomla
TaskMethodWhat to consider
A video from YouTube, Vimeo or another platform The platform's embed code, inserted through the editor The owner must allow embedding and the service must be accessible to visitors
Your own MP4 or WebM file The HTML video element or the editor's media dialogue You need a direct file URL, supported codecs and sufficient server resources
Many videos with consistent settings An editor template or a compatible extension Check support for your Joomla version and test the result on a test site

A separate plugin is not required for every video. However, an iframe loads an external player and its resources even without a Joomla video plugin. Manual embedding therefore does not guarantee a fast-loading page.

Videos from YouTube and other platforms

Use the embed code supplied by the video platform. A normal viewing-page URL is intended for opening the service and may not work as the src attribute of an iframe.

  1. Open the video on a computer. On YouTube, select Share, then Embed.
  2. Copy the supplied HTML. For Vimeo and other platforms, find the equivalent embed command.
  3. Open your Joomla article and place the cursor where the video should appear.
  4. In TinyMCE, select Insert → Media… → Embed. If your toolbar does not offer this dialogue, use the HTML source view.
  5. Insert the code and save the article. Open the source again to check that the iframe remains.
  6. Check the player on the public page and start the video. A frame displayed in the editor does not confirm playback.

The TinyMCE toolbar depends on the selected tool set and user group. Another editor may use a different button name. Paste HTML into the appropriate source or embed view, otherwise visitors may see the code as text.

Why code disappears after saving

Joomla applies both editor filters and text filters for user groups. Changing just one layer may not resolve the problem.

  1. In the administrator area, open System → Plugins and find Editor - TinyMCE.
  2. Select the set assigned to the group of the user who edits the article. Do not identify the set by its number alone.
  3. Check Prohibited Elements. If the editor uses its own filters and iframe is listed, remove only iframe. A normal video player does not require script or applet to be allowed.
  4. If Joomla text filters are enabled for the editor, check the relevant group's rules in Global Configuration. Grant the required permissions only to trusted editors.
  5. Save the settings and reopen the article. Insert the code again, because a previously removed fragment is not restored automatically.

Do not disable filtering for every user group. If you do not administer the site, send its administrator the embed code and identify the account under which it disappears.

In current Joomla branches, TinyMCE also uses the sandbox attribute to restrict iframe content. If the code remains but the player does not start, check this setting and its exclusions list. Where necessary, add only a trusted domain from the src URL, such as the specific player's domain, rather than disabling the restrictions globally. Reinsert the platform's original code after changing the setting and check the saved result.

If TinyMCE still changes the iframe after you adjust its filters, open your own user profile and select CodeMirror in Basic Settings → Editor. Save the profile, reopen the article, paste the original HTML and save it. This method was tested in Joomla 6.2. Joomla text filters still apply, so check the user group’s permissions as well. Saving the article in a visual editor later may change the code again.

Responsive player dimensions

A fixed iframe width can extend beyond a phone screen. Set the width to 100% and define the aspect ratio to make the player fit its container while keeping its proportions.

<iframe
  src="https://www.youtube.com/embed/VIDEO_ID"
  title="Video title"
  width="560"
  height="315"
  style="display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0;"
  loading="lazy"
  referrerpolicy="strict-origin-when-cross-origin"
  allow="encrypted-media; picture-in-picture"
  allowfullscreen>
</iframe>

Replace VIDEO_ID with the video's identifier and provide a meaningful title. This is a markup template, not a ready-to-use player. The easiest option is to take the actual src URL from the platform's embed code. For a vertical video, use an appropriate aspect ratio, such as 9 / 16.

The loading="lazy" attribute can defer loading an iframe until it approaches the visible part of the page. It does not replace a site speed check. For pages with many videos, consider loading the player after a visitor clicks a preview image, and test your chosen solution with your template.

A video file on your own server

Use a direct file URL when the video is hosted on your server. The HTML video element provides browser playback. A YouTube viewing-page URL cannot replace an MP4 file here.

  1. Prepare the video in a format and with codecs supported by your visitors' browsers. One example is MP4 with H.264 video and AAC audio.
  2. Upload the file through Media Manager if its type and size are allowed by the site's settings. For large files, use the upload method provided by your hosting service.
  3. Obtain the direct file URL. The example below assumes that the video is already in the images/video folder.
  4. Insert the markup into the article's HTML source or enter the URL in the editor's media dialogue.
<video controls playsinline preload="metadata"
  width="1280" height="720"
  style="display: block; max-width: 100%; height: auto;">
  <source src="/images/video/demo.mp4" type="video/mp4">
  Your browser does not support embedded video.
</video>

Use your video's actual path and dimensions. The controls attribute displays playback controls, playsinline allows playback within the page, and preload="metadata" asks the browser to load metadata first. The latter is a hint, rather than a strict download limit.

Save the article and check playback, sound and seeking. Hosting a video yourself uses your hosting account's bandwidth. File size, encoding, connection speed and server configuration all affect playback.

When an extension helps

A video plugin can help when editors regularly insert videos and need consistent presentation. A shortcode or reusable fragment reduces manual work, but makes the content depend on that tool.

For example, AllVideos provides short tags for video platforms and files on your own server. The developer's page lists Joomla compatibility up to and including the 5.x branch. It does not claim Joomla 6 support, so compatibility requires a separate check before installation on Joomla 6. Old tests of other plugin versions do not establish conflicts or the performance of the current release.

If your site already uses a page builder, check its video element first. You can also configure a reusable fragment in the editor. Before choosing an extension, check supported Joomla versions, release dates, updates and compatibility with your editor. Back up the site before installation.

When a video will not play

Start with the saved code. If iframe or video has disappeared, return to the filtering settings. If the markup remains, the cause may be in the player or server.

  • YouTube error 153. Check whether your site or browser prevents the Referer header from being sent. Do not set the player's policy to no-referrer. Opening an embed URL in the address bar is not a substitute for testing it inside a page.
  • Embedding is disabled. The video owner can restrict playback on other sites. Changing Joomla HTML does not override that restriction.
  • An empty player. Check service availability, content blockers, sandbox settings and the sources permitted by the site's CSP policy.
  • Your own file will not play. Check its path, access permissions, the server's response type and supported codecs. An .mp4 extension alone does not guarantee compatibility.
  • The problem affects visitors only. Open the article while signed out and check access to the article and its files.

After changing an article, refresh the page cache if the site uses one. Compare the saved HTML with the output delivered to visitors, and change one setting at a time to identify what affects the result.

Conclusion

For a single video in Joomla, the editor and the platform's embed code are usually sufficient. Use video for a file on your own server, and choose an extension when you need convenient, repeatable insertion. Allow the required markup only for trusted editors, preserve the player's proportions and check playback on the public page after saving.