topical media & game development
[] readme course(s) preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthought(s) appendix reference(s) example(s) resource(s) _

talk show tell print

portal-js-audio-player.js



  var ap_instances = new Array();
  
  function ap_stopAll(playerID) {
          for(var i = 0;i<ap_instances.length;i++) {
                  try {
                          if(ap_instances[i] != playerID) document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 1);
                          else document.getElementById("audioplayer" + ap_instances[i].toString()).SetVariable("closePlayer", 0);
                  } catch( errorObject ) {
                          // stop any errors
                  }
          }
  }
  
  function ap_registerPlayers() {
          var objectID;
          var objectTags = document.getElementsByTagName("object");
          for(var i=0;i<objectTags.length;i++) {
                  objectID = objectTags[i].id;
                  if(objectID.indexOf("audioplayer") == 0) {
                          ap_instances[i] = objectID.substring(11, objectID.length);
                  }
          }
  }
  
  var ap_clearID = setInterval( ap_registerPlayers, 100 );


(C) A. Eliëns 2/9/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.