S
S
Svyatoslav Nemato2016-11-03 09:34:59
JavaScript
Svyatoslav Nemato, 2016-11-03 09:34:59

How to play notification ringtone in google browser on android?

Player code

<audio id="chatAudio">
  <source src="/sound/notice.m4a" type="audio/mpeg" />
  <source src="/sound/notice.ogg" type="audio/ogg" />
  <source src="/sound/notice.mp3" type="audio/mpeg" />
  <source src="/sound/notice.wav" type="audio/wav" />
</audio>

Ajax I check for new messages and if they appear, I launch the player like this: It works fine in all browsers, except for mobile chrome and safari. Studying the issue on the Internet showed that the whole thing is in the security settings of these browsers. Is there a solution for this situation?
$('#chatAudio')[0].play();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2016-11-03
@2ord

I would try creating symbolic links to these files in one of the user's directories.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question