This is a message.

Client side load balancing

Use the cluster plugin to perform load balancing on the client side

standalone demo

Clustering events appear here

We use the cluster plugin for simple load balancing completely controlled on the client side. This allows us to distribute the load to multiple servers. Click on the splash to see this in action.

HTML

<!-- player container-->
<a href="Extremists.flv" class="player"
style="display:block;width:425px;height:300px;margin:10px auto"
id="balancer">
<!-- splash image inside the container -->
<img src="/media/img/home/flow_eye.jpg"
alt="Search engine friendly content" /></a>

HTML

Configuration

We have two different video servers: p.demo.flowplayer.netdna-cdn.com is hosted by HDDN and stream.flowplayer.org by Amazon. These two are accessed randomly so that in the end both servers will be loaded evenly. The load balancing is enabled with the loadBalance property.

// a global variable that references our info box
var infoBox = document.getElementById("balanceInfo");
flowplayer("balancer", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
 
// configuration for the clustering plugin
plugins: {
cluster: {
url: "flowplayer.cluster-3.2.10.swf",
 
// two working hosts
hosts: [
'http://p.demo.flowplayer.netdna-cdn.com/vod/demo.flowplayer',
'http://edge.flowplayer.org'
],
 
// 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;
}
}
 

});

JavaScript