Wordpress YouTube playlist plugin

Wordpress YouTube playlist plugin

Thursday, October 8th, 2009 in Mootools, Wordpress

Wordpress YouTube playlist plugin WP MyTube is the Wordpress plugin implementation for YouTube MooTools player embed with attached playlist. Simply put, this plugin will allow you to easily insert YouTube videos into your Wordpress blog posts based on username or video id only. The attached playlist will display the user videos giving you the possibility to add several videos and only one player in your blog posts. This is very useful, for example, if you are a publisher that wants to display his youtube videos into a blog post.

Videos are added to your posts when you either add them or on edit. No special other settings for it except the stylesheet if you want to change the looks. To add videos to you blog posts, when you add/edit a post you’ll notice a new “add media” icon in shape of a tv. Simply click it, fill in the necessary information and the plugin will add the custom code to your pages. Hit save and that’s it.

If you want to add more than one player into a single post, well, you can do that. The plugin allows any number of players to be displayed in a single post without problems.

Further more, you can style the player to have a default look and if you want a second player to have a different look, you can add custom CSS class to it by passing the class name when you insert a new player.

Installation

Simply unzip the plugin archive, copy wp_mytube folder into your plugins directory from your Wordpress blog, activate the plugin and you’re good to go. No other special settings required.

Styling the player

Please remember that you’ll need to keep the classes from stylesheet, meaning you’re not suppose to change their names. You can style the base player in any way you want to. To style a player in a custom way, use a different css class and set the player and playlist css as descendants from that class. You can find a custom styled player at the bottom of the plugin stylesheet.

Another thing to take into account is that the Youtube video player will take the same width and height as div element having as class .MT_youtube_player

Adding videos

You can add videos to your blog posts by either specifying a valid YouTube username or by passing video ids. If you choose to pass it video ids, they must be entered separated by | (ie: someId|otherId|thirdId ). If you enter both username and video ids, only username videos will be displayed, never both. Basically, it’s either one or the other.

Except for username and video ids you can set the number of videos to be retrieved, what to display when page loads ( player or playlist ), retrieve only embeddable videos, some text messages and the custom css class if you want the player to have different styling.

Troubleshooting

If you are using prototype based scripts into your pages, there’s a high chance that either the MooTools script powering the plugin won’t work or your protoype scripts will start outputting errors and stop working. MooTools and prototype don’t belong together.
If you’re using jQuery based scripts in your pages and the plugin doesn’t work, try using jQuery.noConflict() but beware that this might lead to errors for your existing jQuery scripts that don’t support it.
If you’re using MooTools scripts and have trouble with the plugin, first of all make sure the installed scripts don’t use MooTools 1.1. The script powering the plugin is developed with MooTools 1.2.

Updates

January 15′th 2010

- possibility to add videos from YouTube playlist ( will be overridden if user is set and will override any video ids you set )

Demo

Here’s an example with videos retrieved from GoogleDevelopers.

Download plugin

Was this useful? Show your support.

digg Wordpress YouTube playlist plugin

11 comments

  1. [...] should be the first review of WP MyTube since it came out just hours ago.  This free Wordpress plugin gives you the ability to add YouTube [...]

  2. Dustin says:

    Very nice plugin. Awesome actually. Is there a way to add it to a template file using a php function rather than adding it to a post or page?

    Thanks for your help

  3. Chris says:

    Hi!

    I like this plugins but if i insert videos which have a “-” in the id they’ll not be displayed. and all following videos are also not displayed. What can i do.

    • Hi Chris,

      Thank you for pointing this issue to me. I wasn’t aware of it. Anyway, it got solved so please download the plugin again and update any codes you already have in your posts. By simply updating the plugin, things won’t work, so again, update the codes.
      The problem with hyphens in movies ids was that in order to display the individual videos, a search is performed based on the ids passed from your posts. When Youtube encountered a “-” character, it treated it as bool not and dropped whatever was after it. What I did was to wrap any ids having “-” in double quotes and with that it got solved. Try it now and let me know if you encounter any more bugs. Again, thank you for reporting this.

  4. Chris says:

    Hi Constantin!

    Thanks for your quick answer.

    But i can’t get it to work.
    - I downloaded the plugin again from this site
    - I deleted the old plugin folder completly
    - I uploaded the new one
    - I deleted the MyTube code from the page (it’s only one) and created it again with the small icon

    but nothing changed. The code is the same as before and videos with “-” and everything after it are still not displayed.

  5. Chris says:

    Hi! So first… i did a really bad hack that fits my needs, maybe you could implement it in a clean way later. I changed the url in the mootols script so that it fetches a playlist i created in youtube. So i can decide which videos should be displayed via my playlist.

    The code which is added (before i did this) was:

    [MyTube movies="bCxiC6SM5fw|dHxhbd3moMI|9MjQ1chmRFk|dj4nURf6zMw|zWAUdGA6J4s|GSZChSp8wiI|lDM8g-YWNVE|tvfXO5QFPbs|NgwYXwoPshc|U1-B9tvvyTc|1iYJA4cznOk|ncihUGjeWhc" list="30" displayOnLoad="2" onlyEmbeddable="1" loadingMessage="Loading, please wait..." togglerText="toggle playlist"]

    i got my hacked thing online at http://spacetoasters.de under “für beides”

    • :) had in mind that exact thing, just didn’t had the time to do it. It will be available though soon ( probably by the end of this week ). I can e-mail you when it’s done if you’re interested.
      Now, about the updated plugin. If, when you add a code in a post, the code displays the values enclosed in ” ( double quotes instead of ‘ – single quotes; ie: movies=”bCxiC…” instead of movies=’bCxiC…’ ), you got the old version of the plugin. Even if you downloaded it, your browser might get it from its cache so try to clear cache first and download the plugin again. If you use Firefox with webmaster toolbar, under Disable, the first option is Disable Cache. Let me know.

  6. John says:

    Hi,
    Is there any way of adding youtube tags to the playlist so I can get a more targeted list for users.
    Thanks

Leave a comment