#36 ✓resolved
klikhier

Fix Sound.js

Reported by klikhier | July 4th, 2008 @ 09:55 AM

When I use the StopSound() function below in Firefox 3 to stop the sound, the sound does stop, but also Firefox provides me with the following message: "Additional plugins are required to play all the media on this page". When using the 'Install missing plugins' button, the plugins cannot be found. This worked before in Firefox 2 and it also works perfectly in other Browsers. Btw: I'm on OS X Leopard.

function PlaySound() {

Sound.enable();

Sound.play('sound.mp3');

}

function StopSound() {

Sound.play('',{replace:true});

Sound.disable();

}

Comments and changes to this ticket

  • Alexander Gavazov
  • Padde

    Padde September 16th, 2008 @ 10:45 AM

    • Tag changed from firefox 3, sound, sound.js to firefox 3, sound, sound.js

    I stumbled upon the same problem and tried to fix it with your additional code, but it still doesnt work with Firefox 3.0.1 under Mac OS X 10.5.4.

    I even experienced further problems: not only that firefox wants do download a plugin, but also there is some strange-looking white thingy with something like a little blue dot on it appearing below my stop-button (see attachment for screenshot). Do you have any idea what this could be and how to prevent firefox at least from showing this ugly thing?

    It's obviously not only a Quicktime problem, because naturally i, as a Mac user, have QT installed and updated to the newest version.

    Has anyone got ideas what could cause this bug?

    I would appreciate it if 'klikhier' could tell us if it worked for him as he is using firefox 3 on OS X Leopard, too - or if he figured out another solution for this problem

  • klikhier

    klikhier September 16th, 2008 @ 12:45 PM

    I have not tried the bugfix, but I presume the suggested solution would not fix my solution anyways (as Quicktime is obviously installed on OS X). Have moved to Soundmanager 2 from Scot Schiller.

  • Padde

    Padde September 16th, 2008 @ 07:22 PM

    Firebug says, the weird white thing belongs to the following markup:

    @@@@@@

    do you see anything that doesn't belong there?

    seems as if this was a bug in firefox 3, not in script.aculo.us. imho firefox 3 just can't handle/hide @@@@@@-objects with empty @@@src=""@@@ attribute.

    there aren't any @@@@@@-artifacts appearing in the official demo (http://github.com/madrobby/scrip... - although firefox asks me to download a plugin. perhaps the artifacts appear for other reasons in my project!?

    well, you could hack this by switching to an empty mp3-file, but thats not the solution, of course...

    here is the full markup of my cute little player, it's just a little speaker and when you click it, the music switches off and the symbol changes to a struck out speaker. clicking again does the opposite. works well in most browsers. just in case someone should find something in here that causes the white thing

    JavaScript

    
    function playMusic(url)
    {
    	// Enable Sound, Play "url"
    	Sound.enable();
    	Sound.play(url,{replace:true});
    
    	// Show "is playing / mute" Button
    	document.getElementById('soundoff').style.display = "none";
    	document.getElementById('soundon').style.display = "block";
    }
    
    function stopMusic(url)
    {
    	// Play nothing, Disable Sound
    	Sound.play('',{replace:true});
    	Sound.disable();
    
    	// Show "is muted / play" Button
    	document.getElementById('soundon').style.display = "none";
    	document.getElementById('soundoff').style.display = "block";
    }
    

    HTML

    
    <a href="#" onclick="stopMusic();">
    	<img src="img/sound_on.jpg" id="soundon" style="display:inline;"/>
    </a>
    
    <a href="#" onclick="playMusic('song.mp3');">
    	<img src="img/sound_off.jpg" id="soundoff" style="display:none;"/>
    </a>
    
  • Padde

    Padde September 16th, 2008 @ 07:28 PM

    Sorry for the double post, i made some mistakes in the formatting...

    Firebug says, the weird white thing belongs to the following markup:

    
    <embed id="sound_global_0" style="height: 0pt;" hidden="true" autostart="true" loop="true" src=""/>
    

    do you see anything that doesn't belong there?

    seems as if this was a bug in firefox 3, not in script.aculo.us. imho firefox 3 just can't handle/hide -objects with empty src attribute.

    there aren't any -artifacts appearing in the official demo (http://github.com/madrobby/scrip... - although firefox asks me to download a plugin. perhaps the artifacts appear for other reasons in my project!?

    well, you could hack this by switching to an empty mp3-file, but thats not the solution, of course...

    here is the full markup of my cute little player, it's just a little speaker and when you click it, the music switches off and the symbol changes to a struck out speaker. clicking again does the opposite. works well in most browsers. just in case someone should find something in here that causes the white thing JavaScript

    function playMusic(url) {

    // Enable Sound, Play "url"
    Sound.enable();
    Sound.play(url,{replace:true});
    
    // Show "is playing / mute" Button
    document.getElementById('soundoff').style.display = "none";
    document.getElementById('soundon').style.display = "block";
    
    

    }

    function stopMusic(url) {

    // Play nothing, Disable Sound
    Sound.play('',{replace:true});
    Sound.disable();
    
    // Show "is muted / play" Button
    document.getElementById('soundon').style.display = "none";
    document.getElementById('soundoff').style.display = "block";
    
    

    }

    HTML

    
    <a href="#" onclick="stopMusic();">
    	<img src="img/sound_on.jpg" id="soundon" style="display:inline;"/>
    </a>
    
    <a href="#" onclick="playMusic('song.mp3');">
    	<img src="img/sound_off.jpg" id="soundoff" style="display:none;"/>
    </a>
    
  • Padde

    Padde September 16th, 2008 @ 07:42 PM

    oh and again, i think i should stop using this high-tech stuff :D

    i figured out that...

    @@@

    
    
    ... would work instead of ...
    
    @@@<embed id="sound_global_0" style="**height: 0pt;**" hidden="true" autostart="true" loop="true" src=""/>
    

    ... so that you should only have to edit line 14 in sound.js from

    @@@new Template(''), ...

    
    to
    @@@new Template('<embed style="display:none" id="sound_#{track}_#{id}" src="#{url}" loop="true" autostart="true" hidden="true"/>'),
    

    this works well for removing the artifacts but also disables the sound functionality (doesn't play anything after modification)

    btw: the blue stuff in the white thing is just an part of the standard firefox plugin icon

  • Padde

    Padde September 16th, 2008 @ 07:44 PM

    ok this formatting stuff really isnt made for me, here with correct formatting, i hope, sorry again:

    i figured out that...

    @@@

    
    
    ... would work instead of ...
    
    @@@<embed id="sound_global_0" style="height: 0pt;" hidden="true" autostart="true" loop="true" src=""/>
    

    ... so that you should only have to edit line 14 in sound.js from

    @@@new Template(''), ...

    
    to
    @@@new Template('<embed style="display:none" id="sound_#{track}_#{id}" src="#{url}" loop="true" autostart="true" hidden="true"/>'),
    

    this works well for removing the artifacts but also disables the sound functionality (doesn't play anything after modification)

    btw: the blue stuff in the white thing is just an part of the standard firefox plugin icon

  • Padde

    Padde September 16th, 2008 @ 07:49 PM

    man, this really freaks me out... could possibly someone delete all that crap on top of this post? thanks.

    oh and again, i think i should stop using this high-tech stuff :D

    i figured out that...

    
    <embed id="sound_global_0" style="**display:none**" hidden="true" autostart="true" loop="true" src=""/>
    

    ... would work instead of ...

    
    <embed id="sound_global_0" style="**height: 0pt;**" hidden="true" autostart="true" loop="true" src=""/>
    

    ... so that you should only have to edit line 14 in sound.js from

    
    new Template('<embed style="height:0" id="sound_#{track}_#{id}" src="#{url}" loop="true" autostart="true" hidden="true"/>'),
    

    to

    
    new Template('<embed style="display:none" id="sound_#{track}_#{id}" src="#{url}" loop="true" autostart="true" hidden="true"/>'),
    

    this works well for removing the artifacts but also disables the sound functionality (doesn't play anything at all, after modification)

    btw: the blue stuff in the white thing is just an part of the standard firefox plugin icon

  • Alexander Gavazov

    Alexander Gavazov October 10th, 2008 @ 09:40 AM

    • Title changed from “Sound.js problem in Firefox 3” to “Fix Sound.js”

    Hi, I have fix for the problem. See http://studio.bg/sound_problem_s...

  • ronin-15560 (at lighthouseapp)

    ronin-15560 (at lighthouseapp) November 20th, 2008 @ 04:23 PM

    • State changed from “new” to “resolved”

    Please see #86.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

script.aculo.us is an open-source JavaScript framework for visual effects and interface behaviours.
<br/><b>Source available from github</b>
The Git repository resides at:
<a href="http://github.com/madrobby/scriptaculous">http://github.com/madrobby/scriptaculous</a>
<br/>Check out the current development trunk with:
<code>git clone git://github.com/madrobby/scriptaculous.git</code>
<br/>As <b>script.aculo.us 1.xx is feature-frozen</b>, this development trunk is for <b>bugfixes only</b>.
<br/>New development should happen only for
<b>script.aculo.us 2</b>.
<br/><b>Creating a bug report</b>
When creating a bug report, be sure to include as much relevant information as possible. Post a an example that shows off the problem. Preferably, <b>alter the unit tests</b> and show through either changed or added tests how the expected behavior is not occuring.

People watching this ticket

Attachments

Pages