JavaScript doesn't work if I publish entire project

May 18, 2020

Hello.

I have a project with 3 scenes in StoryLine 360. Every scene has 1 slide with video on it. On this slides I execute scripts for change speed of video.

document.querySelector('video').playbackRate = 1.5;

It works correctly if I publish only one scene (no meter which one), but it doesn't work at all if I publish entire project. Even in this case script executes. I cheeked it by adding debugging code 

console.log("speed 1,5");  

But playbackRate doesn't change.

Why it's may working like this?

4 Replies
Math Notermans

On the selector part...
With only 1 video your code is fine..
When you have multiple videos over different slides... you need to use another selector...

var videos =document.querySelectorAll('video');
for (var i=0;i<videos.length;i++)
{
videos[i].playbackRate = 5;
}

Keep in mind though that DS-bootstrap on which Storyline is based has some limits on the amount of speeding up media-elements. I noticed using up to 15x works, and when trying to speed up to 25x you get a error-message from DS-bootstrap that your speed is too high ;-)