Hi, I am using the following code in an embed HTML element to create an audio player. When this code is used in code editors it works fine, however I cant figure out why the buttons arent working. I got the code from another thread where @Quentin provided it.
The only part of the player that actually works is the 3 little dots at the end to download the file. The volume and everything else doesnt function.
It can be a bit tricky to manage because you need those double quotes. One way to do it is with the concatenate formula. In the screenshot above, you see that we have:
the first part of the quote in between quotes,
the URL in between quotes with a backquote (i.e. `) before and after the quotes. This is the important part that is easy to mess up,
Ah ok sorry, my first screenshot wasnât clear: you donât need to be in Javascript mode for this, you can toggle back to Formula and use the concatenate formula:
If youâre in Javascript mode, youâll need to add return wwFormulas. before what you have to work with the concatenate formula and return its result:
One more question if possible. Iâm trying to style the audio player with CSS. Iâve set the elements HTML Attribute to âaudio-playerâ and put the css in the custom code for the page referencing the element id, and I also tried using the css right inside the elements custom css box and I cant seem to see any changes at all, even when I publish it.
Whats the best way to add the custom css to this audio component?
I would like to take the opportunity of this post to ask you a question :
Is there a way to style the audio player outside of âcustom codeâ ?
Because Iâd like to integrate the audio player in a tricky way. And itâs very inconvenient to publish my page to see the result (as the code in âcustom codeâ only appears in published project). Itâs also very inconvenient to design the rest of my page if the audio player isnât correctly integrate.
What I ended up doing was basically rebuilding the Apple player in my app, with my own pause and play buttons etc. I use the Video Player component to actually play the audio file, only I donât actually display the component, because of course there isnt a video to show.
This way in a workflow you can use actions on âExecute Component Actionâ for the audio player to handle the pausing and playing of the file.
Nicely done @mark! Perhaps itâs a component you can add to the Marketplace when itâs out
@Hekup, great feedback! Iâve shared it with the product team. I donât think itâs anything weâll be able to prioritize any time soon but Markâs solution is great to build any custom player you like.
If you need any help along the way, feel free to start a new thread with the specific design youâd like to reproduce. Iâm sure we can help
Hi. I love your idea as I need to remove the 3 dots (canât have a download button on my content) and I also need to implement the play and pause outside of the audio player.
Iâve managed to get it working, with the exception of a progress slider and duration (time played so far). Did you get this working and if so, what variables did you hook into @mark ?
Or perhaps @Joyce do you know if the Video player exposes variables I can use to custom build my own progress bar and duration stamps?
Iâll wrote some docs about that element to make it easier to use and customize but in the meantime, youâll find info on how to work with its component actions here.
I donât know about the duration side of things but the play / stop buttons are definitely doable.
Hey @mark - thanks a million for sharing the video and code!! That was super kind and generous of you.
And it was really helpful to see what you did for your player! I had to build out the player for the web version of our kids audio stories app because the built in weweb components (audio or video) do not look good on iOS devices.
I do like that they have a âwidgetâ that works when you leave the app, and that the component makes connecting to bluetooth devices super easy.
Hereâs a quick video I shot of the component, including seek functionality: