Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8174629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:30:36+00:00 2026-06-06T22:30:36+00:00

I have a directory on my website with several mp3’s. I dynamically create a

  • 0

I have a directory on my website with several mp3’s.
I dynamically create a list of them in the website using php.

I also have a drag and drop function associated to them and I can select a list of those mp3 to play.

Now, giving that list, how can I click on a button (Play) and make the website play the first mp3 of the list? (I also know where the music is on the website)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:30:37+00:00Added an answer on June 6, 2026 at 10:30 pm

    If you want a version that works for old browsers, I have made this library:

    // source: https://stackoverflow.com/a/11331200/4298200
    function Sound(source, volume, loop)
    {
        this.source = source;
        this.volume = volume;
        this.loop = loop;
        var son;
        this.son = son;
        this.finish = false;
        this.stop = function()
        {
            document.body.removeChild(this.son);
        }
        this.start = function()
        {
            if (this.finish) return false;
            this.son = document.createElement("embed");
            this.son.setAttribute("src", this.source);
            this.son.setAttribute("hidden", "true");
            this.son.setAttribute("volume", this.volume);
            this.son.setAttribute("autostart", "true");
            this.son.setAttribute("loop", this.loop);
            document.body.appendChild(this.son);
        }
        this.remove = function()
        {
            document.body.removeChild(this.son);
            this.finish = true;
        }
        this.init = function(volume, loop)
        {
            this.finish = false;
            this.volume = volume;
            this.loop = loop;
        }
    }
    

    Documentation:

    Sound takes three arguments. The source url of the sound, the volume (from 0 to 100), and the loop (true to loop, false not to loop).
    stop allow to start after (contrary to remove).
    init re-set the argument volume and loop.

    Example:

    var foo = new Sound("url", 100, true);
    foo.start();
    foo.stop();
    foo.start();
    foo.init(100, false);
    foo.remove();
    //Here you you cannot start foo any more
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website which using active directory authorization on a windows server in
I have a software package placed in the root directory of my website. I'd
I have a website and right now users can just open a directory and
I have recently created a directory for a customer of mine. The website is
I have several class files in App_Code in an ASP.net website running in Microsoft
Currently I have a url like this http://<client_name>.website.com/index.php?function_name&cat=32 I want to set things up
I have read the following tutorial Uploading Files To the Server Using PHP and
I have website (thebyandby.com) that got hacked several weeks ago. The problem is, the
I have a directory on a website that is password protected via htaccess. I
On my web site I would like to have several sub-domains. Files that create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.