Playing music files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Shelly

    Playing music files

    I have a list of file descriptions in a list box that is filled via a php
    mysql select. I know the name of the file that is described by the file
    that is select from that list box. It is an audio file. I have a "Play"
    button. I know how to get to a section of code when the user clicks that
    button.

    Question 1: What do I have to do to make it play on the the user's machine
    when he clicks the "Play" button.
    Question 2: When he terminates the music, I want it to stay on the original
    page.

    Shelly


  • juglesh

    #2
    Re: Playing music files

    try this, it used to work on my old server, but now its a bit wonky,
    does work though. link to:
    script.php?song =coolsong.mp3 ,

    and make this the contents thereof:

    header("Cache-control: private");
    header("Content-type: audio/x-mpegurl");
    header("Content-disposition: inline;filename =stream.m3u");
    echo "http://www.yourdomain. com/mp3z/".$_get['song'];

    should start streaming that song in the users player of choice. User
    should never actually leave the page, the song will just start.

    for some wierd reason, it now loads about ten songs in my player, the
    last one being the actual song:
    <br -->
    b><br -->
    <br -->
    b><br -->
    <br -->
    b><br -->
    <br -->
    b><br -->
    <br -->
    b><br -->
    <br -->
    b><br -->
    <br -->
    b><br -->
    bipolarbears--Bi Polar Bears - demo 2002 - 03 - jumbalaya

    what's with the <BR>s??? there is no <BR> in my script that i am
    linking to. Only thing that's changed is the server, and i had to
    change permissions on the text file that i'm using for a counter (which
    is supposed to increment, used to, not now)

    Comment

    • Shelly

      #3
      Re: Playing music files

      "juglesh" <jugleshjunk@ho tmail.com> wrote in message
      news:1121130331 .609139.108940@ g47g2000cwa.goo glegroups.com.. .[color=blue]
      > try this, it used to work on my old server, but now its a bit wonky,
      > does work though. link to:
      > script.php?song =coolsong.mp3 ,
      >
      > and make this the contents thereof:
      >
      > header("Cache-control: private");
      > header("Content-type: audio/x-mpegurl");
      > header("Content-disposition: inline;filename =stream.m3u");
      > echo "http://www.yourdomain. com/mp3z/".$_get['song'];[/color]

      Thanks. I tried this. It brought up the windows media player skin, but the
      message I got was that it was unable to play any of the playlist.

      First, it asked for a login to the server.
      Second, it said it was unable to play that type even though it plays that
      file locally on my machine.

      Shelly



      Comment

      • Shelly

        #4
        Re: Playing music files


        "Shelly" <sheldonlg.news @asap-consult.com> wrote in message
        news:iLSdnWgEIN 3JSEzfRVn-3A@comcast.com. ..[color=blue]
        >I have a list of file descriptions in a list box that is filled via a php
        >mysql select. I know the name of the file that is described by the file
        >that is select from that list box. It is an audio file. I have a "Play"
        >button. I know how to get to a section of code when the user clicks that
        >button.
        >
        > Question 1: What do I have to do to make it play on the the user's
        > machine when he clicks the "Play" button.
        > Question 2: When he terminates the music, I want it to stay on the
        > original page.
        >
        > Shelly[/color]

        One more thing. I originally posted that I wanted it selected from a list
        of files. Do I do this with?

        header("Locatio n: myfile.php?song =thesong.mid");

        Shelly


        Comment

        • Shelly

          #5
          Re: Playing music files


          "Shelly" <sheldonlg.news @asap-consult.com> wrote in message
          news:M7qdnbJ1nZ fot07fRVn-rQ@comcast.com. ..[color=blue]
          >
          > "Shelly" <sheldonlg.news @asap-consult.com> wrote in message
          > news:iLSdnWgEIN 3JSEzfRVn-3A@comcast.com. ..[color=green]
          >>I have a list of file descriptions in a list box that is filled via a php
          >>mysql select. I know the name of the file that is described by the file
          >>that is select from that list box. It is an audio file. I have a "Play"
          >>button. I know how to get to a section of code when the user clicks that
          >>button.
          >>
          >> Question 1: What do I have to do to make it play on the the user's
          >> machine when he clicks the "Play" button.
          >> Question 2: When he terminates the music, I want it to stay on the
          >> original page.
          >>
          >> Shelly[/color]
          >
          > One more thing. I originally posted that I wanted it selected from a list
          > of files. Do I do this with?
          >
          > header("Locatio n: myfile.php?song =thesong.mid");
          >
          > Shelly[/color]

          Yes. I answered my own question.

          Shelly


          Comment

          Working...