jQuery media plugin - AutoStart not running when using the JWPlayer

jQuery media plugin - AutoStart not running when using the JWPlayer

Hi Malsup,

I needed to get the player to auto run. I flipped the "autoplay" flag (in the defaults)  and it worked for all except the flash player. I am using the JWPlayer (as you recommended).

I am not sure if this is specific to the JWPlayer, but I needed to append the "&autostart=true" to the "opts.src" in the generate() function to get it to "autorun".

Here is the code... you might want to consider pulling it in your plugin.

Again... thanks for the great plug-in!



function generate(el, opts, player) {
var $el = $(el);
var o = $.fn.media.defaults.players[player];
// Get autoplay going for the JW player by appending autotart to the media URL
if ((player=='flash') && (opts.autoplay='1')) opts.src = opts.src + '&autostart=true';