Forum Discussion
Automatically mute audio when playing embedded videos from external sites
- 2 months ago
Hi Kaylea,
There are two examples to demonstrate this interaction. In Example 1, the timeline automatically pauses when the video starts playing and resumes when the video is paused or stopped. Because the timeline is paused during video playback, the audio tied to it will also pause and resume accordingly. In Example 2, the audio is controlled directly based on the video's state. When the video is playing, the audio pauses, and when the video stops or is paused, the audio resumes. The timeline functionality or status is not affected.To insert your own video, open index.html found in "Example 1" folder, and replace videoId with the ID of your video. If you have changed the variable name in Storyline, make sure to update the variable name accordingly. Ensure that this variable always matches the one used in Storyline. Insert it as WebObject into Storyline.
If you choose to go with Example 2, use the index.html from the "Example 2" folder. Both index.html files are almost identical, but they reference different Storyline variables depending on whether you choose Example 1 or Example 2 for your setup.
Keep in mind that whenever you edit something in the index.html file—whether it's the video ID or a variable name—make sure to rename the folder before inserting it back into Storyline as a web object.Please find the attached zip file, which includes the following:
- Storyline project with two slides, Example 1 and Example 2
- Two folders (Example 1 and Example 2) – Each folder contains an index.html file
Once you open the Storyline file, everything will become clearer. Please don't hesitate to reach out if you need any further assistance or clarification.
I was going to recommend the solution you are already using, ie using a layer.
If the audio is timeline based, you should be able to pause the timeline though as this wouldn't affect web embedded video. They should play independently of each other.
Otherwise, it would be a JavaScript solution to loop through and pause all audio.
- KayleaMitchem-2 months agoCommunity Member
Hi SamHill
Thank you so much for your response. The timeline is audio based, but whenever I play the video from web the two play concurrently, and storyline can't see the web object to set a trigger to pause it, I think the layer option might be the only way to set the option to the pause the audio on the baseline that i've found, just wasn't sure if there might be a simpler way to do it, I have a habit of making things more complicated than they need to be sometimes.
Thanks so much for taking the time to respond!
- KayleaMitchem-2 months agoCommunity Member
SamHillBeen playing with this all afternoon - looks like YT have amended their embed codes so that autoplay isn't so straightforward any more, can't get it to autoplay when the layer opens unmuted... I can understand why but particularly frustrating in my very specific edge case, heh.
Keen to hear if anyone else has managed to get around this at all.
Am generally unfamiliar with javascript but this might be my last option, any pointers for a newbie?