Mura Plugin for Embedding Videos from YouTube (and others)

ColdFusion , CFML , Mura CMS Add comments

I was working on a web site which uses Mura CMS. I needed to publish some videos on the site and instead of using my bandwidth, I decided to stream them from YouTube. I didn't see any way to do this with Mura out of the box, so I decided to code up a little plugin which I think others might find useful. This plugin enables you to embed videos from YouTube, Yahoo, Vimeo, or MetaCafe using a simple tag syntax which you can place right into Mura's WYSIWYG content editor. For example, if you put this into your content editor:

[EmbedVideo from:YouTube videoid:HZi_ZUL7CAg]

You get this on your page (on the front-end):

(Of course, since this blog is running on Mango and not Mura, I actually used Seb Duggan's YouTube plugin for Mango to embed that video on this page, but you get the idea). There are also additional attributes to control the height and width of the video and you can set global defaults in the plugin configuration page. And as I stated earlier, you can also embed videos from Yahoo, Vimeo, and Metacafe as well. After installing this plugin, go to the Embed Video Plugin main page in the Mura admin for detailed documentation (click on "Plugins" in the left-hand menu of the Mura Admin and then click right on the plugin's name on the list that comes up). Let me know if you have any questions -- after reading the docs, of course ;-)

Download the Embed Video Plugin for Mura CMS

11 responses to “Mura Plugin for Embedding Videos from YouTube (and others)”

  1. Nathan Miller Says:
    I have a railo vps with viviotech as well, and am having a general plugin issue. I can install plugins and assign them to sites, but when I go to the plugin page at the site level (i.e. domain.com/plugins/2/, it's just a blank page. Am I missing a mapping somewhere (I come from a Windows background!!)
  2. Tony Garcia Says:
    @Nathan,
    So this is happening with all plugins that you try to install?
  3. Nathan Miller Says:
    Yes, all plugins
  4. Tony Garcia Says:
    Hmmm...then we can rule out something being wrong with the video plugin. I can definitely tell you that there aren't any special mappings required other than the ones that are automatically set up by Mura (if you're on a CF engine that has per-application mappings).
    Are you trying to go to /plugins/2/ from the front end? Because those directories should only be accessible from the Mura admin (by clicking on the "Plugins" menu item and then clicking on the plugin name).
    Also, from that URL it looks like you're using an older version of Mura. The current versions name the plugin directories with the package name and the id and not just the id. (so it would be /plugins/EmbedVideo_2/ instead of /plugins/2/)
  5. Ronnie Duke Says:
    Just curious if there were any advantages to using this over just pasting the YouTube <embed> code right into the source of the FCK editor on a page?
  6. Tony Garcia Says:
    Hi Ronnie,
    It just so happens that someone asked me that very same question over email. So I'll just post my response to him here:

    That's a fair question. For you and I, and most technically-inclined folk, the usefulness of this plugin is arguably questionable. I was really aiming this plugin for the less tech-savy user who would want to embed a video in their page. Most video-embedding code involves a lot of <object>, <embed>, and <param> tags. If someone directly copy-and-pastes this code into their content editor in Mura, FCKEditor will convert all of those angle brackets to &lt; and &gt; so it won't work. Of course you and I know that you need to click on the "source view" button first before you paste in the embed code and then click on it again to switch back. But this won't be obvious to your average Joe Blow. In fact, I've had several clients who wouldn't even know how to access the embed code for a video and what to do with it (some people are still that internet-illiterate). With this plugin, people can just look at the URL for a video they want to embed and use that to embed their video (and not have to worry about being in source view or not). It's really just for ease of use and convenience. There's a similar plugin for Mango blog for YouTube videos and Joomla CMS also has plugins like this.
  7. Ronnie Duke Says:
    Hey Tony,

    That makes total sense... I was thinking along those same lines, but I wasn't sure if there was a technical advantage for one way over the other.

    One other thing: you know how YouTube gives you the option now to create the <embed> code that does not include the "related videos" at the end? Could this plugin be modified to work the same way?
  8. Ronnie Duke Says:
    Ah, nevermind... just answered my own question. If I add "&rel=0" to the string in the EmbedVideo.cfc file for YouTube, that disables the "related videos".

    It might be nice to create an option on the plugin settings to turn that feature on and off via the admin.
  9. Tony Garcia Says:
    Nope -- no real technical advantage. Purely convenience.
    All the plugin does is intercepts the content at the 'onSiteRequestStart' event, parses out the [EmbedVideo] tags and does substring replacements with the appropriate embedding code before it's displayed.
    I didn't know that there was the option to not include the 'related video' display at the end. That could definitely be worked into the plugin as an optional tag attribute. I'll look into it.
  10. Tony Garcia Says:
    @Ronnie (and everyone else),
    I updated the EmbedVideo plugin. There is now a global plugin setting to indicate whether to display those related videos at the end of YouTube videos. This setting can be overriden at the tag level with the "rel" attribute (see the documentation within the plugin). Also, the tag now works within components and other display objects.
    You can download the new version using the link at the bottom of this post.
  11. Ronnie Says:
    @Tony; Great work! Thanks a bunch...clients are liking this method MUCH better!

    Oh, congrats on the throwdown!

Leave a Reply

Leave this field empty:

Powered by Mango Blog. Design and Icons by N.Design Studio