gibney.org
:
Technology
:
Javascript
:
Tools
:
Player
(Entry Nr. 486, by user 1 |
edit
)
Put URLs here:<br> <textarea id=player_urls style="width: 100%; height: 20em"></textarea> <a id=playbutton href=#>Play</a> <script language="JavaScript" src="http://raw.gibney.org/jquery.min.js"></script> <script> player=new function() { this.status='Stop'; var me=this; $("#playbutton").unbind("click").click( function() {me.play()} ); }; player.showNextUrl=function() { url=this.urls[this.nextUrl]; if (!url.match(/^http/)) url="http://"+url; url=url.split(" ")[0]; window.open(url,'window name','attribute1,attribute2'); this.nextUrl++; if (this.nextUrl<(this.urls.length-1)) { if (this.status=="Play") { var me=this; setTimeout(function(){me.showNextUrl()},2000); } } else { this.stop(); alert ("done"); } } player.play=function() { this.urls=document.getElementById("player_urls").value.split("\n"); this.nextUrl=0; $("#playbutton").text("Stop"); var me=this; $("#playbutton").unbind("click").click( function() {me.stop()} ); this.status="Play"; this.showNextUrl(); } player.stop=function() { $("#playbutton").text("Play"); var me=this; $("#playbutton").unbind("click").click( function() {me.play()} ); this.status="Stop"; } </script>
Create a new entry at this position