Home | Profile | My Blog
ZombieChinyoka

Last Login:
December 9th, 2020

View All Posts


Gender: Female
Status: In a relationship
Age: 22
Sign:
Country: Germany

Signup Date:
October 04, 2019

Subscriptions

03/10/2020 05:42 PM 

HTML lesson 5 - profile songs and playlists

Hello and welcome to my next HTML tutorial, where I show you how you can customize your profile, your blog layout or any other website with HTML and CSS! If you're new to this, you can find the whole tutorial series in my blog where I explain HTML and CSS from the very beginning. It's really easy, don't worry! :)
I can't do these that often sadly because it takes a while researching and writing everything and I have a full time job which requires most of my time and mental power too, so I just want to apologize for the long time you had to wait. Today I want to cover something I got requested A LOT, and I can't blame you because it's one of the best features for profile page.
You might have noticed it if you've ever visited my profile, that I have some song playing on it when you load the page. A while ago we could use the adobe flash player to create a playlist that you could insert in your profile very easily. Since the flash player doesn't seem to work on friendproject anymore, we needed to find another alternative now.
What I can show you isn't exactly as good as the flash player playlists, because with this method you can choose only one single song to play on your profile. Anyway, it's pretty cool. Let's get started!

HTML Audio

HTML5 brings us a tag for implementing an audio file in our web page. It can be a song, but it can also be any other sound as long as it has a supported format. And this is how it looks:

<audio></audio>

1

Before we can implement a song in it, we need the song file on our computer (if you already have it downloaded on your PC, you can skip this step). I usually use youtube as the source for my songs, so I'll show you my method - probably not the best, and there are 1000 of other ones, but just to have an example to start with.
Go on YouTube and search for the song you want to use. Copy it's link, then go to https://2conv.com/en36/ and follow the steps to download an mp3 file (be careful, that site often opens some ads or stuff, I don't know a better one though...). Once you have it somewhere on your PC, time for the next step.

2

Now go to https://kiwi6.com/. If you don't have yet, you will need to create an account there. Once you're logged in, go to Account->File Manager:

Account->File Manager

On this page, you should be able to upload files. You might have to enable flash player first. Upload the .mp3 file of your song. When you're done, there should be a field called "Direct Hotlink" with an URL that ends with .mp3. Copy this link.

Back to the code with the <audio> tag. Now you can specify a source-attribute to the tag, exactly like you would do it with an image.

<audio src=""></audio>

Inside the scr, paste the mp3 link. If everything went right, you're almost done. The audio is in your page, but if you load it, it won't play, because by default, it doesn't start on it's own, it needs a trigger.
To fix that, you just need to put another attribute in the tag: the autoplay-attribute. What it does is to trigger the player the moment your page is loaded.

<audio src="https://k007.kiwi6.com/hotlink/lrur973bdq/Still_A_Stranger.mp3" autoplay></audio>

Now when you load your profile, you should hear the song playing!

That's already pretty nice, but there's even more stuff you can do with the audio tag. You can give it music player-like controls for pausing and playing or adjust the volume by simply adding another attribute to the <audio> tag, which is the controls-attribute.

<audio
 src="https://k007.kiwi6.com/hotlink/lrur973bdq/Still_A_Stranger.mp3"
 autoplay
 controls
></audio>

Now something like this should appear in the position where you have the code:

HTML audio controls in Firefox

Note that this is the way it looks in firefox, however, in other browsers it might look different. In Chrome for example, you would see this:

HTML audio controls in Google Chrome

If you think your song can be heard over and over again because it's so good, or if you just want to annoy your profile visitors, there's also the loop-attribute. If you add it, the audio will play on loop.

<audio
 src="https://k007.kiwi6.com/hotlink/lrur973bdq/Still_A_Stranger.mp3"
 autoplay
 controls
 loop
></audio>

For a complete example, here's an audio that doesn't load on the pages loading, that has controls and that plays in a loop (if you don't stop it.).


Summary

  • use the <audio> tag for implementing audio files in HTML
  • the autoplay-attribute triggers the audio to play on the page load
  • the controls-attribute displays pause/play and volume options
  • the loop-attribute plays the audio on loop
  • learn more about the <audio> tag on w3schools!

Something easier maybe?

If you have spotify, your lucky, because spotify has an option to embed a playlist as HTML code. However, it won't have autoplay and for people who don't have spotify or aren't logged in with it on their device will only be able to hear short parts of a few songs from it. Anyway, it's still a nice way to share your music with others. Here's how it works.
Go to the spotify playlist you want to use. It can be your own playlist or any other on the platform. Then you click on the three dots. Under the share option there should be "Copy Embed Code".

Spotify playlist embed code

Great playlist btw o.O
Copy it and paste it anywhere you'd like in your profile. Now you should have code like this:

<*****
 src="https://open.spotify.com/embed/playlist/37i9dQZF1DXd6tJtr4qeot"
 width="300"
 height="380"
 frameborder="0"
 allowtransparency="true"
 allow="encrypted-media"
></*****>

All you have to do now is to replace the "*****" with "embed", and the spotify player should be there! EDIT: Apparently, friendproject censores the word you have to replace for some reason. Anyway, if you copy it you will see what is meant. Hope this doesn't cause any confusion.

Embedded spotify playlist

You can also combine the spotify playlist and the HTML audio tag in one page since the one from spotify doesn't have autoplay anyway.

Sooo no you are able to implement music in your profile! I want to see a lot of you with some profile songs now xD
If you're still having issues to get it to work or questions about it, please don't hesitate to ask me! I'm always happy to help people and I will do my best to support you with all HTML- or CSS-problems.
Also I'm always happy about requests or suggestions for things you want me to do a tutorial about. I still have a few ideas but if you have something, please tell me! Hope you'll have fun with this new learned feature ^-^

8 Comments  

View All Posts


Sara

 

Sep 5th 2021 - 10:18 PM

Comment Back  |   Send Message   |  Block User

YOU ARE MY HERO!!
Thank you SO much for your helpful posts!!!


drew

 

Jul 16th 2020 - 8:24 PM

Comment Back  |   Send Message   |  Block User

hey, i found an alternative method that solves the issue with that kiwi website being a broken pile of junk, view_blog.php?id=0000024216   there are different options for having music on your profile here both in the blog post and the comments, but the most important thing is it shares a file sharing website whose links work - https://www.mailboxdrive.com/ 

they work with a different code than what you described here but all of that information i found in the comments section



ZombieChinyoka

 

May 29th 2020 - 1:22 PM

Comment Back  |   Send Message   |  Block User

Hey, I've noticed that too, it's probably a current problem with the website. I'm trying to find an alternative until they fixed it, sorry I can't help you right now :/


xx_bloodyandy_xx

 

May 29th 2020 - 12:28 PM

Comment Back  |   Send Message   |  Block User

hay ive followed your method and everything was going right but kiwi6 doesnt let me upload :(( i got redirected to a blank page with an error message and ive tried again many times, any ideas? sorry for bothering!


ZombieChinyoka

 

May 27th 2020 - 5:31 AM

Comment Back  |   Send Message   |  Block User

Hey! I just tried it, and I got redirected to a blank page with an error message, is this also what happens to you? If so, this seems to be a problem with the website. I can try to find some alternatives, I'll give an update when I find something!


trinity™

 

May 27th 2020 - 3:46 AM

Comment Back  |   Send Message   |  Block User

hey!! idk if its just me but kiwi6 doesnt let me upload?? 


ZombieChinyoka

 

May 16th 2020 - 3:48 AM

Comment Back  |   Send Message   |  Block User

For me it works on your profile! You have it twice tho, one starts to play immediatly and one is bound to the control box :D But maybe we can try to figure out why it won't play for you. What browser are you using?


Xxdepressed-pizzaxX

 

May 15th 2020 - 6:29 PM

Comment Back  |   Send Message   |  Block User

I tried the first method but the song won't play. The audio box shows up when I click on my profile but it won't play the song. However when I right click on the audio box and click "Copy Audio Address" and paste it on a new tab, the song plays automtically by itself, but it won't work on my profile. This is the second time I've done this method and it sadly hasn't worked for me. Any ideas?

View All Posts



Mobile | Terms Of Use | Privacy | Cookies | Copyright | FAQ | Support

© 2024. FriendProject.net All Rights Reserved.