Step 1: Search for all video files under /newsandevents
Important code
var searchUrl = 'http://www2.warwick.ac.uk/ajax/lvsch/query.json?urlPrefix=http://www2.warwick.ac.uk'
+ pageUrl + '&indexSection=sitebuilder&q=content_type:video*';
Cross-site scripting restrictions mean you can't get JSON directly from search.warwick.ac.uk. However, SiteBuilder provides a proxy through to Search in order to use JavaScript.
Event.onDOMReady(function(){ doCustomSearch('/newsandevents'); });
The DOM needs to be loaded before any elements can be added. window.load waits for all the content to be loaded (including images for example). This Prototype extension only waits for the DOM to be loaded before execution.