I add a frame ID using an each function’s index, and then appending the src with the string you need:
jQuery('#video-gallery-list li.video-player').each(function(i) {
// set up a variable for the src that includes the new unique ID you're about to use
var this_src = jQuery(this).find('iframe').attr('src') + '?api=1&player_id=player_'+i;
jQuery(this).find('iframe').attr('ID', 'player_'+i).attr('src',this_src);
});