no sound when we chat

336 views
Skip to first unread message

Dominique VARLET

unread,
Oct 21, 2017, 7:03:55 AM10/21/17
to AJAX-chat
hello,

since half 2017, we lost sound when we chat (punBB v0.8.6) 
It's OK with ie 11 , but not with chrome 61 or ff 56.0.1 ... perhaps because a restriction with flash plugin by google ?
do you have some ideas ?

Negative Edge

unread,
Oct 24, 2017, 9:15:41 AM10/24/17
to AJAX-chat
Because flash is no longer supported by todays browsers. 

You can get a plugin and activate it yourself, but other than that, by default, its depreciated

Bobby Russ

unread,
Oct 24, 2017, 8:17:36 PM10/24/17
to AJAX-chat
You'll need to update the code where the sound is played via flash to either accept both or just straight to HTML5 Sound.

I can't remember where I found the original information about it, but I do remember having to edit a few things in chat.js   Here are some examples are what I mean.  I'm running 0.8.8 for PHPBB3.1+ that's been modified to fix this issue.  I can't remember all the changes at the moment, but this might get you a start towards where you want to be:

        flashSounds: null,

        setAudioBackend: function(audioBackend) {
                this.setSetting('audioBackend', audioBackend);
                this.checkFlashSounds();
                if(this.flashSounds) {
                        this.loadFlashInterface();
                } else {
                        this.initializeHTML5Sounds();
                }
        },

        checkFlashSounds: function() {
                if(this.settings['audioBackend'] < 0) {
                        // autodetect if flash is supported, and default to flash.
                        if(navigator.appVersion.indexOf("MSIE") != -1) {
                                try {
                                        flash = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
                                } catch(e) {
                                        this.flashSounds = false;
                                }
                        } else if((navigator.plugins && !navigator.plugins["Shockwave Flash"]) || (navigator.mimeTypes &&
!navigator.mimeTypes['application/x-shockwave-flash'])) {
                                this.flashSounds = false;
                        }
                } else {
                        this.flashSounds = this.settings['audioBackend'] == 1;
                }
        },

        initializeHTML5Sounds: function() {
                var audio, mo3, ogg;
                try {
                        audio = document.createElement('audio');
                        mp3 = !!(audio.canPlayType && audio.canPlayType('audio/mpeg;').replace(/no/, ''));
                        ogg = !!(audio.canPlayType && audio.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, ''));
                        this.sounds = [];
                        if(mp3) {
                                format = ".mp3";
                        } else if(ogg) {
                                format = ".ogg";
                        } else {
                                format = ".wav";
                        }
                        for(var key in this.soundFiles) {
                                this.sounds[key] = new Audio(this.dirs['sounds']+key+format);
                        }
                        this.setAudioVolume(this.settings['audioVolume']);
                } catch(e) {
                        this.debugMessage('initializeHTML5Sounds', e);
                }
        },

        playSound: function(soundID) {
                if(this.sounds && this.sounds[soundID]) {
                        if(this.flashSounds) {
                                try {
                                        // play() parameters are
                                        // startTime:Number (default = 0),
                                        // loops:int (default = 0) and
                                        // sndTransform:SoundTransform  (default = null)
                                        return this.sounds[soundID].play(0, 0, this.soundTransform);
                                } catch(e) {
                                        this.debugMessage('playSound', e);
                                }
                        } else {
                                try {
                                        this.sounds[soundID].currentTime = 0;
                                        return this.sounds[soundID].play();
                                } catch(e) {
                                        this.debugMessage('playSound', e);
                                }
                        }
                }
                return null;
        },


On Tue, Oct 24, 2017 at 9:15 AM, Negative Edge <s...@clubsyn-x-treme.net> wrote:
Because flash is no longer supported by todays browsers. 

You can get a plugin and activate it yourself, but other than that, by default, its depreciated

--
You received this message because you are subscribed to the Google Groups "AJAX-chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----
"Dance as if no one were watching,
 Sing as if no one were listening,
 Live everyday as if it were your last,
 and love as if you've never been hurt."
 - Irish Proverb

Dominique VARLET

unread,
Oct 29, 2017, 9:03:34 AM10/29/17
to AJAX-chat
thank's Bobby :)

I paste kour code at the end of the chat.js file.
I have to suppress the function playsound already present.
and i add "this.setAudioBackend();" in the initialize function

It seems ok, I will try with other configs to confirm.

Bye
Domi

Lawrence Hunter

unread,
Dec 18, 2017, 6:55:41 PM12/18/17
to AJAX-chat
I am having this same problem.  Has anyone else found out what needs to be done in addition to adding this code to the chat.js file?  Just doing that alone doesn't seem to work.

THANKS!
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Lawrence Hunter

unread,
Dec 18, 2017, 6:55:54 PM12/18/17
to AJAX-chat

Bobby Russ

unread,
Dec 18, 2017, 7:15:12 PM12/18/17
to Lawrence Hunter, AJAX-chat
You might also need the mp3/sound files as well.  They can be found from: https://github.com/Frug/AJAX-Chat/tree/master/chat/sounds

I think there is also a version of 0.8.7 for punBB, but punBB support was changed to FlexBB for 0.8.8 by Frug.  I don't really use punBB, so while I wouldn't mind sharing my chat.js I can't guarantee that it would match up since I have 0.8.8 modified for phpBB 3.1+  With that said, I wouldn't mind sending you a copy and you can fiddle with it at your own risk.

--
You received this message because you are subscribed to the Google Groups "AJAX-chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Lawrence Hunter

unread,
Dec 18, 2017, 9:14:59 PM12/18/17
to AJAX-chat
thank you Bobby Russ !   I downloaded and used the .89 version from github, rather than .88 that my hosting provider Softlacious install provided, and now sound is working fine.  Thank you!


On Monday, December 18, 2017 at 7:15:12 PM UTC-5, Bobby Russ wrote:
You might also need the mp3/sound files as well.  They can be found from: https://github.com/Frug/AJAX-Chat/tree/master/chat/sounds

I think there is also a version of 0.8.7 for punBB, but punBB support was changed to FlexBB for 0.8.8 by Frug.  I don't really use punBB, so while I wouldn't mind sharing my chat.js I can't guarantee that it would match up since I have 0.8.8 modified for phpBB 3.1+  With that said, I wouldn't mind sending you a copy and you can fiddle with it at your own risk.
On Mon, Dec 18, 2017 at 6:55 PM, Lawrence Hunter <cice...@gmail.com> wrote:


On Sunday, October 29, 2017 at 9:03:34 AM UTC-4, Dominique VARLET wrote:
thank's Bobby :)

I paste kour code at the end of the chat.js file.
I have to suppress the function playsound already present.
and i add "this.setAudioBackend();" in the initialize function

It seems ok, I will try with other configs to confirm.

Bye
Domi

Le samedi 21 octobre 2017 13:03:55 UTC+2, Dominique VARLET a écrit :
hello,

since half 2017, we lost sound when we chat (punBB v0.8.6) 
It's OK with ie 11 , but not with chrome 61 or ff 56.0.1 ... perhaps because a restriction with flash plugin by google ?
do you have some ideas ?

--
You received this message because you are subscribed to the Google Groups "AJAX-chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Bobby Russ

unread,
Dec 18, 2017, 9:29:39 PM12/18/17
to Lawrence Hunter, AJAX-chat
Glad to hear

To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+unsubscribe@googlegroups.com.

Cuore di angelo

unread,
Feb 3, 2018, 4:51:08 AM2/3/18
to AJAX-chat
Not work for me ...
Reply all
Reply to author
Forward
0 new messages