How to Add Background Sound

Hello, hope you all having a good time.

I’d love to add an atmospheric sound in the background of my website,
This is an example: Homepage | Sterling
Is it possible?

Thank you.

Most browsers have blocked that functionality since the majority of users hated it according to browser providers. Users need to toggle a switch (interact with a control) to activate the playback of sound.

It would require custom code, or you could offer a video (sound track) with a video embed, the user would have to click to play.

2 Likes

Try this code with Autoplay YouTube / Wistia / Vimeo player in background layer

<script>

	$("#sound").on('click', function (){
		if( $("video").prop('muted') ) {
		      $("video").prop('muted', false);
		} else {
		  $("video").prop('muted', true);
		}
	});

</script>
 <style>
 html { background-color: black; }
 </style>
2 Likes

Hi @x27
I saw that you figured it out with the sound, can you tell me how you did this? pretty awesome!