//@import "jwplayer/jwplayer.js";

function loadJWPromo(ID, stream, file, width, height,image)
{
	jwplayer(ID).setup({
	    'flashplayer': '/site/js/jwplayer/player.swf',
	    'file': file,
	    'streamer': stream,
	    'controlbar': 'none',
	    'autostart': 'true',
	    'icons': 'false',
	    'image': image,
	    'mute': 'true',
	    'stretching': 'exactfit',
	    'width': width,
	    'height': height
	});
}

function loadFlowPromo(playerElement,mediaUrl, file) 
{
    flowplayer(playerElement, "/site/js/flowplayer/flowplayer_commercial-3_2_5.swf", {
        key: '#$4e35cb368159c2b7bcf',

        clip: {
    	autoPlay : false,
    		url: file,
            provider: 'rtmp',
            autoBuffering:true,
            start: 1,
            scaling: 'fit'
        },
        
        canvas: {
            //backgroundImage: 'url(' + picture + ')'
            backgroundColor: '#000000',
            backgroundGradient: 'none'
        },

        showErrors: false,

        // streaming plugins are configured under the plugins node
        plugins: {
            controls: {
                tooltips: {
                    buttons: true,
                    play: 'Jätka',
                    pause: 'Paus',
                    fullscreen: 'Täisekraan',
                    mute: 'Vaigista',
                    unmute: 'Hääl tagasi',
                    fullscreenExit: 'Välju täisekraanist'
                },
                url: '/site/js/flowplayer/flowplayer_controls-3_2_3.swf',

                time: true,
                scrubber: true,
                autoHide: true
            },
            rtmp: {
                url:'/site/js/flowplayer/flowplayer_rtmp-3_2_3.swf',
				netConnectionUrl: mediaUrl

            }
        }
    });
}
