Remove audio icon by slide properties.

Mar 14, 2024

I want to remove the audio from slides that don't have audio so that the user doesn't think there is audio. Some of the slides in the project do have audio. 

I see that I can customize the player features by slide, but "volume" is not an option. Any suggestions for a solution? 

2 Replies
Sam Hill

I agree that this should be an option. It's not possible to do in the player, and will require a feature request.

This would only be possible using JavaScript to target the volume button and disable it if there is no audio present on the slide.

You could place the following script on timeline start in your master slide:

window.toggleVolumeControl = function(show)
{
const $volumeContainer = document.getElementById('volume');
const $style = show ? $volumeContainer.dataset.style : 'display:none';
$volumeContainer.setAttribute('style',$style);
}
const $volumeContainer = document.getElementById('volume');
if(typeof $volumeContainer.dataset.style === "undefined")
$volumeContainer.dataset.style = $volumeContainer.getAttribute('style');
$volumeContainer.setAttribute('style', $volumeContainer.dataset.style);

And then when you want to hide the volume control, use the following script on timeline start of the target slide:

 window.toggleVolumeControl(false);

The way I've configured this, is that the volume control will always revert to showing when you navigate to a slide. This could easily be modified to default off, and then switch on when you need it. There are a few different ways to do it.