Step 2: Show video player for first 10 results
Important code
var createPlayer = function(url) {
var imageUrl = url + '?preview'; // Use SiteBuilder's auto-thumbnail generator
var object = new FlashObject("http://www2.warwick.ac.uk/static_war/render/flvplayer.swf?autoStart=false&file="+ url + '&image='+imageUrl,'',"300","245");
object.addParam("wmode","transparent");
object.addVariable("width",300);
object.addVariable("height",245);
object.addParam("allowfullscreen","true");
object.addVariable("showdownload","false");
object.align = "left";
var node = Builder.node('div',{ style: 'float:left; margin:5px;' });
node.innerHTML = object.getHTML();
return node;
};
Every SiteBuilder page contains the FlashObject script 'embed.js' to make it easier to embed flash movies. The above code uses the standard SiteBuilder code added by the MEDIA tag, slightly tweaked to add a preview thumbnail automatically:
var imageUrl = url + '?preview'; // Use SiteBuilder's auto-thumbnail generator