Thanks Angelo
The only way I figured out to check, is by watching the CSS changes using the following Javascript:
/* ==========================================*/
// Add this Javascript script to 'Load' event of a hidden button
var triggerWord = 'word30'; // CSS class name of the trigger word to watch in the read-aloud text
var triggerObject = $("#obj3689"); // ID of object that has the script that is triggered (hidden button)
var triggerEvent = 'TouchDown'; // The event that triggers the script in 'triggerObject' (hidden button)
// The 'triggerEvent' (TouchDown) of the 'triggerObject' can be added to the same hidden button as 'Load'
/* ==========================================*/
var observeWord = document.getElementById(triggerWord);
// Generate the observers:
// ---- observer ----
var observer = new MutationObserver(function(mutations){
mutations.forEach(function(mutation){
if ($( "#"+triggerWord ).hasClass( "-epub-media-overlay-active" )){
observer.disconnect();
triggerObject.trigger(PubCoder.Events.TouchDown);
}
});
});
/* ==========================================*/
// Start observing:
observer.observe(observeWord, {attributes: true});
FYI: I don't know if this will work on all devices.
Regards, Rob W.