How to insert audio control bar

Dec 03, 2015

I have inserted an .mp3 into my project using the Insert- Audio from File tool. I need give the user the ability to drag the audio bar to rewind in case they missed something in the audio.

The feature I need would be much like a video control bar- to be able to seek to different parts of the video.

Where and how do I activate this feature in my project?

25 Replies
JC Goyette

If I may, one way to do so is to create a video with only your audio file, like we see on YouTube, Vimeo and such. That way, you can import your audio as a video and check to get the control bar.

I will say that it's a weird omittion that audio files don't have control bars. What if I want my user to listen to a 5-minute interview as part of a question? I guess that I could link the interview to an external page, but still, the lack of control options for audio is odd.

There's also the idea to make your own control bar using assets, but whether you use a Wipe Left animation or a ball that travels along a line, you cannot have animation that lasts more than 59 seconds.

Ashley Terwilliger-Pollard

Hi JC,

This discussion is quite a bit older - but I appreciate your suggestion around using a video file to play back only audio. That's an idea I've seen recommended a few times too. 

If having the audio control bar is something that would improve your experience using Articulate you can submit a feature request here. We'd love to know more about how this would make your life easier. 

Chelsea Avirett

I'm trying to include a seekbar for my audio file in a marker. This is a feature that is included in Rise 360. I'm not sure why StoryLine 360 hasn't been updated to include this but I'm finding a lot of features that I expected Storyline to have that Rise has but that don't seem possible or straightforward in Storyline. 

Leslie McKerchie

Hi Chelsea and welcome to E-Learning Heroes. 😊

I'm not sure I'm following along with what you are creating here, but I created a quick Peek 360 video with your Marker Audio options as well as adjustments and seekbar control as Anthony mentioned.

Just let us know if you have any further questions.

Stacey Singletary

Hi Leslie - 

When I try to use your link, it asks me to authenticate with my google account or go to articulate.zone for the review. I don't know if this is an internal website for articulate or if the link has been hacked.I've attached a picture of the 2 sites it takes me to.

Nedim Ramic

I don't have a tutorial. It just came to mind as I see there is quite a lot of interest in having the ability to show an audio control bar. The code below is just a draft and can be customized further. The main idea is to add the 'controls' attribute to an audio element, append it to the slide area, and position it to be visible on the slide.

const audios = document.querySelectorAll('audio');
const slideLayer = document.querySelector('.slide');

audios.forEach(audio => {
    audio.controls = true;
    audio.style.position = "fixed";
    audio.style.top = "50%";
    audio.style.left = "50%";
    audio.style.transform = "translate(-50%, -50%)";
    slideLayer.appendChild(audio);
});

We could also achieve this with the Plyr media player, dynamically added to Storyline to target the audio element and show the audio controls, which can be further customized with the CSS available in the Plyr library.

Nedim Ramic

You can't see it on the slide because this is not a built-in Storyline feature. When you preview the slide, you should be able to see it if the JavaScript code is executed. Once it's visible on the slide, you can use the developer tools to move it to the desired location, note the CSS properties, and update the code accordingly. You can also place a shape on the slide as a marker and adjust the CSS properties until it's properly aligned. My initial code sets the audio player right in the center. For instance, I used this code to position my audio player at the bottom center of the slide, stretched horizontally to occupy 98% of the slide width:

const audios = document.querySelectorAll('audio');
const slideLayer = document.querySelector('.slide');

audios.forEach(audio => {
    audio.controls = true;
    audio.style.position = "fixed";
    audio.style.top = "94%";
    audio.style.left = "50%";
    audio.style.width = "98%";
    audio.style.transform = "translate(-50%, -50%)";
    slideLayer.appendChild(audio);
})



To prevent the audio from auto-playing, simply use the trigger "Stop audio Audio When the timeline starts on this slide." Then handle the audio with the audio controls.

Nedim Ramic

What would you like to do with multiple audio players? Do you want to display them all with different positions and styles, or just show a specific one? If you have a JavaScript setup that iterates through all the audio players, you can access each one individually and customize their styles by indexing them.