I am using Jquery youtube player plugin found here: http://badsyntax.github.com/jquery-youtube-player/
The plugin allows you the specify a title for the youtube video you wish to play and the youtube video ID. Here is a snip it of the code:
var config = {
repeatPlaylist: 1,
showTime: 1,
height: 356,
toolbar: 'play,prev,next,shuffle,repeat,mute', // comma separated list of toolbar buttons
// Custom playlist
playlist: {
title: 'Random videos',
videos: [
{ id: 'youtube video id goes here', title: 'title goes here' },
]
}
};
I would like to create a button and assign the youtube id and video title. When pressed I would like those values to be used to load the youtube video using the jQuery plugin above without refreshing the page.
I have no clue how to do this. I have spent hours trying to figure it out without any luck. Any help would be greatly. appreciated
html:
js:
Also see this example.
=== UPDATE ===
Put the event handler calls into an onclick-attribute of the buttons and remove them in the javascript:
Also see the updated example.
=== UPDATE ===
Maybe this free 😉 example can help you:
html:
js:
Also see this updated jsfiddle.