Forum Discussion
Javascript problem due to the update ?
Hi,
I use a javascript code to do a "mute" tricks in my articulate courses.
After the update, this option doesn't work anymore. I can't mute the sound anymore...
It's because of the update ?
Thx
- AntoninEtienneCommunity Member
So it's not an isolated problem. This is due to the update...
My solution for now is to revert to version 3.35.21017.0 of SL360.
But for the future, this is a big problem and Storyline must find a solution, I hope.
- PhilMayorSuper Hero
As Articulate never exposed this functionality to us and to be very fair have always stated that functions like this may change which is why they have not been made public as a feature, I think the onus is not on Articulate here.
- PhilMayorSuper Hero
The player changed in the latest update I have found a lot of code no longer works jQuery or not
- PhilMayorSuper Hero
player has changed, the code I used to hide the lightbox close button no longer works
- JimmiThøgersenCommunity Member
Just to explain that bit of code, it checks if there's a global
DS
variable (added in update 36). If it's there, it uses that to get toappState
. If there's noDS
, it assumes it's running in an older version of Storyline, and uses therequire
function instead (removed in update 36).As mentioned in the other thread, that
DS
variable may disappear again in update 37 - or at any time after that. By definition, it's not future proof, since it uses internal undocumented features. But that's also the case for just callingonToggleVolume
in the first place. :-) - AntoninEtienneCommunity Member
I'm not using jQuery, my question is about Javascript only, see yourself :
I just wanted to know if this "mute" code is not working because of the update. Thx
var player = GetPlayer();
var value = player.GetVar("volumeSlider");
var appState = require("helpers/appState");
appState.onToggleVolume(); Hi, everyone. Thank you for your insight!
Since we don't support editing the published output, referenced system variables and ids for JavaScript that worked in earlier versions of Storyline might not work in later ones.
Could you share more about your needs and how you used the mute code? I'll see if I can help find another way!
- AndreasNeubergCommunity Member
The JS trick (un)muted all audio/video clips irrespective from their location on the timeline and layer in one shot. Especially useful with the chromeless player skin and multiple, distributed audio tracks. There is also a case open on this, see #02133078. Probably again time, to raise a feature request for a trigger "Mute all" ;-) Thx
- JimmiThøgersenCommunity Member
Hi Andreas (and others)
The onToggleVolume issue isn't actually related to jQuery, but to other changes in how the player javascript is now compiled. This might help:
- AndreasNeubergCommunity Member
@Jimmi, works like a charm (so far) and does not require JQuery :) THX !!
var appState = window.DS ? DS.appState : require("helpers/appState");
appState.onToggleVolume(); Hi Antonin and welcome to E-Learning Heroes :)
Are you using jQuery with your JavaScript? To improve security for our customers, we removed jQuery from Storyline 360. You can still use it to write custom JavaScript. You'll just need to reference the jQuery library directly.
- AndreasNeubergCommunity Member
I have the same issue with JavaScript and onToggleVolume() on the most recent build of SL360 which is super annoying .. so, is it a feature or a bug?