media-element-source-seek-1.html (796B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <script> 4 var audioElement = document.createElement("audio"); 5 audioElement.autoplay = true; 6 audioElement.src = "sound.ogg"; 7 audioElement.onplaying = 8 function() { 9 audioElement.onplaying = null; 10 setTimeout( 11 function() { 12 audioElement.onseeked = 13 function() { 14 // Note we reset 'src' to release decoder resources and cubeb 15 // streams to prevent OOM or OpenCubeb() failures. 16 audioElement.src = ""; 17 document.documentElement.removeAttribute("class"); 18 }; 19 audioElement.currentTime = 0; 20 }, 100); 21 }; 22 23 var context = new window.AudioContext(); 24 var source = context.createMediaElementSource(audioElement); 25 source.connect(context.destination); 26 </script> 27 </html>