// Flowplayer configuration (less buttons and wicked background color) var playerConfig = { controlBarBackgroundColor: '0xf18e00', initialScale:'scale', showMenu:false, showVolumeSlider:false, showMuteVolumeButton:false, showFullScreenButton:false, controlBarGloss:'none' } window.onload = function() { for (var x = 0; x < 6; x++) { // variable that holds the player API. it is initially null var flowplayer = null; /************* THE PLAYLIST ***************/ // loop all links within DIV#playlist and customize their onClick event var targetPlaylist = "playlist" + x; var links = document.getElementById(targetPlaylist).getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { links[i].onclick = function() { /* * set links href attribute as the videoFile property in our * configuration. of cource you can modify other properties as well */ playerConfig.videoFile = this.getAttribute("href"); var playerX = this.getAttribute("target"); // if flowplayer is not loaded. load it now. if (flowplayer == null) { // create Flowplayer instance into DIV element whose id="player" // Flash API is automatically returned (flashembed.js ver. 0.27) flowplayer = flashembed(playerX , {src:"FlowPlayerLight.swf", bgcolor:'#f18e00', height:'25', width:"300"}, // supply our (modified) configuration to the player {config: playerConfig} ); // flowplayer is already loaded - now we simply call setConfig() } else { playerConfig.videoFile = ""; flowplayer.setConfig(playerConfig); flowplayer = null; playerConfig.videoFile = this.getAttribute("href"); flowplayer = flashembed(playerX , {src:"FlowPlayerLight.swf", bgcolor:'#f18e00', height:'25', width:"300"}, // supply our (modified) configuration to the player {config: playerConfig} ); } // disable link's default behaviour return false; } } // when clicks on the player it triggers our first playlist entry document.getElementById("player0").onclick = function() { links[0].onclick(); } /* If you want your video to start when your page loads then uncomment next line */ // document.getElementById("player").onclick(); } }