I\'m stuck! I\'m using jquery to, on click, pull a youtube json-c feed, grab the first id, and use it to prepend the html5 iframe video to the top of the ul. I then incremen
You should be able to do something like this:
function players(func, args) {
var iframes = document.getElementsByTagName('iframe');
for (var i=0; i<iframes.length; ++i) {
if (iframes[i]) {
var src = iframes[i].getAttribute('src');
if (src) {
if (src.indexOf('youtube.com/embed') != -1) {
iframes[i].contentWindow.postMessage(JSON.stringify({'event': 'command','func': func,'args': args || []}), "*");
}
}
}
}
}
// example usage
players('stopVideo');