I\'d like to start and stop HTML5 playback in a random position with fade in and fade out periods to smooth the listening experience.
What kind of mechanisms exists
This is a simple timeout function for fading the audio (from 0 to 100 in this case). It uses a global variable. Still struggling with a whole package though. I'll definitely be checking out sfjedi's jQuery way.
function FadeIn() {
var sound = document.getElementById('audiosnippet');
var vol = $.global.volume;
if ( vol < 100 )
{
sound.volume = (vol / 100);
$.global.volume = $.global.volume + 10;
setInterval(function() { FadeIn() }, 1200);
}
}
}