(function(jQuery) {

    jQuery.fn._flowplayer = jQuery.fn.flowplayer;
    jQuery.fn.flowplayer = function(params, conf) {
        return this._flowplayer(
            jQuery.extend( {}, jQuery.fn.flowplayer.defaults.params, params || {}),
            jQuery.extend(true, {}, jQuery.fn.flowplayer.defaults.conf, conf || {})
            );
    };

    jQuery.fn.flowplayer.defaults = {
        params : {
            src : "/epc/js/flowplayer/flowplayer-3.2.4.swf",
            bgcolor : '#ffffff',
            wmode : 'opaque'
        },
        conf : {
            clip : {
                autoPlay : false,
                autoBuffering : false,
                scaling : "fit"
            },
            canvas : {
                backgroundGradient : 'none'
            },
            play : {
                background : '#ffffff',
                fadeSpeed : 500,
                width : 61,
                height : 61,
                label : null,
                replayLabel : null,
                backgroundGradient : 'none',
            },
            plugins : {
                controls : {
                    // position
                    bottom : 4,

                    // colors
                    volumeSliderColor : '#000000',
                    durationColor : '#ffffff',
                    progressGradient : 'none',
                    progressColor : '#491039',
                    borderRadius : '0',
                    sliderColor : '#000000',
                    bufferColor : '#77536F',
                    tooltipTextColor : '#ffffff',
                    sliderGradient : 'none',
                    tooltipColor : '#491039',
                    timeColor : '#ffffff',
                    bufferGradient : 'none',
                    backgroundGradient : 'none',
                    buttonOverColor : '#491039',
                    backgroundColor : 'transparent',
                    timeBgColor : '#000000',
                    volumeSliderGradient : 'none',
                    buttonColor : '#77536F',
                    buttonOverColor : '#491039',
                    height : 18,
                    opacity : 0.8,
                    autoHide : 'always',

                    // Buttons
                    all : false,
                    play : true,
                    fullscreen : false,
                    mute : true,
                    pause : true,
                    scrubber : true,
                    stop : true,

                    // Text
                    tooltips : {
                        buttons : true,
                        play : 'Jouer la vidéo',
                        pause : 'Pause',
                        mute : 'Couper le son',
                        unmute : 'Rétablir le son',
                        stop : 'Stop'
                    }
                }
            }
        }
    };
})(jQuery);
