Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 33sticks/714989df2dfbdaa85d34e8c59839ab66 to your computer and use it in GitHub Desktop.
Save 33sticks/714989df2dfbdaa85d34e8c59839ab66 to your computer and use it in GitHub Desktop.
/*YouTube Player updates required by Adobe Video Tracking module */
var n=0;
jQuery('iframe').each(function() {
var src = jQuery(this).attr('src');
if(src){
if (src.indexOf('youtube.com') > -1) {
if (src.indexOf('?') > -1) {
if (src.indexOf('enablejsapi') == -1) {
src = src + '&enablejsapi=1';
}
} else {
src = src + '?enablejsapi=1';
}
jQuery(this).attr('src',src);
jQuery(this).attr('id','player' +n);
n++
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment