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.
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!
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.
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
No Javascript I've tried since the update will work, and working Javascript - the "mute all" others have referenced - is also no longer working. This is unfortunate. Yes, I could achieve the same thing using triggers, but A) I don't want the user to have to press a button on all 267 slides to hear or not hear audio, and B) With a large course it is too clunky to try and add that many triggers.
If there is an existing feature request for Mute all, I'd like to be added to it.
Travis (or anyone) can you provide an example of Javascript that works for you in the latest build. I can't get anything to work but I'm new to Java so maybe I'm doing something wrong.
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 to appState. If there's no DS, it assumes it's running in an older version of Storyline, and uses the require 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 calling onToggleVolume in the first place. :-)
I wanted to update this discussion related to an issue reported where using jQuery selectors / jQuery's $.ajax() function in JavaScript trigger no longer works.
We're always on the lookout for new security concerns and ways to counteract them. Since jQuery has the potential to be exploited and Storyline no longer uses it, we removed jQuery from Storyline 360 and Storyline 3. If you're comfortable, you can still reference the jQuery library directly to write custom JavaScript. Here's how:
21 Replies
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.
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
The player changed in the latest update I have found a lot of code no longer works jQuery or not
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?
player has changed, the code I used to hide the lightbox close button no longer works
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.
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!
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.
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
No Javascript I've tried since the update will work, and working Javascript - the "mute all" others have referenced - is also no longer working. This is unfortunate. Yes, I could achieve the same thing using triggers, but A) I don't want the user to have to press a button on all 267 slides to hear or not hear audio, and B) With a large course it is too clunky to try and add that many triggers.
If there is an existing feature request for Mute all, I'd like to be added to it.
I use extensive js in my publishes - no problems. I use a custom player, maybe this will help?
Travis (or anyone) can you provide an example of Javascript that works for you in the latest build. I can't get anything to work but I'm new to Java so maybe I'm doing something wrong.
let btnNext = document.querySelector(".slide-control-button-next");
if (!btnNext.hasAttribute("onmouseup")) {
btnNext.setAttribute("onmouseup", "window.parent.ChildNav('Next');");
}
let btnPrev = document.querySelector(".slide-control-button-previous");
if (!btnPrev.hasAttribute("onmouseup")) {
btnPrev.setAttribute("onmouseup", "window.parent.ChildNav('Previous');");
}
let topicLinks = [...document.querySelectorAll(".item-collapsible li:nth-child(1) .cs-listitem")];
let slideLinks = document.querySelectorAll(".cs-listitem");
if (!slideLinks[0].hasAttribute("onmouseup")) {
let slideCount = 0;
let titlesArr = [];
[...slideLinks].forEach(slideLink => {
if (topicLinks.indexOf(slideLink) === -1) {
titlesArr.push(slideLink.getAttribute("title"));
slideLink.setAttribute("onmouseup", "window.parent.ChildNav(" + slideCount + ");");
slideCount++;
} else if (slideCount !== 0) {
slideLink.setAttribute("onmouseup", "window.parent.ChildNav(" + (slideCount + 1) + ");");
} else {
slideLink.setAttribute("onmouseup", "window.parent.ChildNav(" + slideCount + ");");
}
});
window.parent.SetTitlesArr(titlesArr);
window.parent.SetSlideCount(slideCount);
window.parent.CreateInstructWindow();
}
The above .js is a simple call to execute a notes page for my Instructors; try it. You'll need to add the base files to the zip, of course.
Kristin, you likely have a javascript error, it could be that you are using jQuery (do you have $).
Have you checked the developer console? One error will break them all.
Hi there, folks!
We created an article that explains how to make jQuery work in JavaScript triggers after its removal in Storyline 360 on January 21, 2020.
You can learn about the three ways to reference the jQuery library directly right here!
Thx Katie, but that does not seem to solve the JavaScript ToggleVolume code situation, right? Or is there something equivalent in JQuery?
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:
https://community.articulate.com/discussions/articulate-storyline/javascript-for-audio-mute-unmute-that-previously-worked-is-no-longer-working
@Jimmi, works like a charm (so far) and does not require JQuery :) THX !!
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. :-)I wanted to update this discussion related to an issue reported where using jQuery selectors / jQuery's $.ajax() function in JavaScript trigger no longer works.
We're always on the lookout for new security concerns and ways to counteract them. Since jQuery has the potential to be exploited and Storyline no longer uses it, we removed jQuery from Storyline 360 and Storyline 3. If you're comfortable, you can still reference the jQuery library directly to write custom JavaScript. Here's how:
https://articulate.com/support/article/Storyline-How-to-Reference-the-jQuery-Library
However, keep in mind that some JavaScript triggers, like the one you mentioned, that worked before might not work in newer versions of Storyline.