debug.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <html>
  2. <head><title>Debug WavPlayer</title>
  3. <script>
  4. function getPlayer(pid) {
  5. var obj = document.getElementById(pid);
  6. if (obj.doPlay) return obj;
  7. for(i=0; i<obj.childNodes.length; i++) {
  8. var child = obj.childNodes[i];
  9. if (child.tagName == "EMBED") return child;
  10. }
  11. }
  12. function doPlay(fname) {
  13. var player = getPlayer('haxe');
  14. player.doPlay(fname,0.01);
  15. }
  16. function doStop() {
  17. var player = getPlayer('haxe');
  18. player.doStop();
  19. }
  20. function setVolume(v) {
  21. var player = getPlayer('haxe');
  22. log("setVolume("+player.setVolume(v)+")<br/>");
  23. }
  24. function setPan(p) {
  25. var player = getPlayer('haxe');
  26. log("setPan("+player.setPan(p)+")<br/>");
  27. }
  28. function log(str) {
  29. var log = document.getElementById('jsLog');
  30. log.innerHTML += str+"<br/>";
  31. }
  32. function Handler(event, arg1, arg2) {
  33. log("Got event ["+event+"]("+arg1+", "+arg2+")");
  34. }
  35. function init() {
  36. setTimeout(function() {
  37. var player = getPlayer('haxe');
  38. log("Init events (ver="+player.getVersion()+")");
  39. log("Event(*) = "+player.attachHandler('*', "Handler"));
  40. }, 1000);
  41. }
  42. </script>
  43. </head>
  44. <body bgcolor="#dddddd" onload="init()">
  45. <a href="javascript:doPlay()">doPlay()</a>
  46. <a href="javascript:doPlay('test.gsm')">doPlay('test.gsm')</a>
  47. <a href="javascript:doPlay('test.wav')">doPlay('test.wav')</a>
  48. <a href="javascript:doPlay('test2.wav')">doPlay('test2.wav')</a>
  49. <a href="javascript:doPlay('test.au')">doPlay('test.au')</a>
  50. <a href="javascript:doPlay('hl-78003330781-5627.au')">doPlay('hl-78003330781-5627.au')</a>
  51. <a href="javascript:doStop()">doStop()</a><br/>
  52. <input id='file' /><a href="javascript:doPlay(document.getElementById('file').value)">Play by filename</a>
  53. <br />
  54. <a href="javascript:setVolume(5.0)">Volume 500%</a>
  55. <a href="javascript:setVolume(2.0)">Volume 200%</a>
  56. <a href="javascript:setVolume(1.0)">Volume 100%</a>
  57. <a href="javascript:setVolume(0.5)">Volume 50%</a>
  58. <a href="javascript:setVolume(0.1)">Volume 10%</a>
  59. <a href="javascript:setVolume(0.0)">Volume 0% (mute)</a>
  60. <br />
  61. <a href="javascript:setPan(0.0)">Balance: center</a>
  62. <a href="javascript:setPan(-1.0)">Balance: left</a>
  63. <a href="javascript:setPan(1.0)">Balance: right</a>
  64. <div id="jsLog" style="border:1px solid red"></div>
  65. <br/>
  66. <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
  67. width="1200"
  68. height="400"
  69. id="haxe"
  70. align="middle">
  71. <param name="movie" value="wavplayer-debug.swf?gui=full&h=40&w=400&sound=test.au&3"/>
  72. <param name="allowScriptAccess" value="always" />
  73. <param name="quality" value="high" />
  74. <param name="scale" value="noscale" />
  75. <param name="salign" value="lt" />
  76. <param name="bgcolor" value="#ffffff"/>
  77. <embed src="wavplayer-debug.swf?gui=full&h=40&w=400&sound=test.au&4"
  78. bgcolor="#ffffff"
  79. width="1200"
  80. height="4000"
  81. name="haxe"
  82. quality="high"
  83. align="middle"
  84. scale="noscale"
  85. allowScriptAccess="always"
  86. type="application/x-shockwave-flash"
  87. pluginspage="http://www.macromedia.com/go/getflashplayer"
  88. />
  89. </object>
  90. </body>
  91. </html>