Skip to main content
Known Participant
September 29, 2020
Question

window.cpAPIInterface.navigateToTime(): error in Safari

  • September 29, 2020
  • 1 reply
  • 656 views

Hi all,


I use the window.cpAPIInterface.navigateToTime(ms) method to let the user navigate to a certain time in a HTML5 module:

  • the time is added to the url of the module as a parameter
  • it is converted into milliseconds
  • the time in milliseconds is used in the method: when a user plays the movie, it starts at the time from the parameter.

 

This works fine in Firefox and Chrome, (no errors at all), but Safari throws an error in the console:

Unhandled Promise Rejection: AbortError: The operation was aborted.
(anonymous function)
rejectPromise

It refers to line 11106 of CPM.js but it's a bit above and beyond my skills to understand and solve this.

Questions:

  • Is this a known bug?
  • If so, is it a Captivate bug or a Safari bug?
  • If not... Does anyone have any idea what's going wrong here?

I can add my code if necessary...

    This topic has been closed for replies.

    1 reply

    Known Participant
    September 29, 2020

    Since I can't edit the original message, some more information...

    • I get the error above
    • And instead of starting at the designated time, the module starts at the start of the slide that time is part of. So if I have a slide from 3:00 to 3:59 and I pass the time 3:35, the module will start at 3:00. In Chrome and Firefox it will start at 3:35, as intended. 
    TLCMediaDesign
    Inspiring
    September 29, 2020

    Do they have to click the play overlay at the start or does it just try to jump to the time?

    Known Participant
    September 29, 2020

    Thank's for the reply

     

    To answer your question: they have to click the overlay (which doesn't bother me). Basically, I use an external script which is loaded on the first slide, and then takes the user to the desired position.

     

    But I was already able to narrow the problem down:
    1. The error above is unrelated

     

    2. However, the problem also appears if I don't use my script:

    • Create a button in Captivate on the first slide
    • Create an advanced action on the button, and Execute the JavaScript cpAPIInterface.navigateToTime(16000)
    • Firefox will navigate to the correct position (2:40 in this case)
    • Safari will navigate to 2:40 for the visual representation, but will start playing the associated sound file for that slide from the start. The visual representation will hang until the sound file reaches the right spot (so 2:40) and will then run along nicely.
    • Safari's behaviour can be 'corrected' by going back to the first slide and hitting the button again. Then the module will go to 2:40 for both the visual representation and the sound.

    It seems that Safari needs the sound file of a slide to be loaded before it can jump to a certain part of that file. Can I somehow check whether the sound file is loaded? Or any other ideas?