www.webdeveloper.com
Results 1 to 8 of 8

Thread: Best Script or Tool for offerring mp3's to play or download - slick user interface.

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    33

    Question Best Script or Tool for offerring mp3's to play or download - slick user interface.

    Hello -

    A question as old as time, I know I've spent years on it myself.

    I'm tricking browsers right now by adding a content type of attachment to my mp3 headers. This as you know opens up the Windows dialog asking if you want to open or save this file. Opening of course plays it.

    I'd like something slicker, something where I'm not relying on a browser trick, something where 'play' is one link and 'download' is another....

    Any thoughts or recommendations are appreciated. I've searched and searched but only find client side suggestions for the best media players and such.

    Thanks all

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,132
    Look in to the HTML5 audio element. I like using MediaElement.js as it offers a good cross browser experience:
    http://mediaelementjs.com/
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  3. #3
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    33
    Thanks, I'll check it out.

    But I was hoping for a script or some software that offers up the mp3 based on what is clicked - like download or play.
    The mediaElement is another player.

    I've heard that HTML5 solves this - you just add the word 'download' to the anchor tag of the download link, and leave it off of the other link - Has anyone tried this ?

  4. #4
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,132
    I'm confused. You would simply have two options. One would be the "play" where you could use the Media Element JS script. The other would be download, where you can use the method that you already have.
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  5. #5
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    33
    Quote Originally Posted by cbVision View Post
    I'm confused. You would simply have two options. One would be the "play" where you could use the Media Element JS script. The other would be download, where you can use the method that you already have.
    The current 'download' method isn't perfect as it just adds header content type attachment to force the pop up window which offers 'Open' or 'Save' - this still allows playing (Open) and is a bit messy. A straight Download button and media player would be cleaner.

  6. #6
    Join Date
    Jan 2014
    Posts
    49
    which is best element

  7. #7
    Join Date
    Mar 2005
    Location
    Behind you...
    Posts
    969
    You could use PHP to 'force' a download of the mp3, and then just use the mediaelement.js beside whatever download link you offer.

    There's actually a topic on this forum about getting PHP to force a download of an mp3: http://www.webdeveloper.com/forum/sh...d-of-streaming

    Post #4 shares the PHP code for what you want to do. You may want to modify it slightly, depending on how you want to select the file. For instance, you may not want the filename in the link, so you could utilize some id system perhaps. Or maybe you could just include the filename itself but have the files in a folder (not displayed anywhere), and in the PHP file append the folder to whatever filename is passed (to protect the audio files directory, if you care about that).
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

  8. #8
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    33
    Great, I'll give that a try.

    Thank you

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles