Forum Discussion

MichaelAmbech-7's avatar
MichaelAmbech-7
Community Member
5 years ago

Captions JavaScript not working anymore

Hello all!

I've been using this script

if (/_html5.html/.test(window.location.href)) {
if (!window.alteredCaptions){
var sheet = document.createElement('style');
sheet.innerHTML = ".caption{font-size:175% !important;}";
document.body.appendChild(sheet);
window.alteredCaptions = true;
}
}

when trying to make captions in Storyline compliant. It doesn't seem to work anymore. Any changes to Storyline I'm unaware of? Any (other) workarounds?

Best regards

Michael

  • If I wanted to use this, what would I need to add to force CAPTIONS to turn on for a specific slide where I was using this?

    I have Spanish "content" available all through a course, but on one slide I have a video in english where we have created Spanish captions.  I would like to:

    a) make the captions come on automatically controlled by a variable "Spanish=True"

    b) have the captions be large

     

    Thanks in advance.

    • PhilMayor's avatar
      PhilMayor
      Super Hero

      To increase size of caption you can do this by increasing the player font.

      Add a trigger to adjust variable player.captions to true if spanish is equal to true

      Sent from my iPhone

  • Hi,

    Based on the above change to the JavaSrript Michael B. suggested above for changing the font size, it seems this should work for changing the captions  location. However, I'm having no luck. I must be missing something?:

    if (!window.movedCaptions){

    var sheet = document.createElement('style');

    sheet.innerHTML = ".caption{margin-bottom: 560px;}";

    document.body.appendChild(sheet);

    window.movedCaptions = true;

    }

    I'd appreciate any help.

    Thanks!

    Karen