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 9 of 9
  1. #1
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts

    how to embed generic media player

    Hi, I want to enable users of a site, to play a selection of mp3 samples. Presently I have embedded windows media player but in IE it opens up QT when the selection is made, making site design difficult.

    How can I code my page so that opening a music sample, opens the media player set in the users browser?

    bazz

  • #2
    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
    What is the code you are using to embed the song?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Hi Aerospace_Eng,

    I have gone through the sticky several times and still don't see what I am getting wrong.

    This is the javascript I have used.
    Code:
    <script type="text/javascript"><!--
    function song(){
    document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('samples').value+"' name='MediaPlayer1' width='250' height='50' controltype='2' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>";
    }
    //-->
    </script>
    This is the select part in the xhtml

    Code:
    <select id="samples" onchange="song()" size="1">
       <option value="none">::::::::::::: Choose Your Song Here :::::::::::::</option>
    
    <option value="http://mydomain.com/ProMusic/Annie Laurie.mp3">Annie Laurie.mp3</option>
    
    </select>
    and this is the code for the media player.

    Code:
    <span id="music1"><embed type="application/x-mplayer2" id="music1"
    pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" 
    src="" 
    name="MediaPlayer1" 
    width="250"
    height="50"
    controltype="2" 
    showcontrols="1"
    showstatusbar="1"
    AutoStart="0">
    </embed></span>

    Any help you can give willl be much appreciated


    bazz

  • #4
    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
    I don't think you've gone through the sticky as much as you should have. If you had you would have seen this post

    http://www.codingforums.com/showpost...&postcount=320

    It uses wmv but can made to use mp3 by changing the extension in the code.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Thank you very much. I have it working now in IE but not in FF. Is there any way to make it work in both browsers?

    bazz

  • #6
    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
    If you used the same code I provided and not tried to modify an existing script you had then it should work both in IE and Firefox. Perhaps you should post a link to your page. Its clear you aren't doing something correctly.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Oh dear. I have looked again this morning and still can't see what's wrong.

    here's the location of the page.

    http:// w w w . cara-harpist.co.uk/cgi-bin/musicSamples?baseBusiness=Cara-Harpist_Performers_Musical_Harpist_Bangor_County-Down_351045382618_BT20-5HA_Cara-Harpist_North-Down-Tourism_1_Performers_Christine-Evans

    bazz

  • #8
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    Oops, I forgot I've been spoofing my browser. I'll activate the domain and post again.

    bazz

  • #9
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    still can;t see what;s wrong and now the domain is active so you can see it work in IE but not in FF.

    http://www.cara-harpist.co.uk/cgi-bi...hristine-Evans

    Any tips greatly welcomed.

    bazz


  •  

    Posting Permissions

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