Closed Thread Icon

Topic awaiting preservation: FireFox Javascript Problem (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24035" title="Pages that link to Topic awaiting preservation: FireFox Javascript Problem (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: FireFox Javascript Problem <span class="small">(Page 1 of 1)</span>\

 
Minh
Obsessive-Compulsive (I) Inmate

From:
Insane since: Nov 2004

posted posted 11-14-2004 17:28

I'm having some problem with FireFox, but it seems to work fine with IE.

code:
<SCRIPT LANGUAGE="JavaScript"><!--
function playmusic() { document.music.play(); }
function pausemusic() { document.music.pause(); }
function stopmusic() { document.music.stop(); }
//--></SCRIPT>



<input type=button value=\"Play\" onClick=\"playmusic()\" name=\"buttonstart\" />
<input type=button value=\"Pause\" onClick=\"pausemusic()\" name=\"buttonpause\" />
<input type=button value=\"Stop\" onClick=\"stopmusic()\" name=\"buttonstop\" />
<embed src=\"$musicurl\" autostart=\"true\" name=\"music\" hidden=\"true\" type=\"application/x-mplayer2\">
</embed>



The following code works in IE but not in FireFox however. One problem is that having hidden="true" some how doesn't make the file play in FireFox. Plus even if I don't have hidden="true" on the play, pause, and stop button still don't work. Here's the link to what I'm talking about http://www.piecesofme.frozendelusion.net
Thanks in advance.


Someone in another forum says it could be that FireFox doesn't support alot of Javascript. If so what code should I use for it to work in both browers. Thanks for helping.

liorean
Bipolar (III) Inmate

From: Umeå, Sweden
Insane since: Sep 2004

posted posted 11-14-2004 17:55

Firefox not supporting alot of JavaScript? Bullshit. Firefox has the best implementation of JavaScript around. I think the problem here might have one of three causes:

1. It's possible that no plugin for the 'application/x-mplayer2' media type is installed.
2. It's possible that the plugin for that media type is an ActiveX control and not a Netscape plugin architecture plugin. If this is the cause, the control is iew only. (The only ActiveX support Firefox has is Windows Media Player, and that support is flaky for WMP9. See http://plugindoc.mozdev.org/important.html#WMP)
3. It's possible that the plugin doesn't support XPConnect/LiveConnect and thus is unscriptable.

Just as a note, I have WMP9 installed and ie6w, op7.6 and moz all give the same error: document.music.play/pause/stop is not a function. It works in neither.



As for sound on the web, here's my experience:
- There in not a single case where I have found sound on the web that is not easily stoppable a good experience.
- Sound should not autostart at navigating to a web page. Users browsing on public computers, users that have sound already running, users that have more than one browser window/tab open ect. will not like it.
- The only realiable way of serving sound that works for nearly everybody is through the use of Flash.

--
var Liorean = {
prototype: JavaScriptGuru.prototype,
abode: "http://web-graphics.com/",
profile: "http://codingforums.com/member.php?u=5798"};

Minh
Obsessive-Compulsive (I) Inmate

From:
Insane since: Nov 2004

posted posted 11-14-2004 18:21

I don't really understand much about the plug in and all. Is there a way I can fix my code for it to work with both browser?

liorean
Bipolar (III) Inmate

From: Umeå, Sweden
Insane since: Sep 2004

posted posted 11-14-2004 20:13

Well, the thing is that you will not be able to make it work everywhere. Your best shot is to use Flash for sound, and it's still 75% of the global users only. (Macromedia Flash prevalence is 98% according to Macromedia. I don't believe that number, as other plugin prevalence researchers have found a prevalence somewhere in the 80% vincinity, of whom a notable 15% are still using Flash 5 or lower.)

--
var Liorean = {
prototype: XHTMLGuru.prototype,
abode: "http://web-graphics.com/",
profile: "http://codingforums.com/member.php?u=5798"};

« BackwardsOnwards »

Show Forum Drop Down Menu