No notification sounds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • codeboy
    Senior Member
    • May 2018
    • 112

    No notification sounds

    Hello,
    I think notifications sound doesn't work properly, here is what I get from console Uncaught (in promise) DOMException This is from espo official demo page also same with my installation.
  • yuri
    Member
    • Mar 2014
    • 8845

    #2
    Hi,

    It's Chrome new behavior. It blocks sounds (which is a great idea). You can enable it in chrome settings.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Ashif Malayil
      Senior Member
      • Dec 2023
      • 201

      #3
      yuri I am using CRM in mobile browser is there any way to have a notification sound when a Lead assigned?

      Comment

      • a.slyzhko
        Senior Member
        • Oct 2023
        • 102

        #4
        I'm currently on the latest version 8.3.6 and I don't have notification sound even after sound permission was granted. I deep dive into views/notification/badge and found out that isFirstCheck that passed to popupNotificationView is always true, which causes below code never execute playSound function.
        PHP Code:
        onShow() {
            if (!
        this.options.isFirstCheck) {
                
        this.playSound();
            }
        }
        ​ 
        So I have removed condition check and also override playSound function as it caused error AbortError: The play() request was interrupted because the media was removed from the document.

        PHP Code:
        playSound() {
            if (
        this.notificationSoundsDisabled) {
                return;
            }
            
        let audio = new Audio(this.soundPath '.mp3');
            
        audio.volume 0.3;
            
        audio.play();
        }
        ​ 
        And finally get sound playing!

        Comment


        • ChrisSka83
          ChrisSka83 commented
          Editing a comment
          Hy and thank you for dealing with this topic.
          But where exactly do you change this?
          Maybe more users want to change it.
      • a.slyzhko
        Senior Member
        • Oct 2023
        • 102

        #5
        I'm developing custom popup notification. Just create custom view for it, extend from views/popup-notification and redefine corresponding functions

        Comment

        • Said
          Junior Member
          • Mar 2025
          • 1

          #6
          Hi sir,
          I removed condition string in onShow function, then had overridden playsound function as you described earlier, however nothing seems to change.
          The actual file resides in var/www/espocrm/data/espocrm/client/lib/original/espo-main.js
          What can I change, any recommendations? I would appreciate it!

          Originial file:
          playSound() {
          if (this.notificationSoundsDisabled) {
          return;
          }
          const audioElement = /** @type {HTMLAudioElement} */$('<audio>').attr('autoplay', 'autoplay').append($('<source>').attr('src', this.soundPath + '.mp3').attr('type', 'audio/mpeg')).append($('<source>').attr('src', this.soundPath + '.ogg').attr('type', 'audio/ogg')).append($('<embed>').attr('src', this.soundPath + '.mp3').attr('hidden', 'true').attr('autostart', 'true').attr('false', 'false')).get(0);
          audioElement.volume = 0.3;
          audioElement.play();
          }​
          ​​

          Comment

          Working...