One of the most common questions about working with Joomla! is how to embed video in articles. The reason this is a problem is that embedding inherently creates risks because of what might be embedded.

It could contain malware of some kind, and even though it is safe today who knows what might happen in the future?  This is why, the iframe  tag which is commonly used to embed content is routinely stripped out of articles both by WYSIWYG editors and by the Joomla! input filter as a security measure. Letting just anyone insert an iframe could be a problem. So you do want to think carefully about who you allow to embed video on your site and what formats and host sites you allow.

How can you insert a video in Joomla after all? Naturally, there are a number of options. If you want to have lots of unsupervised users embedding things you probably will want to get a specialized plugin from the JED. A number of editors also have plugins for inserting videos, including miy favorite, JCE. But let's say you just want a limited amount of video and you want to limit the ability to insert it to certain groups. Most of video sharing portals use iframes for embedding. If you copy and past their embed codes into any Joomla editor, they will actually be filtered twice, first by the editor and then by the Joomla input filters, and you end up with some unusable code. 

There are two ways to approach solving this problem. First, remove these filters. I don't recommend this, unless you are the sole maintainer of the site, and you really know, what you are doing. But, fortunately there is a dead simple to use built in Joomla! iframe handler, the wrapper module.

Basically the wrapper module provides a context for loading an iframe by providing a place for pasting the URL that you find in the embed code src attribute, for example http://www.youtube.com/embed/g1T71PGd-J0. You can also take the height and width from the embed code and you can, of course, apply a module suffix and so on. Then use it in the normal way you use any module. So below I have used loadposition plugin to load a wrapper module to embed a video from Youtube

Obviously you need access to the module manager to be able to do this, but still, giving someone access to the module manager is a lot safer than letting them insert script tags in your site content.

0
0
0
s2sdefault
Category: Joomla modules