Clone Project

Audio unmute/mute Javascript control

Created by
Ivan Badia
Similar Projects
Oops! Something went wrong while submitting the form.

0 Comments

Be the first to leave a comment.
Loading
User is typing...
No Name
Set
4 years ago
Moderator
This is the actual comment. It's can be long or short. And must contain only text information.
(Edited)
No Name
Set
2 years ago
Moderator
This is the actual comment. It's can be long or short. And must contain only text information.
(Edited)
Load More
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Load More
Description:  
Description from Webflow:  
Using custom code to control unmuting and muting sound. Video independent of the sound file loading from a cloud server ( Dropbox ). By default all audio URLs end with d1=0, if left with default settings sound wont play change to d1=1. Custom Code : <audio src="https://youraudiosource.com" class="audio"> // The audio HTML element const audio = document.querySelector('audio'); let playing = false; // Check if document is ready $(document).ready(function(){ // Clicking the play_btn $('.play_btn').click(function(){ if (playing == true) { audio.pause(); playing = false; // Setting the button text $(this).html("Play"); } else { audio.play(); playing = true; // Setting the button text $(this).html("Pause"); } }); });
Tags from Webflow: 
audio, javascript, webflowcustomcode
.