1
I am creating an HTML page that has an image format gif and a music display just below it.
<div><img src="imagem.gif"/></div>
<audio>
<source src="musica.mp3" type="audio/mpeg"/>
</audio>
I would like to know how I can pause the animation of the image when the user pauses the music and proceed with the animation while playing the song. Example:
audio = document.querySelector("audio");
audio.onpause = stopGifAnimation;
audio.onplay = startGifAnimation;
It is possible to do this only with pure Javascript ?
I closed as dup, really I did not remember the other question, there are some examples without third party Libs, which can be much more interesting to most.
– Guilherme Nascimento