37 users online (1 members and 36 guests)  


  Results 1 to 3 of 3

Related

  1. SuperCom Object    Forum: Javascript Forum
    Replies: 1
  2. Text Object as date format    Forum: Javascript Forum
    Replies: 1
  3. Change object tag content...    Forum: Javascript Forum
    Replies: 2
  4. More then one fixed object.    Forum: CSS Forum
    Replies: 7
  1. #1
    Soujirou7's Avatar
    New User

    Status
    Offline
    Join Date
    Feb 2007
    Posts
    2

    Autostart with embed object

    Hi, I started a blogger account a month or so ago and lately I have tried to be a bit more creative with my posts. One of my recent posts includes an embed object linking to an mp3 that I have hosted on a server.

    The problem that I am having is that the file begins playing imediately as soon as the page loads. As that post is pushed down the page, it becomes less obvious where the music is comming from which is just irritating. Another problem is that the server hosting the file has bandwidth limits...I would prefer that the file is not called unless someone actually chooses to listen to it.

    The Code that used in my post:
    <embed type="application/x-mplayer2" src="http://h1.ripway.com/Soujirou7/mysong.mp3" autostart="false" loop="false" height="25" width="175"></embed>
    As you may notice, the autostart function is set to "false." This is what really puzzles me.

    As I was writing this, I realized that IE handles the object correctly. I use Firefox almost exclusively, so I didn't think of this at first...I am not as worried, but I would still like to know if there is some way to correct it for all browsers.

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: Autostart with embed object

    Browsers handle this in many different ways. You may want to try this javascript

    Code:
    <HTML><HEAD><TITLE>Your Title Here</TITLE> <SCRIPT language=JavaScript> <!-- function embPlayer() { // Get Operating System var isWin = navigator.userAgent.toLowerCase().indexOf("windows") != -1; if (isWin) { // Use MIME type application/x-mplayer2 visitorOS="Windows"; } else { // Use MIME type audio/mpeg, audio/x-wav, etc. visitorOS="Other"; } var objTypeTag = "application/x-mplayer2"; // MIME type for non-IE browsers on Windows if (visitorOS != "Windows") { objTypeTag = "audio/mpeg"}; // MIME type for Linux & Mac document.writeln("<object width='300' height='42'>"); document.writeln("<param name='type' value='" + objTypeTag + "'>"); document.writeln("<param name='src' value='SOMEMUSIC.MID'>"); document.writeln("<param name='autoplay' value='true'>"); document.writeln("<param name='autostart' value='0'>"); document.writeln("<param name='volume' value='-9'>"); document.writeln("<param name='controller' value='1'>"); document.writeln("<param name='PlayCount' value='2'>"); document.writeln("<EMBED src=mysong.mp3 type='" + objTypeTag + "' autoplay='false' autostart='-1' width=300 height=42 volume='-9' controller='1' PlayCount='7'></EMBED>"); document.writeln("</object>"); document.close(); // Finalize document } // --> </SCRIPT> <BODY> <IMG alt="" src="somepic.gif"><BR> <SCRIPT language=JavaScript> embPlayer(); </SCRIPT> <NOSCRIPT> <EMBED src=SOMEMUSIC.MID width=300 height=42 type=application/x-mplayer2 volume="-9" PlayCount="2" controller="true"></EMBED> </NOSCRIPT> </BODY> </HTML>
    with credit to http://www.webdeveloper.com/forum/history/topic.php/118340-1.html
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  3. #3
    Lankan's Avatar
    Disabled

    Status
    Offline
    Join Date
    Feb 2007
    Posts
    5

    Re: Autostart with embed object

    I need help with this also thanks



Tags for this Thread