You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Load balancing servers with cluster plugin Streaming plugin extensions - Demo 5 / 10

Introduction

The cluster plugin can be set to randomly pick hosts from the cluster. This allows for simple load balancing completely controlled on the client side. This will improve performance. Click on the splash to see this in action.

Search engine friendly content

Clustering events appear here

HTML coding

Player container and the info box.

<!-- player container-->
<a
	href="flowplayer-700.flv"
	style="display:block;width:425px;height:300px;"
	id="balancer">

	<!-- splash image inside the container -->
	<img src="/img/home/flow_eye.jpg" alt="Search engine friendly content" />

</a>

<!-- info box -->
<div class="box" id="balanceInfo">
	<h2>Clustering events appear here</h2>
</div>

Flowplayer configuration

We have two different video servers. static.flowplayer.org is hosted by Simple CDN and the other server is our own server. These two are accessed randomly so that at the end both servers will get loaded evenly. The load balancing is enabled with loadBalance property.

// a global variable that references our info box
var infoBox = document.getElementById("balanceInfo");

flowplayer("balancer", "/swf/flowplayer-3.1.5.swf", {
	
	// configuration for the clustering plugin
	plugins:  {
		cluster: {
			url: 'flowplayer.cluster-3.1.1.swf',
			
			// two working hosts
			hosts: [
				'http://static.flowplayer.org/video',
				'http://flowplayer.org/video'
			],
			
			// that are load balanced (accessed randomly)
			loadBalance: true,
			
			
			// callback method that updates our info box
			onConnect: function(host, index) {
				 infoBox.innerHTML += "attempting to connect to: " + host + "<br />";
			}
		}
    },	 

    clip: {
		 
		  // our clip uses clustering plugin
        urlResolvers: 'cluster',

        onStart: function(clip) {
           infoBox.innerHTML += "started clip: " + clip.url;
        }
    }
	 
});

Take a look at a standalone version of this demo. View its source code to get things going on your page.