Computing.Net > Forums > Web Development > Embedded sound loops in Firefox

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

Embedded sound loops in Firefox

Reply to Message Icon

Name: lucky1
Date: January 9, 2005 at 10:39:07 Pacific
OS: win98se
CPU/Ram: AMD 1.4 / 512
Comment:

Firefox will not "loop embedded sound" any help will be appreaciated.

I am using:

<embed src="celine.mp3" width="0" height="0" autostart="true" hidden="true" loop=2></embed>
<BGSOUND SRC=celine.mp3 LOOP=2>

Works fine in IE - -


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: Khalid
Date: January 10, 2005 at 12:56:56 Pacific
Reply:

The <embed>-tag has never been part of the standard HTML vocabulary. Instead, the HTML 4 specification recommends the <object> element as the one to load the kind of external data covered by the the embed element in some browsers.
This has resulted in a very poor support for the embed element in commmon and a very different type of interpretation of the element's attributes.

When you use the object element you can use the param-element (nested within the object element) to pass some parameters to the object, in your case an mp3-plugin. Most plugins will accept the 'loop' parameter.

Googling will come up with plenty of examples using the object-element.

The bgsound-element is only supported by Internet Explorer and has never been part of valid HTML either. If you are using this tag, I strongly recommend making the background sound a user-selectable choice that is turned off by default. In some environments, it can be very irritating to have background music or sounds unexpectedly come out of a computer. I usually close the browserswindow when that occurs, to never come back. ;-)

Good luck!


Report Offensive Follow Up For Removal

Response Number 2
Name: lucky1
Date: January 10, 2005 at 14:19:26 Pacific
Reply:

Hi Khalid,

I took your advise and this is what I am using.

<embed src="celine.mp3" width=50 height=15 autostart=true align=right repeat=true>

This seems to work Opera, FireFox and IE, and still allowing for replay.

My daughter's website:

http://www.claypenetration.com

Thanks a ton

lucky1


Report Offensive Follow Up For Removal

Response Number 3
Name: Khalid
Date: January 11, 2005 at 14:14:54 Pacific
Reply:

Great to hear your problems are solved! Not many people on this forum take the time to come back and share their solutions. You did, so many searching this forum or the net may find your solution usable and dont need to search further!


I still encourage you to write valid HTML code that is readable by many browsers on many different systems. The embed-element has never been part of the HTML specification and never will be.
Although your site may work properly in the browsers you mention at this time, because of the invalid code that isnt a guarantee your site will function correctly in the future.

Good luck!

writing a website is easy,
designing a website is a little harder,
designing a cross-browser website is much harder,
writing valid HTML-code is extreme tough...



Report Offensive Follow Up For Removal

Response Number 4
Name: DLJ
Date: January 19, 2005 at 23:39:26 Pacific
Reply:

Further to this question I am trying to get some video functionality working in Firefox. Particularly accessing the properties associated with an embedded mediaplayer object.

I have embedded the video using the "standard" code:

<OBJECT ID="objMediaPlayer" WIDTH=320 HEIGHT=240
CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">

<PARAM NAME="FileName" VALUE="video.mpg">
<EMBED TYPE="application/x-mplayer2"
SRC="video.mpg"
NAME="objMediaPlayer"
WIDTH=320
currentposition=30
HEIGHT=240>
</EMBED>
</OBJECT>
...

This plays video fine for both IE and Firefox. Now I need a button which jumps the video to 30seconds in when clicked.
...
<FORM>
<INPUT TYPE=BUTTON
NAME="ForwardButton"
VALUE="Jump"
ONCLICK="Jump(30)"/>
</FORM>

the javascript function jump() then accesses the mediaplayer object parameter CurrentPosition and sets it to 30.

from the (outdated) literature that I have found on the net, the IE code works and is simply:

...
objMediaPlayer.CurrentPosition = position;
....

and "supposedly" to access the Embed properties, for firefox, there are wrapper functions for each param:

...
document.objMediaPlayer.setCurrentPosition(position);
...

but this do not seem to work. And gives the error Error:

document.objMediaPlayer.SetCurrentPosition is not a function

Any ideas on how to access the properties on the "Embeded" mediaplayer that works in firefox.

cheers

Dan

the full source code is:

<html>
<head>
<title>Video Test</title>
<script language="javascript">
function Jump(position) {
if (navigator.userAgent.indexOf("IE") > -1) {
objMediaPlayer.CurrentPosition = position;
objMediaPlayer.Play();
} else {
alert (position);
document.objMediaPlayer.SetCurrentPosition(position);
}
}
</script>
</head>
<body>
<OBJECT ID="objMediaPlayer" WIDTH=320 HEIGHT=240
CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">

<PARAM NAME="FileName" VALUE="video.mpg">
<EMBED TYPE="application/x-mplayer2"
SRC="video.mpg"
NAME="objMediaPlayer"
WIDTH=320
currentposition=30
HEIGHT=240>
</EMBED>
</OBJECT>
<FORM>
<INPUT TYPE=BUTTON
NAME="ForwardButton"
VALUE="Jump"
ONCLICK="Jump(2)"/>
</FORM>
</body>
</html>


Report Offensive Follow Up For Removal

Response Number 5
Name: seanrutheford
Date: January 23, 2005 at 23:42:45 Pacific
Reply:

However helpfull any forum is to the questioner, none have been able to help me. i have code <embeded src="d:\music\ACDC_TNT.mp3" width="363" height="58" autostart="true" loop="false" volume="10"> for some reason it will work in IE but will not work in firefox. i have tried the code <embed src="d:\music\ACDC_TNT.mp3" width=50 height=15 autostart=true align=right repeat=true> that lucky1 posted earlier in this forum. i dont know why it works for lucky, but it doesnt work for me. any suggestions? i would prefer the code that wourld work. i am using macromedia's dreamweaver from the studio mx 2004 software. is there any possible solutions?


Report Offensive Follow Up For Removal

Related Posts

See More



Response Number 6
Name: Khalid
Date: January 23, 2005 at 23:51:05 Pacific
Reply:

1. If you have a new question, start a new thread. Although your question is very similar to the original poster of this thread, things get messed up if we all post different things in the same threads.

2. Read everything about object, embed, sound and mp3 things in this web development forum, particulary the 2nd post in this thread. By then you should know that the embed-element isnt supported by all browsers and isnt part of the HTML-syntax, and therefor is strongly depreciated to use in any code.

3. If you do decided to use the embed-element, and thus to write invalid, inproper code that will not last long, do remember to make use of the correct references to files on the internet, and not use local ones (you use d:/music/etc.. instead of an uri).


Report Offensive Follow Up For Removal

Response Number 7
Name: seanrutheford
Date: January 24, 2005 at 00:26:47 Pacific
Reply:

well, since i am using the macromedia studio mx software, i have to use local paths until i have the entire thing working. the studio software is nothing i would use unless forced to by my employer. i would not recommend using this software unless you are a beginner. and i have read all of the posts in this forum, the concept is pretty much the same, i understand that embeded code is pretty much crap for compatability and html, but this program sucks and is the only thing i can use. that is why i am asking if there is any SOLUTIONS to my problem not more complaints stating the obvious. if there is anybody with code or an instruction forum site to help me with my issue please post stuff with no complaints.


Report Offensive Follow Up For Removal
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Embedded sound loops in Firefox

youtube embedded video issue in IE www.computing.net/answers/webdevel/youtube-embedded-video-issue-in-ie-/3896.html

Blank Page in Firefox www.computing.net/answers/webdevel/blank-page-in-firefox/1984.html

code works in Firefox but not in IE www.computing.net/answers/webdevel/code-works-in-firefox-but-not-in-ie/2252.html