|
-
- context = new (window.AudioContext || window.webkitAudioContext)();
- // shim layer with setTimeout fallback
- 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);
- }
- }
|