Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

HTML - Embedded Media Player Query

  • 15-07-2007 09:41PM
    #1
    Registered Users, Registered Users 2 Posts: 2,930 ✭✭✭


    Hi,

    I have some code to run an mp3 in an embedded windows media player in a html page.

    When I open the page in IE, the media player displays and the file plays.
    However if I open the page in Firefox, the player displays fine but the audio clip will not play.
    It just shows the word "ready" under the player and if I press play nothing happens.

    I would appreciate it if anyone could double check my code and inform me where I am going wrong!
    <OBJECT id='mediaPlayer' width="320" height="45"
    classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95'
    codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112'
    standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
    								      
    <param name='fileName' value="Test.mp3">
    <param name='animationatStart' value='true'>
    <param name='transparentatStart' value='true'>
    <param name='autoStart' value="false">
    <param name='showControls' value="true">
    <param name='loop' value="true">
    
    <EMBED type='application/x-mplayer2'
    pluginspage='http://microsoft.com/windows/mediaplayer/ en/download/
    id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
    bgcolor='darkblue' showcontrols="true" showtracker='-1'
    showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="68"
    src="Test.mp3" autostart="true" designtimesp='5311' loop="true">
    </EMBED>
    </OBJECT>
    


Comments

  • Registered Users, Registered Users 2 Posts: 8,452 ✭✭✭Time Magazine


    <param name='autoStart' value="false"> sticks out like a sore thumb to me.


  • Registered Users, Registered Users 2 Posts: 15,079 ✭✭✭✭Malice


    I've had lots of fun with embedding media in web pages in the past :) Try this code, substituting "YOUR MP3 FILE" with the path to your MP3 file. It's from a site where video is being displayed through Windows Media Player so I'm sure some of the parameters don't apply. There's a link at the bottom in case you want to link to the file directly, ignore it if you don't.
    I've tested the code with IE6, Opera 9.21 and Firefox 2.0.0.4:

    [PHP]<OBJECT id='mediaPlayer' width="320" height="285"
    classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
    codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
    standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' VIEWASTEXT>
    <param name='fileName' value="YOUR MP3 FILE">
    <param name='animationatStart' value='true'>
    <param name='transparentatStart' value='true'>
    <param name='autoStart' value="0">
    <param name='showControls' value="true">
    <param name='loop' value="true">
    <EMBED type='application/x-mplayer2'
    pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
    id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
    bgcolor='darkblue' showcontrols="true" showtracker='-1'
    showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285"
    src="videos/test.mp3" autostart="0" designtimesp='5311' loop="true">
    </EMBED>
    </OBJECT>
    <a href="YOUR MP3 FILE">Launch in external player</a>[/PHP]
    I've also had issues with the autostart parameter. I have found that for maximum cross-browser compatibility, true and false need to be specified with 1 and 0.


Advertisement