Attaching an audio player to the jacket


#1

What I would need to do first here is remove as much of the audio code in here as possible allowing for it to just autoplay. Then what I want to do after that is set a timer to it so it only plays for 20, 30 seconds.

Audio Javascript: CSS Removed
https://jsfiddle.net/bwa3os2v/322/

1.) Remove as much of the audio code as possible.

2.) Add a timer to it so the audio shuts off after a certain amount of time.

3.) When that’s all good, then attach it to the jacket.
https://jsfiddle.net/bwa3os2v/334/

Maybe I should add the autoplay in first, then try and start removing stuff from it so I know it’s still working.

Autoplay code:
Having trouble getting it to autoplay.
player.autoplay = true;

I’m thinking a function like this:
To set a desired time for it to stop.

function stopAudio(audio) {
    audio.currentTime = 20;
    audio.pause();
}