(function(){function a(b,c){if(b.substring(0,4)=="http"){return b}if(c){return c+(c.substring(c.length-1)!="/"?"/":"")+b}c=location.protocol+"//"+location.host;if(b.substring(0,1)=="/"){return c+b}var d=location.pathname;d=d.substring(0,d.lastIndexOf("/"));return c+d+"/"+b}$f.addPlugin("embed",function(d){var b=this;var c=b.getConfig(true);var e={width:b.getParent().clientWidth||"100%",height:b.getParent().clientHeight||"100%",url:a(b.getFlashParams().src),index:-1,allowfullscreen:true,allowscriptaccess:"always",id:"_"+b.id()};$f.extend(e,d);e.src=e.url;e.w3c=true;delete c.playerId;delete e.url;delete e.index;this.getEmbedCode=function(h,f){f=typeof f=="number"?f:e.index;if(f>=0){c.playlist=[b.getPlaylist()[f]]}f=0;$f.each(c.playlist,function(){c.playlist[f++].url=a(this.url,this.baseUrl)});var g=flashembed.getHTML(e,{config:c});if(!h){g=g.replace(/\</g,"&lt;").replace(/\>/g,"&gt;")}return g};return b})})();


function activateplayer() {

    $f(".player", "/swf/flowplayer.commercial-3.1.5.swf", {
    key: '#$1b8133c01b2f7ea93b0',
    width:500,
    height:300,

	   
		  clip: {
		  onStart: function (clip) { 
		    //		    var w = parseInt(clip.metaData.width, 10); 
		    // var  h = parseInt(clip.metaData.height, 10); 
		   $(this.getParent()).css({width: 500, height: 320}); 
		  
		   },
 		   onBeforePause: function() { 
                	return false; 
            	   },
		  // common configuration for each clip 
		    live: true,
		    autoPlay: true, 
 //  		    scaling: 'noscale', 	
		    autoBuffering: true, 
	    // each clip uses the rtmp provider 
			    provider: 'rtmp',
        url: 'rtmp://www.movie-tv.fi/rtplive/vlc.sdp',
	title: 'Live'
			    		   



		 },


		  plugins: { 

		      controls: {
		      
			   backgroundColor: '#000', 
			   backgroundGradient: 'none',             
			   all: false, 
	
			   buttons:false,
			   volume: true,
			   mute: true,
			   scrubber: false, 
			   fullscreen: true,
					      		           sliderColor: '#333333', 
			   progressColor: '#ca000a', 
			   bufferColor: '#666666',

  		           // tooltips configuration 
			   tooltips: { 
                 
			  // enable english tooltips on all buttons 
			   buttons: true,
			   
                 
				   // customized texts for buttons 
				   play: 'Jatka', 
				   pause: 'Pys&auml;yt&auml;', 
				   fullscreen: 'Koko ruutu' 
				   }, 
             
		       // background color for all tooltips 
		       tooltipColor: '#112233', 
             	       // text color 
		       tooltipTextColor: '#8899ff',
	               playlist: false
			},
		



		    rtmp: { 
		      url: '/swf/flowplayer.rtmp-3.1.3.swf'
		      }
    		
		} 

	    });


    $f().play();

}




				        				   
