« Web, HTML, Tech Forum

★ HOW TO AUTO-PLAY MUSIC ON YOUR PROFILE ★ [Step by Step Guide]

Posted by MARBLE_EYES43

posted
updated

Forum: Web, HTML, Tech

Background music is often desired by a multitude of users. It adds a lot more character to a profile and makes the place a bit less empty while looking through it!

I see a lot of other users requesting help to set up their own profile music when it's very simple to do so!

It's as easy as 2 Copy and Pastes!


// Step 1 // Paste this HTML code in any of your Blurb on your profile.


<iframe width="560" height="315" src="https://www.youtube.com/embed/(VIDEO URL)?autoplay=1&loop=1&controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy">
</iframe>


// Step 2 // Copy the desired YouTube video link and take a specific part of the URL.

https://www.youtube.com/watch?v=dQw4w9WgXcQ&ab_channel=RickAstley


// Step 3 // Once you got that, paste it away in the bold section of the script.

<iframe width="560" height="315" src="https://www.youtube.com/embed/(VIDEO URL)?autoplay=1&loop=1&controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy">
</iframe>


Results should look like this

<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&loop=1&controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy">
</iframe>


And Voila! You should successfully have a working auto-playing page!

And for the people who wish to not have the video visible and keep it to nothing but background music, only 2 things needs to be changed in the HTML code.



// With Video Display //

<iframe width="560" height="315" src="https://www.youtube.com/embed/(VIDEO URL)?autoplay=1&loop=1&controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy">
</iframe>


// Without Video Display //

<iframe width="
0" height="0" src="https://www.youtube.com/embed/(VIDEO URL)?autoplay=1&loop=1&controls=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" loading="lazy">
</iframe>


There you go! I hope this was able to help some people!
If you liked this guide, make sure to interact with the Forum Topic to make some traction! Would help a lot! 

(edit #1) [03-03-2024]

I've heard a lot of users seems to be struggling with the auto play feature. The current HTML code is supposed to auto play it in most browsers. However, some users that are using Firefox might experiences some issues! I don't use Firefox, but I've heard it might be a very easy fix. Make sure you have auto play enabled in your browser settings!

(edit #2) [03-04-2024]

Additional information for you folks out there, after seeing the comments on this Forum, I've notice one that quotes:

This only partially works. After your done editing your profile and you click "view profile" it auto-plays, but after that it just doesn't work anymore. I've sent the link of my profile to my friends multiple times to know if it was a problem on my end, every time they all said no music was playing. It only works once."

To start off to this reply, thank you for letting me aware of the situation!


After a few updates with Spacehey, I think something changed. I did notice that once I refresh my page, the auto-player doesn't seem to work! I believe that's because the page is already loaded somewhat. As soon as I direct my browser to another page THEN load my profile back in, the music seems to be playing as intended!

The player works, but only every time you load a page. Refreshing it seems to not be helpful to that regard. At least, to me. Let me aware if your browsers have indeed auto-play enabled and if re-loading your profile doesn't seem to fix the issue! 


Report Topic

46 Replies

Sort Replies:

Reply by Valentina ♥︎

posted

Is there a way to loop the songs?


Permalink Report Reply

Reply by MARBLE_EYES43

posted

In the code line itself, it says "loop". There's probably a correct wording to be put around that line. I'll IM you if I find a way.

The best solution I can give you for the time being, select a song, but look for someone who made a lengthy loop of it on youtube. Like a 10h loop


Permalink Report Reply

Reply by Martin C.

posted

I truly appreciate this! But Its still not autoplaying for me...


Permalink Report Reply

Reply by Boogley

posted

Don't know if anyone else is using firefox but you gotta make sure you allow autoplay for audio and media. That was my mistake cx


Permalink Report Reply

Reply by don / spooky ✟

posted

Thanks! I think im just doing something wrong but im gonna figure this out soon!


Permalink Report Reply

Reply by ここ ꒰ 🎼🍓

posted

thank you now i can use john hutcherson whistle 


Permalink Report Reply

Reply by JC☆

posted

Reply by ⤷ Sasha / My !

posted

it worked! thank you


Permalink Report Reply

Reply by LegoLuigi

posted

thx now theres first round from gorilla night battle playing in my bg :D


Permalink Report Reply

Reply by .

posted

Reply by Matt

posted

I can use a playlist


Permalink Report Reply

Reply by ARCANE_AZRAEL

posted

this only partially works. after your done editing your profile and you click "view profile" it autoplays, but after that it just doesnt work anymore. ive sent the link of my profile to my freinds multiple times to know if it was a problem on my end, everytime they all said no music was playing. it only works once.


Permalink Report Reply

Reply by Amina Seymone

posted

Thank you so much. I am truly grateful.


Permalink Report Reply

Reply by PostalDumbass

posted
updated

the loading thing doesn't seem to be an issue on my end. i can refresh the page multiple times and my song plays. probably seems to be dependent on browser instead of the site itself, as i use firefox (i assume its the latest version of it as of posting this). whoever reported that issue might be using another browser like chrome or opera gx, and those browsers might work differently with things such as reloading all of the code on a website on refresh. though i dont recall my music playing.


Permalink Report Reply

Reply by @ AC1D

posted

If you want to loop the music, find a long version of the song you want to play. don't do anything to the code (obviously change the (VIDEO URL) part to ur videos URL) and go to ur page and double click the video and click loop! (this only works for computer/pc users!! sorry!)


Permalink Report Reply

Reply by MARBLE_EYES43

posted

Replying to DwemeriOddity,

Some YouTube videos have a weird link. It seems longer and more complex for some reason. to make sure you got a link that WILL be valid.


Here's an example of a link may have more things that will render the text null if not copied correctly.


This would be what 
https://www.youtube.com/watch?v=rw392gowFu4&t=2455s


To be sure to have the right piece of HTML, head over to the sharing button under the video itself and click the "embed" option.
It should give you something similar as the code in the forum.

<iframe width="560" height="315" src="https://www.youtube.com/embed/rw392gowFu4?si=Z_Z4VX07Wj3SOZ-s" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

This should be easier to get working links!


Permalink Report Reply

Reply by Aero/space

posted

Thank you so much!! I am using Firefox and I didn't know that the browser automatically blocks autoplay, you're life saver!


Permalink Report Reply

Reply by Mew

posted

omg thank you ..the problem i had because it was wrong link without the video yay it finally works


Permalink Report Reply

Reply by jesse

posted

its not working for me


Permalink Report Reply

Reply by burgers

posted

It worked for me! But what if I want to have it start at a certain time?


Permalink Report Reply

Reply by honey.guts

posted

thank you so much!!


Permalink Report Reply

Reply by 1NF3CT3D!! (Kyle. ༺☣༻/REDOING ENTIRE PROFILE)

posted
updated

ERGH!! THANK YOU SO MUCH!!!!!!!!!!


Permalink Report Reply

Reply by Winter

posted

Hi, I tried it and it worked. Thank you so much for a helpful guide that is easy to understand. I wish you have a nice day <3


Permalink Report Reply

Reply by Sasu

posted

thank you, now autoplay works correctly but the loop does not, but this is not a problem as the music I put on lasts 5½ minutes.


Permalink Report Reply

Reply by Squ!99l3z

posted

is there a way to add more than one song so that it doesnt get repetitive?


Permalink Report Reply

Reply by Maria Lopez

posted

Thank you this was so helpful !


Permalink Report Reply

Reply by Teenage_Faceland

posted

The follow up notes detailing about firefox issues are a genuine godsend thank you so much


Permalink Report Reply

Reply by honeyinjectednightmareXD

posted

OMG TYSM THIS IS THE ONLY TUT THAT WORKED


Permalink Report Reply

Reply by robin

posted

Yeah, this just.. isn't working. I've searched as many websites as I can but I can't find anything for my link, especially because YouTube won't let me embed the video I want .⁠·⁠´⁠¯⁠`⁠(⁠>⁠▂⁠<⁠)⁠´⁠¯⁠`⁠·⁠.


Permalink Report Reply

Reply by trashyashley

posted

Ahh!!! thank you so much! i just loved music videos that certain artists had and i'm glad that i'm able to display it on my profile!!


Permalink Report Reply

Reply by riley x3

posted

for any people wondering about loop;
try adding &playlist=(YOUR VIDEO_ID) at the end of the src string


Permalink Report Reply

Reply by davidddisjesus

posted

hello! i actually had my own autoplay script prior to seeing this post;

<iframe width="0" height="0" src="https://youtube.com/embed/u03M-KJlYII?;amp;;autoplay=1&;loop=1&;controls=1" title="Embed SOTD Player v2" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture;" allowfullscreen="" loading="lazy"></iframe>

it seemed to work fine when i first wrote it up in vsc and put it on my profile, but after 2-3 reloads it no longer works. I went to the direct youtube.com embed link to see what's the matter, and i got an error stating the video is unavailable for embed and that it must be watched on youtube.com. This is certainly because of some kind of copyright setting. but it worked perfectly fine for other copyrighted songs i put on my profile previously...

i did find a bypass for this from a codepen user, what this bypass does is embed the site on codepen, and then embeds the codepen to your page. if you test it out on the site it actually works, but as soon as you add it to your profile spacehey instantly removes it because it's not an approved embed link. so i guess we're stuck with no music on our profiles for a while now...


Permalink Report Reply

Reply by mari

posted

Reply by enzo ☆

posted

thanks so much, i struggled too much with that LMFAO 


Permalink Report Reply

Reply by SimSim🔆

posted

WOW ! ! This is the very first tutorial which has worked for me ! !

Thank you :D


Permalink Report Reply

Reply by alwyzblkcoffee

posted
updated

Does anyone know if this could be a browser issue? I have used the layout editor, and it works fine. But when I go to try it live and check on Safari, it doers not work. 



**UPDATE**

- I figured it out. If you are running Safari, within your settings there is an "Auto-Play" option. 

You want to let it "Allow All Auto-Play" when visiting other websites. Then you can manually go through and change the settings for any additional websites you visit.


Hope this helps. 𓃶 


Permalink Report Reply

Reply by mercury

posted

IT WORKED AHH TYSM :333


Permalink Report Reply

Reply by Gh0sty

posted

I've tried this multiple times but still the music I want doesn't play no matter how many times I do it when I use other people's audios they play but not mine :c


Permalink Report Reply

Reply by Astrogia

posted

Omg it works thank you so much!^^


Permalink Report Reply

Reply by spencer

posted

omg tysmmm \( ̄▽ ̄)/


Permalink Report Reply

Reply by Spencer 🕸️

posted

I have been messing around with trying to embed autoplaying music on my profile, but have you or anyone you've seen found a way to imbed a playlist rather than just one video? Ive tried using the embed link youtube gives me and adding something for it to autoplay but nothing seems to work.


Permalink Report Reply

Reply by Spencer 🕸️

posted

I have been messing around with trying to embed autoplaying music on my profile, but have you or anyone you've seen found a way to imbed a playlist rather than just one video? Ive tried using the embed link youtube gives me and adding something for it to autoplay but nothing seems to work.


Permalink Report Reply

Reply by hxlloketty

posted

Still helping to this dayyy, thank God for this lol


Permalink Report Reply

Reply by angie♡

posted

guys if it doesn't work for you and you use chrome go to your site settings for spacehey and change your permissions for sound from "automatic" to "allow"


Permalink Report Reply

Reply by bumfiddler

posted

How do I allow auto play 


Permalink Report Reply

Reply by sums

posted

thank god for this,,, i wanted to change my autoplay music but i forgor how to and the other codes i tried wouldnt work ;-;


Permalink Report Reply