|
1234567891011121314151617181920212223242526272829303132 |
-
- context = new (window.AudioContext || window.webkitAudioContext)();
-
- window.requestAnimFrame = (function(){
- return window.requestAnimationFrame ||
- window.webkitRequestAnimationFrame ||
- window.mozRequestAnimationFrame ||
- window.oRequestAnimationFrame ||
- window.msRequestAnimationFrame ||
- function( callback ){
- window.setTimeout(callback, 1000 / 60);
- };
- })();
-
-
- var sample = new AudioTagSample({orientation:'horizontal',axisScale:'lin'});
- var links = document.querySelectorAll('.audio');
- for (i=0;i<links.length;i++){
- links[i].addEventListener("click", function(ev) {
- ev.preventDefault();
- context.resume();
- sample.click(ev.target);
- });
- }
-
- function play_pause(el) {
- if (sample.audio.paused) {
- sample.click(sample.link);
- } else {
- sample.click(sample.link);
- }
- }
|