mike-zarandona/PrettyEmbed.js — pull request #22 by sethbrasile (2014-08-19 21:54:54+00:00)
Title: modified jquery.prettyembed.js to allow multiple instances

Added:

$(this).attr('id', thisVideoID);

Just after:

if ( $(this).attr('data-pe-videoid') !== undefined ) { thisVideoID = $(this).attr('data-pe-videoid'); }
else if ( $(this).attr('href') !== undefined ) { thisVideoID = youtube_parser( $(this).attr('href') ); }
else { thisVideoID = options.videoID; }
____
Changed:

$(this)

To:

$(e.target)

In:

$('body').on('click', '.pretty-embed', function(e) {
e.preventDefault();

clickEventRunner( $(e.target) );
});

Because it seemed like `this` was working in the wrong context.
____
Changed:

else if ( options.videoID !== undefined ) { thisVideoID = options.videoID; }

To:

else if ( obj.attr('id') !== undefined ) { thisVideoID = obj.attr('id'); }

In:

if ( obj.attr('data-pe-videoid') !== undefined ) { thisVideoID = obj.attr('data-pe-videoid'); }
else if ( options.videoID !== undefined ) { thisVideoID = options.videoID; }
else {
thisVideoID = undefined;
console.error('PrettyEmbed.js Error: Misformed or missing video ID.');
}

To set video id from 'id' attribute that was added earlier.

I **did not** check for other use cases (such as the "HTML5 Driven Application" example).