abecknyc Posted October 28, 2020 Share Posted October 28, 2020 I'm trying to have an MP3 song play automatically when you land on the home page for a wedding website. I do not want to hide the player, just autoplay. The song is not on Soundcloud. Thank you so much for any and all tips/help! Link to comment
tuanphan Posted October 31, 2020 Share Posted October 31, 2020 Do you still need help on this? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Soredadux Posted December 10, 2020 Share Posted December 10, 2020 Hi! Do you find a solution? I'm trying to do the same thing! @abecknyc Link to comment
creedon Posted December 10, 2020 Share Posted December 10, 2020 @Soredadux One way to do this is to add a code block and enter the following code. <audio controls autoplay> <source src="[enter your MP3 file url here]" type="audio/mpeg"> Your browser does not support the audio element. </audio> Replace the [enter your MP3 file URL here] with the URL for your MP3 file. If you have different versions of the audio files for playability on a wider range of platforms you can add source tags <source src="" type="audio/ogg"> See HTML <audio> Tag < https://www.w3docs.com/learn-html/html-audio-tag.html > for more info. Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Soredadux Posted December 10, 2020 Share Posted December 10, 2020 2 hours ago, creedon said: One way to do this is to add a code block and enter the following code. <audio controls autoplay> <source src="[enter your MP3 file url here]" type="audio/mpeg"> Your browser does not support the audio element. </audio> Replace the [enter your MP3 file URL here] with the URL for your MP3 file. If you have different versions of the audio files for playability on a wider range of platforms you can add source tags <source src="" type="audio/ogg"> See HTML <audio> Tag < https://www.w3docs.com/learn-html/html-audio-tag.html > for more info. Let us know how it goes. Hi! It was the first thing I've tried, but doesn't work on smartphones and I really don't know how to style it. Right now I have this code: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function(){ //var buttons = document.getElementsByClassName("play-button"); console.log("1"); //setTimeout(function(){ $(".sqs-block-code").click(function() { $(".play").click(); $(".sqs-block-code").off(); }); //},3000); //setTimeout(function(){ $(".play").click(); }, 3000); }); </script> The things is that works only if you make "click" on the page (anywhere). Link to comment
creedon Posted December 11, 2020 Share Posted December 11, 2020 @Soredadux Please post the URL for the page where you want to auto play the audio. If your site is not public please set up a site-wide password, if you've not already done so. Post the password here. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.