There is a feature of the Chatroom module that is not working. There is a 'Alert me if new messages are received.' checkbox but no sound plays even when it is checked.

The admin user sees the following error message:

soundManager.initComplete(): calling soundManager.onerror()
-- SoundManager 2 failed to load (security/load error) --
soundManager.disable(): Disabling all functions - future calls will return false.
soundManager: Failed to initialise.
soundManager: No Flash response within reasonable time after document load.
Possible causes: Flash version under 8, no support, or Flash security denying JS-Flash communication.
soundManager: Getting impatient, still waiting for Flash.. ;)
soundManager.beginDelayedInit(): Document loaded
soundManager._initMovie(): Waiting for ExternalInterface call from Flash..
soundManager._initMovie(): Got EMBED element (created via JS)
soundManager._createMovie(): Trying to load ./soundmanager2.swf
-- SoundManager 2 V2.76a.20080808 (AS2/Flash 8) --

This is drupal 6, and ChatRoom 1.0-beta2

We suspect there could be some kind of js conflict, but are having trouble chasing it down. Has anyone else run into this problem? We are using the admin menu module which has been known to cause some other js weirdness in our experience, though not in a while.

Comments

marioboy90’s picture

I have the same problem! Any advice?

marioboy90’s picture

I have the same problem. Any advice?

SuperContraXTC’s picture

Please help, I am having same issue

SuperContraXTC’s picture

Please help, I am having same issue,

Other related

http://drupal.org/node/359750

paku’s picture

The same here ...

Curugon’s picture

Same here! At the very least, I need to figure out how to stop the debug code from showing up to users.

pkej’s picture

At #6 I did a quick search and found that soundmanager2.js has a line (line number 25) saying

self._writeDebug('soundManager: Getting impatient, still waiting for Flash.. ;)');

Using that I identified all the other instances of self._writeDebug and I guess commenting out all of them is the quick and dirty way to get rid of the messages. I guess there is a way of turning debug on/off the line (line number 16with:

this.debugMode = true

seems a very likely candidate; you could try to just comment out that line first, and see. I'm sure it is there just for the beta release and is supposed to be turned off at a later time.

adam_b’s picture

Version: 6.x-1.0-beta2 » 6.x-1.0-beta3

subscribing & updating to beta3

Anonymous’s picture

Version: 6.x-1.0-beta3 » 6.x-1.0-beta4

please update to beta4 - it won't fix the sound issue, but it has a few more bug fixes.

adam_b’s picture

just did, thanks :)

Anonymous’s picture

i've committed a fix to turn off the debug, so update to the latest CVS to get that fix. i don't know anything about the soundManager code, so i'd love some help from anyone who was around when that got committed.

Anonymous’s picture

Title: "Alert Me" audio notifications not working - problem with soundManager » port sound notifications to jQuery plugin
Version: 6.x-1.0-beta4 » 6.x-2.x-dev
Assigned: Unassigned »
Category: bug » task

i'm going to port the sound stuff to use a jquery plugin, and just junk the old, broken stuff.

any volunteers to help with this?

pmagunia’s picture

I'm not sure this is the right place to post this info, but on my chatroom module I didnt see any code for sound so I tried tweaking it a bit. The version of chat room I am using is 2.7

After installing soundmanagerv295b-20100323, I successfully got sound with new messages. Sound Manager 2 is very picky about directories so I installed everything in the chat room directory. I added the following code to the end of the soundmanager2.js file:

soundManager.url = '/sites/all/modules/chatroom/swf'; // path to directory containing SoundManager2 .SWF file
soundManager.flashVersion = 8;
soundManager.useFlashBlock = false; // skip for now. See the flashblock demo when you want to start getting fancy.


soundManager.onload = function() {
  // soundManager.createSound() etc. may now be called
 // soundManager._writeDebug('soundManager.onload() - your code executes here');
soundManager.createSound('helloWorld','http://your-domain/sites/all/modules/chatroom/sound_1.mp3');
  soundManager.play('helloWorld');
}

In chatroom.module I added the following line around line 884 around in the vicinity of the other add_js command:

drupal_add_js(drupal_get_path('module', 'chatroom') . '/script/soundmanager2.js');

Note: sound manager directory contents, src, swf, demo, and script are located in the chatroom directory.

Also I replaced some code in chatroom.js with the added soundmanager lines:

$('#edit-chatroom-message-entry-submit').click(function (e) {
    e.preventDefault();
    e.stopPropagation();
    var messageText = $('#edit-chatroom-message-entry-box').val();
    if (messageText) {
      Drupal.chatroom.postMessage(messageText);
      $('#edit-chatroom-message-entry-box').val('').focus();
      soundManager.createSound('helloWorld2','http://your-domain/sites/all/modules/chatroom/sound_1.mp3');
      soundManager.play('helloWorld2');

      }
  });

This should give you sound with new messages when you click 'submit' not enter. Make sure you have sound_1.mp3 at the appropriate above directory and you include your own url. Also I think you can get rid of the initialization message by adding the code to the nodebug version of soundmanager2.js located in the scripts directory.

I tested this with IE7, IE8 and FF 3 on windows and mac and it works ok. To get a sound when you receive messages may take some additional tweaking.

I hope you are able to duplicate my success. Please let me know if any clarification is needed. Thanks

Anonymous’s picture

Assigned: » Unassigned