• Register
Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.

How do I play video and audio files together on page load

0 votes

I'm trying to play a short video (looped) and a seperate audio file (play once) simultaneously on page load, with the audio triggered again if the user clicks a button.

It appears to work in the preview mode, but when I export it then I can get either the video OR the audio play. If I trigger the audio to play then it pauses the video and vice versa.

I feel like I'm missing something quite obvious.

Any help would be appreciated.

Bobby

 

asked Jul 4 in how_to by bobjaygee (170 points)
    

1 Answer

0 votes

You're not missing anything obvious. :-)

in5 is set up to play only one media file at a time by default.

You can overwrite functionality that using the technique in this answer.

However you may want to modify it as follows (to include video) since you're playing both audio and video simultaneously:

$(function(){
    $('audio,video').on('loadedmetadata', function(){
        if(this.hasOwnProperty('player')) this.player.options.pauseOtherPlayers = false;
    });
});

answered Jul 5 by justin (112,560 points)
...