Jump to content

HTML Music Help

kurtstir

Hello,

I am working on making a website and want to have a page which plays music when you load it. Now what I want to do is have a list of songs in the html page file an have it so that if the page is reloaded a RANDOM song plays from the list. Is this possible?

 

Site: kurtstir.neocities.org

 

PAGE CODE AND STYLE.CSS:

Spoiler

Music.html

Spoiler

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>ETHS Anime Club</title>
    <!-- This website is dedicated to the people of the wired. -->
    <link href="/style.css" rel="stylesheet" type="text/css" media="all">
  </head>
  <body>
    <div align="center">
      <h1>Home of the ETHS Anime Club</h1>
      <div class="header">
       <div class="container">
        <ul>
              <li><a href="/index.html">Home</a></li>
              <li><a href="/About.html">About</a></li>
              <li><a href="/Journal.html">Journal</a></li>
              <li><a href="/Photos.html">Photo's</a></li>
              <li><a href="/Music.html">Music Room</a></li>
              <li><a href="/Contact.html">Get In Touch</a></li>
            </ul>
        </div>
     </div>
    <p style="font-size: 30px">Music Room</p>

    </div>
  </body>
</html>

 

 

Spoiler

style.css

Spoiler

/* CSS is how you can add style to your website, such as colors, fonts, and positioning of your
   HTML content. To learn how to do something, just try searching Google for questions like
   "how to change link color." */

body {
  background-color: #FFD4FA;
  color: #2AA1F3;
  font-family: Verdana;
  margin: 0 auto;
}

h1 {
    color: #2AA1F3;
  }
    
  .container {
    max-width: 940px;
    margin: 0 auto;
    padding: 0;
  }
 
  .header {
    background-color: #6b8728;
  }
 
  .header ul {
    list-style: none;
    text-align: center;
    margin: 0;
    padding: 0;
  }
 
  .header li {
    color: #fff;
    display: inline-block;
    font-size: 20px;
    text-align: center;
    padding: 20px 30px;
    margin: 0;
  }
 
  .container a {
  text-decoration: none;
  color: white;
 }
 
  .container a:hover {
    text-decoration: underline;
    cursor: pointer;
    color: blue;
  }

 

 

 

IM BACK BABY

Link to comment
Share on other sites

Link to post
Share on other sites

HTML5 Audio

HTML Audio Autoplay

This might get you started, you might be able to find some JavaScript code to make the selection random, or create it yourself if you're up for a challenge.

DELETE! DELETE!

EXTERMINATE! EXTERMINATE!

Silence will fall.

 

PSU Tier List - I keep forgetting where this is so I'm going to leave it here.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, VVoltor said:

No.

 

No no no no.

 

wat

IM BACK BABY

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Macimoar said:

HTML5 Audio

HTML Audio Autoplay

This might get you started, you might be able to find some JavaScript code to make the selection random, or create it yourself if you're up for a challenge.

All I need is how to randomize what plays. Like an html random number generator which activates on load and its output is the song that plays.

IM BACK BABY

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, kurtstir said:

All I need is how to randomize what plays. Like an html random number generator which activates on load and its output is the song that plays.

My best advice would be do some research on how other people have implemented JavaScript into their websites to do something similar to this and make it your own. I don't know if you have any experience with JS but if you only know HTML/CSS then it is a great and logical next step to start learning. I would not suggest copying and pasting somebody's code into your website unless you contact them and ask them first.

 

There should be several graphical players that you could get from websites to put on yours, and you might be able to find one that fits your needs if you search "embedded music player". Personally, I'd try to make my own because I like the sense of accomplishment, but to each their own.

Anyway, best of luck!

DELETE! DELETE!

EXTERMINATE! EXTERMINATE!

Silence will fall.

 

PSU Tier List - I keep forgetting where this is so I'm going to leave it here.

Link to comment
Share on other sites

Link to post
Share on other sites

58 minutes ago, kurtstir said:

wat

myspace had a feature to play music on page load. myspace failed

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

He is pointing out that a website that does have a autoplay for music is awful. you never expect it mostly its loud af and you always have to look how to pause it.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Cruorzy said:

He is pointing out that a website that does have a autoplay for music is awful. you never expect it mostly its loud af and you always have to look how to pause it.

Almost all neocities.org sites have it

IM BACK BABY

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, kurtstir said:

Almost all neocities.org sites have it

Well if it is aimed for a community who likes that stuff, sure go ahead.

But its not a thing you should implement on websites you roll out in general.

 

I dont know what neocities is but it probably has some sort of community that are familiar with that stuff and like that stuff.

And "Almost ...... use it" is not that great of a argument.

 

I visited one of those site's and like i said, the music was loud af which kinda put me off and couldnt find a button to make it stop. That is like a instant Alt + F4 for me.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

Oh and 

Quote

Our mission: To make the web fun again by giving you back control of how you express yourself online.

Its not for professional use, its for fun and expressing yourself i see.

So then it is no problem! just keep in the back of your head alot of people will find it horrible.

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

52 minutes ago, Cruorzy said:

Well if it is aimed for a community who likes that stuff, sure go ahead.

But its not a thing you should implement on websites you roll out in general.

 

I dont know what neocities is but it probably has some sort of community that are familiar with that stuff and like that stuff.

And "Almost ...... use it" is not that great of a argument.

 

I visited one of those site's and like i said, the music was loud af which kinda put me off and couldnt find a button to make it stop. That is like a instant Alt + F4 for me.

Yeah after typing that I forgot how to delete it derp

 

IM BACK BABY

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×