Thread: Autostart with embed object
Results 1 to 3 of 3
Related
-
SuperCom Object Forum: Javascript Forum
Replies: 1 -
Text Object as date format Forum: Javascript Forum
Replies: 1 -
Change object tag content... Forum: Javascript Forum
Replies: 2 -
More then one fixed object. Forum: CSS Forum
Replies: 7
-
02-09-2007, 12:16 PM #1
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 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.
-
02-09-2007, 12:28 PM #2
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>
-
02-20-2007, 11:27 PM #3
Re: Autostart with embed object
I need help with this also thanks
Cloudjiffy- PaaS for Developers
10-05-2020, 12:30 AM in Web Hosting Forum