Ask questions and get good answers on mb.jQuery.components

I wanted to know how I can put a yt link in the menu so then one someone clicks on it, the yt link loads in the player, thanks!

asked Oct 21 '10 at 21:03

BlIIzY's gravatar image

BlIIzY
111


Hi BillzY, The mb.YTVPlayer component uses the Youtube API to manage the videos; so you can access to this using all the methods exposed on their API.

To solve your problem you need to create a function to invoke on the menu voice:

$.fn.changeMovie=function(videoURL){ 
      var player = $(this).get(0);
      player.loadVideoByUrl(videoURL, 0);
}

than you can set on the menuvoice action the function:

<a class="{action: '$(\'#playerVideoID\').changeMovie(\'http://www.youtube.com/v/PLs5HN7FS0w\')'}">txt</a>

Where "playerVideoID" is the ID of the istance of the YTPlayer.

Let me know if it works for you,

Bye, Matteo

answered Oct 22 '10 at 13:37

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

edited Oct 22 '10 at 13:39

Woah worked perfectly thank you sooo much for the help!

(Oct 22 '10 at 17:21) BlIIzY
Your answer
toggle preview

jQuery main site - Matteo Bicocchi