R

Rob W

Member

Last active 4 years ago

  1. 4 years ago
    Fri Feb 23 16:36:51 2018

    Hi Angelo,

    Yes I was/am looking for a consistent way of knowing if the read aloud is playing.

    The programming I did above was a "poor mans" way of doing it. If I test the first word(s) and have it trigger an action. i.e image switch on a button.

    Again, thanks for you help.

    - Rob W -

  2. Thu Feb 22 17:14:47 2018

    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.

  3. Sat Feb 17 23:52:48 2018
    R Rob W started the conversation Read-Aloud active/running flag/variable.

    I have been creating a epub with PubCoder, which is working great, thanks.

    I have a question about using the Read-Aloud feature.

    Is there anyway, through Javascript, to identify that the Read-Aloud feature is active/running? (a variable maybe?) when you open/load a page?

    Thanks

    Regards,
    Rob Waterman

  4. 5 years ago
    Fri Jan 13 17:28:33 2017

    Thanks Angelo,

    I had started doing that, but then thought that there might be an easier way. :)

    Love the program.

  5. Thu Jan 12 18:28:00 2017
    R Rob W started the conversation Start and Stop Animation obj using Javascript.

    Hi,

    Having fun learning PubCoder. :)

    Is there anyway through just Javascript to start or stop an animation object? I realize I could use the 'Play Animation' action, but I would like to know if there is a way to control the animations through Javascript. For example have a Javascript to randomly play and stop animations.

    Or better yet, a way to play and stop only certain sections/frames of the animation object!

    Thanks