Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
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

 

in how_to by (200 points)
  

1 Answer

0 votes
 
Best answer

Update: This can now be controlled with no coding via in5 > Interactive Widgets > Video.


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;
    });
});

by (197k points)
edited by