Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Prevent clicks from restarting SMIL audio playback?

I am getting ready to publish my second series of children's books. In the first one, I only had audio, so it was OK if the person was tapping on the text to cause the audio playback to restart. However, in this series, I have some links within the text that the user can click (using custom Javascript in the EPUB file) to open a dialog box for more information.


The problem is that anytime the reader taps a link for more information, it starts the audio playback from the beginning of the SMIL element (I have everything lumped into a whole div for playback).


When I debug iBooks with the WebKit inspector, I can see that there is a readAlong object from iBooks being called that installs and removes clickHandlers for the div containing the text. Is there any way to suppress those click handlers?

Posted on Nov 27, 2018 2:16 PM

Reply

Similar questions

3 replies

Nov 27, 2018 11:52 PM in response to RCAustin

I tried this and couldn't get it to work. I wasn't sure if somehow the click handler for the div under the text button was getting queued up before it recognized the change in data-ibooks-audio-reset-on-play, but it didn't seem to work. I didn't want to permanently set it to false because I would like playback to restart if they are clicking on the text and not the text button.


I was already using jquery in my javascript to do the changing of the text in the modal box that pops up to display additional information. So, by changing from a standard HTML5 click handler to using jquery click handlers and returning false in the click handler for the text button, it prevents the div that is behind it from having its click handler executed. It now seems to be working fine.


var modal = document.getElementById("modalWindow");

$('#infoLink').click(function (event){

// A bunch of code here to fill in the div's with information based on which infoLink was clicked


modal.style.display = "block";

return false;

});


// When the user clicks on modal close button (x), close the modal

$('#close-button').click(function (event){

modal.style.display = "none";

});

Prevent clicks from restarting SMIL audio playback?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.