JWPlayer is nice but it lacks a good interface. I have been able to embed jwplayer into prettyphoto and that has solved a lot of issues for me.
There is an article that describes how to do this located at http://forums.no-margin-for-errors.com/discussion/5671/how-to-integrate-jwplayer-in-prettyphoto-with-flash-and-html5/p1
Once you get that working my suggestion would be for the url to contain GET vars that include the filename to be played. Use PHP to create an href that will trigger prettyphoto/jwplayer to open and play the file.
Also, the instructions on the link I gave you did not work for me. I had to modify them but here is the code that got it to work:
case 'jwplayer':
pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
controlbar_height = 29; //Allow for JWplayer's bar
pp_dimensions['height']+=controlbar_height;pp_dimensions['contentHeight']+=controlbar_height;pp_dimensions['containerHeight']+=controlbar_height;
jwplayer_settings = {flashplayer: '/jwplayer/player.swf', controlbar: 'bottom', skin: '/jwplayer/jwplayer_skin.zip', autostart: true, id: 'jwplayer1'};
jwplayer_settings.width = pp_dimensions['width'];
jwplayer_settings.height= pp_dimensions['height'];
jwplayer_settings.file = pp_images[set_position];
skipInjection = true;
/* include jwplayer JS embedder */
$.getScript('/jwplayer/jwplayer.js', function() {
jwplayer("pp_full_res").setup(jwplayer_settings);
_showContent();
});
break;