Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MP3 player in browser

    Hi,

    I'd like to create a mini mp3 player in the browser. I was thinking of using quicktime to play the MP3 but wondering how to manage the play/pause buttons?

    Any advice?

    Thanks

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Code:
    <object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
    id="mediaplayer1" height="40" width="120">
    <param name="Filename" value="maquillaje.mp3"><param name="AutoStart"
    value="False"><param name="ShowControls" value="True"><param
    name="ShowStatusBar" value="False"><param name="ShowDisplay"
    value="False"><param name="AutoRewind" value="True">
    <embed type="application/x-mplayer2"
    pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
    src="kids.mpg" filename="maquillaje.mp3" autostart="False"
    showcontrols="True" showstatusbar="False" showdisplay="False"
    autorewind="True" height="40" width="120"> 
    </object>
    This is not the best way to do it, but it will work. I'm a little foggy on the latest way of doing this, so if anyone who knows reads this post, could they explain it?

    As far as the controls go, just change "True" to "False", and they won't show

    Dan

    EDIT: You'll have to go through and edit the code so itr plays the right song and stuff. It should be pretty self-explanatory. I just grabbed this off a how-to site.
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New Coder
    Join Date
    Jan 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So if I wanted to use quicktime instead I'd change the Type and Pluginspage attributes of the <embed> tag?

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    I believe so.

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Wait. here's the code, straight from apple.

    Code:
    <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="160"HEIGHT="144"
    CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
    <PARAM name="SRC" VALUE="sample.mov">
    <PARAM name="AUTOPLAY" VALUE="true">
    <PARAM name="CONTROLLER" VALUE="false">
    <EMBED SRC="sample.mov" WIDTH="160" HEIGHT="144" AUTOPLAY="true" CONTROLLER="false" PLUGINSPAGE="http://www.apple.com/quicktime/download/">
    </EMBED>
    </OBJECT>
    Dan (in red the place to control the buttons)
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #6
    New Coder
    Join Date
    Jan 2004
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just curious why the SRC, AUTOPLAY, CONTROLLER values have to be duplicated in the <PARAM> tags and the <EMBED> tag?

  • #7
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    brwser compatibility.

    IE only supports some tags, and NS/FF only support some

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #8
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Remember, embed has been deprecated for some time... if you want to keep things valid use <object>.

    http://www.w3schools.com/tags/tag_object.asp

    Hope this helps...

  • #9
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    it may be deprecated but some gecko browsers have trouble trying to intepret the object tag for a sound file, unless you know of how to play a background sound using the object tag only that will work in most of the new browsers, then i would like to see what that code is

  • #10
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Quote Originally Posted by _Aerospace_Eng_
    it may be deprecated but some gecko browsers have trouble trying to intepret the object tag for a sound file, unless you know of how to play a background sound using the object tag only that will work in most of the new browsers, then i would like to see what that code is
    I've never tried it before I usually always end up linking to the direct file for sound (usually mp3s) and let browser preferences take over.

    But, I looked it up, and it seems that IE is the one that has trouble with <object>...

    http://webdesign.about.com/cs/multim.../htbgsound.htm

    I'll try it out later and see what happens.

    Edit: Yep. Works on Moz, not IE... go figure

  • #11
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Basically, if your into standards, keep looking. If you want quick fix, use the above code

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #12
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    OOPS, double post, sorry
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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