Play Sound When message received

前端 未结 4 1411
误落风尘
误落风尘 2020-12-07 06:30

I want to play sound when receiving message, so i searched it and found many solution but the simplest solution that i found is

  

        
4条回答
  •  天涯浪人
    2020-12-07 06:48

    Try this one, i think it is the simplest solution that anyone ever seen...:) you just do one thing that you should convert your beep.mp3 to beep.wav because some browsers dont understand mp3 so you should just convert it to wav and then use this only 3 lines of code

       
    

    this will play sound on when page is open/reload you can set it as you want, and one more thing js 1.6 or greater is required. hope this will solve your both problem.

提交回复
热议问题