Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
Is there a way for your program to play music across pages?
 
I can get it to play on the page which it is load, but when we do a page turn the music stops.
in how_to by (197k points)
  

1 Answer

0 votes
 
Best answer

Update: It is now possible to control this without custom code via in5 > Interactive Widgets > Audio.


Attach the following code as a .js file in the Resources section of the in5 dialog (how to attach resources):

stopAllMedia = function (targ) {
 if(!targ) targ = document;
 $(targ).find('audio,video').each(function() {
  var media = $(this)[0], player = media.player || media;
  if($(this).parents('.page').index() == 0) return false;
  try{player.pause(); media.currentTime = 0;}catch(e){}
 });
}

This function overwrites the existing stopAllMedia function and allows media on the first page to play continuously.

by (197k points)
edited by