0

I am using audio tag. This works chrome, edge and ie. But doesn't work on android browser. what should I do?

document.getElementById('my_audio').play();
<audio id="my_audio" src="pages/alert.mp3">
Daweed
  • 1,419
  • 1
  • 9
  • 24
zey
  • 177
  • 2
  • 15
  • Always first check compatibility. What version of browser you use? https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#browser_compatibility – Justinas Mar 04 '21 at 07:24
  • I am using Samsung internet v13.0.2.9. I see it supports audio tag. – zey Mar 04 '21 at 07:41
  • Is your source downloaded? – Justinas Mar 04 '21 at 07:43
  • I can listen to the file when I view it with view-resurce. – zey Mar 04 '21 at 07:54
  • Does this answer your question? [HTML5 audio tag is not working in Android](https://stackoverflow.com/questions/12142084/html5-audio-tag-is-not-working-in-android) – Justinas Mar 04 '21 at 07:59
  • Similar question but dont answer for me. I try all answer – zey Mar 04 '21 at 08:15
  • Try with ` – Justinas Mar 04 '21 at 08:34
  • sorry, I tried but it doesn't work. – zey Mar 04 '21 at 08:43
  • 1
    Not enough code to recreate or understand your problem. Is your `.play();` command inside some function or it just runs when ` – VC.One Mar 05 '21 at 21:13

0 Answers0