I was wondering if anyone knows how to pause the storyline timeline using javascript. What I am doing is using a button inside of storyline to call a javascript based modal window and I need to be able to pause the main layer timeline when this is called.
Any help would be awesome and a Javascript call would really seal the deal here for me.
If you are opening the window in a WebObject, have the WebObject open in a new layer of call the slide the WebObject is in using a LightBox. In the layer configuration settings, there is a checkbox to pause the main timeline when the layer is open.
You can pause the timeline of the base timeline with a layer. Under layer properties, select the box for "pauses base layer". In this case, putting your JavaScript trigger in the layer would launch your window only after the timeline is paused. To resume, you might try putting a trigger on that layer that hides the layer when a variable changes. I use variable listeners and variables that increment all the time to "remote control" actions.
Let's say you have a variable called unpause (number variable). You add a trigger to your layer to close when this value changes. In your launched window (either in onUnload or with a button event), you use var player=window.opener.GetPlayer(); to create a connection to the player API. Then you grab the value with var unpause_value=player.GetVar("unpause");. Follow this with unpause_value++ and then player.SetVar("unpause",unpause_value);
This will increment the variable in Storyline, causing your waiting listener to fire and close the layer. When the layer closes, the timeline will resume playing.
Thank you so so much for your answers. The web object is a good option, I've been trying it out and I think it could work. Thanks Dennis!
But what I am most interested (because of what would save us the development work that we have already done) is your solution Steve. That's a great idea, "pause by layer" and then "unpause" based on variable change detaection ie using ++. At the moment Steve, I am trying to change/increment that variable - that is being listened to to close the layer inside the player from external javascript - but am having no progress trying to set it from the browser. I think I'm not seeing var player=window.opener.GetPlayer();
I will keep attempting to access this and let you know how I go. If you have any tips where I might be going wrong, I'd love to hear them.
Should be able to see it OK. Is the content you're launching at the window level or is it also in an iFrame? Might try var player=top.window.opener.GetPlayer(); to make sure it's at the top of the current window.
I have used record screen and have lots of captiion and text to explain what the is being said. When I pause it only paused the recorded screen but i want the whole time line to pause
Is there any way I could con you into perhaps making a video tutorial about adding a pause button. I've read through the instructions and looked at your posts on another thread and although I've done a few things I just can't seem to get it to work. Or do you know of a video tutorial perhaps? I'm relatively new at Articulate and I just can't grasp this. And if you can't/don't want to--that's okay too!
Thanks for your help, your idea was genius! I have been able to get it to work using standard javascript calls to get to GetPlayer() e.g document.getElementByID's and so on. I can now grab and set the variables as you wrote and I'm positive it will work perfectly as a listener.
8 Replies
Ho Brodie:
If you are opening the window in a WebObject, have the WebObject open in a new layer of call the slide the WebObject is in using a LightBox. In the layer configuration settings, there is a checkbox to pause the main timeline when the layer is open.
Best Regards,
Dennis Hall
Hi Brodie,
You can pause the timeline of the base timeline with a layer. Under layer properties, select the box for "pauses base layer". In this case, putting your JavaScript trigger in the layer would launch your window only after the timeline is paused. To resume, you might try putting a trigger on that layer that hides the layer when a variable changes. I use variable listeners and variables that increment all the time to "remote control" actions.
Let's say you have a variable called unpause (number variable). You add a trigger to your layer to close when this value changes. In your launched window (either in onUnload or with a button event), you use var player=window.opener.GetPlayer(); to create a connection to the player API. Then you grab the value with var unpause_value=player.GetVar("unpause");. Follow this with unpause_value++ and then player.SetVar("unpause",unpause_value);
This will increment the variable in Storyline, causing your waiting listener to fire and close the layer. When the layer closes, the timeline will resume playing.
Hi Dennis and Steve,
Thank you so so much for your answers. The web object is a good option, I've been trying it out and I think it could work. Thanks Dennis!
But what I am most interested (because of what would save us the development work that we have already done) is your solution Steve. That's a great idea, "pause by layer" and then "unpause" based on variable change detaection ie using ++. At the moment Steve, I am trying to change/increment that variable - that is being listened to to close the layer inside the player from external javascript - but am having no progress trying to set it from the browser. I think I'm not seeing var player=window.opener.GetPlayer();
I will keep attempting to access this and let you know how I go. If you have any tips where I might be going wrong, I'd love to hear them.
Thanks Dennis and Steve,
Regards, Brodie
Side Note:
I'm running the Storyline Presentation through Scorm 1.2 in Moodle. Maybe that's why I can't see the GetPlayer(); function
Cheers, Brodie
Should be able to see it OK. Is the content you're launching at the window level or is it also in an iFrame? Might try var player=top.window.opener.GetPlayer(); to make sure it's at the top of the current window.
I have used record screen and have lots of captiion and text to explain what the is being said. When I pause it only paused the recorded screen but i want the whole time line to pause
Hey Steve,
Is there any way I could con you into perhaps making a video tutorial about adding a pause button. I've read through the instructions and looked at your posts on another thread and although I've done a few things I just can't seem to get it to work. Or do you know of a video tutorial perhaps? I'm relatively new at Articulate and I just can't grasp this. And if you can't/don't want to--that's okay too!
Hi Steve,
Thanks for your help, your idea was genius! I have been able to get it to work using standard javascript calls to get to GetPlayer() e.g document.getElementByID's and so on. I can now grab and set the variables as you wrote and I'm positive it will work perfectly as a listener.
Can't thank you more.
Cheers,
Brodie Greig
This discussion is closed. You can start a new discussion or contact Articulate Support.