Forum Discussion

BrettAmstutz's avatar
BrettAmstutz
Community Member
6 days ago

Have Closed Captions generate as a variable

I am working on a project, where I have a character who is talking to the user and going into scenarios. Rather than create caption shapes and then typing all of the speaking points out and matching it to the audio on the slide, I was hoping to have/create a variable where the created closed captions could be shown in a text field or wherever else I want on the page rather than the standard top or bottom of the page. This way I could modify the way they look, where they are located, and reduce the time it takes to create conversation scenarios by not having duplicate work. 

6 Replies

  • Nedim's avatar
    Nedim
    Community Member

    As Phil mentioned, the recommended approach is to create your own custom text variable in Storyline and then extract the captions directly from the caption container in real time as they appear.

    At the moment, there isn’t a built-in Storyline variable that exposes caption text (as far as I know). However, you can ensure captions are enabled either through the player settings or by using a trigger such as “Set Player.DisplayCaptions to True” when the timeline starts.

    From there, the remaining part can be handled with JavaScript. By observing the caption container in the DOM, you can capture the caption text whenever it appears or changes and pass it into a Storyline variable.

    Here’s an example:

  • BrettAmstutz's avatar
    BrettAmstutz
    Community Member

    I'll be honest, I don't know how I would do that. Any suggestions on where to start? 

  • But you would also have to create the mechanism to update it.