Index = { Player: { DOM: {}, VAR: { Videos: { About_Jamplay:null, Guitar_Lessons:null, Recent_Updates:null, Beginner_Lessons:null, Genre_Lessons:null, Song_Lessons:null, Lifetime:null } }, autostart: false, // If autostarting, set this to true videoPlaying: 0, // If autostarting, set this to the default video to play [index value] collect: function() { this.DOM.container = $('indexPlayerContainer'); this.DOM.buttons = this.DOM.container.select('li'); this.DOM.buttonLinks = this.DOM.container.select('a'); //this.DOM.buttonText = this.DOM.container.select('b'); // Used for showing video updates (buffering,playing).. not using them. //this.DOM.quality = $('vidQuality'); this.loader(); this.setLinks(); }, loader: function() { this.Player = Shell.Video.Embed({playerType:'index', divID:'bioVid', Height:315, Width:560}); this.Player.onPlay( function(callback) {Index.Player.changeState(callback.newstate);}); this.Player.onBuffer( function(callback) {Index.Player.changeState(callback.newstate);}); this.Player.onComplete(function(callback) {var next = (Index.Player.videoPlaying === Index.Player.DOM.buttons.length-1) ? 0 : Index.Player.videoPlaying+1; Index.Player.playItem(next);}); this.Player.onReady( function(callback) {this.load([ //{"provider":"http","http.startparam":"ec_seek","file":"http://media-ecl.jamplay.com/shell/videos/" + Index.Player.VAR.Videos.About_Jamplay + "/1_onsite.mp4", "title":"About JamPlay 1"}, {"image":"http://www-ecs.jamplay.com/client/shell/images/video/buffer/jamplay-click-to-learn2.jpg", "provider":"http","http.startparam":"ec_seek","file":"http://media-ecl.jamplay.com/shell/videos/" + Index.Player.VAR.Videos.Guitar_Lessons + "/1_onsite.mp4", "title":"Guitar Lessons 2"}, {"provider":"http","http.startparam":"ec_seek","file":"http://media-ecl.jamplay.com/shell/videos/" + Index.Player.VAR.Videos.Beginner_Lessons + "/1_onsite.mp4", "title":"Phase 1 -4"}, {"provider":"http","http.startparam":"ec_seek","file":"http://media-ecl.jamplay.com/shell/videos/" + Index.Player.VAR.Videos.Genre_Lessons + "/1_onsite.mp4", "title":"Phase 2 -5"}, {"provider":"http","http.startparam":"ec_seek","file":"http://media-ecl.jamplay.com/shell/videos/" + Index.Player.VAR.Videos.Song_Lessons + "/1_onsite.mp4", "title":"Phase 3 -6"}, {"provider":"http","http.startparam":"ec_seek","file":"http://media-ecl.jamplay.com/shell/videos/" + Index.Player.VAR.Videos.Recent_Updates + "/1_onsite.mp4", "title":"Updates 3"}, {"provider":"http","http.startparam":"ec_seek","file":"http://media-ecl.jamplay.com/shell/videos/" + Index.Player.VAR.Videos.Lifetime + "/1_onsite.mp4", "title":"Lifetime"} ]); }); if (this.autostart) this.Player.playlistItem(this.videoPlaying); }, playItem: function(sceneNum) { //this.DOM.buttonText[this.videoPlaying].update(''); this.Player.playlistItem(sceneNum); this.DOM.buttons[this.videoPlaying].setOpacity(0.6); this.DOM.buttons[sceneNum].setOpacity(1.0); this.DOM.buttons[sceneNum].className = 'playing'; this.DOM.buttons[this.videoPlaying].className = ''; this.videoPlaying = sceneNum; }, changeState: function(evt) { //this.DOM.buttonText[this.videoPlaying].update(" Quality: " + evt); //return; }, setLinks: function(status) { this.DOM.buttons.each(function(s, index) { if (index !== Index.Player.videoPlaying) {s.setOpacity(0.6);} s.observe('mouseover', function() {if (index !== Index.Player.videoPlaying) {s.setOpacity(0.9); this.style.cursor = 'pointer';} else {this.style.cursor = 'default';}}); s.observe('mouseout', function() {var op = s.getOpacity(); if (op == 0.9) {s.setOpacity(0.6); this.style.cursor = '';}}); s.observe('mousedown', function() {if (index !== Index.Player.videoPlaying) {Index.Player.playItem(index);}}); }); Index.News.set(); } }, News: { DOM: {}, set: function() { this.DOM.news = $('newsItems'); this.DOM.toggles = this.DOM.news.select('li.extend'); this.DOM.adapter = this.DOM.news.select('div.show'); this.DOM.blockquote = this.DOM.news.select('blockquote.news'); this.DOM.toggles.each(function(toggle, index) { var currentBlock = Index.News.DOM.blockquote[index]; if (Index.News.DOM.adapter[index].getHeight() < 68) {currentBlock.className = 'minimal';} // if not enough content, don't need expand button else { currentBlock.className = 'expandable'; toggle.observe('mouseover', function() {this.style.cursor='pointer';}); toggle.observe('mousedown', function() { currentBlock.className = (currentBlock.className == 'expandable') ? 'expanded' : 'expandable'; }); } }); } } }; document.observe("dom:loaded", function() { Index.Player.collect(); });