The html audio doesn't work on cellphone, Question |
The html audio doesn't work on cellphone, Question |
Alexf |
Aug 2 2020, 12:45 PM
Post
#1
|
Group: Members Posts: 2 Joined: 2-August 20 Member No.: 27,470 |
Hello. I have this html here to put audio on my website:
audio controls=""> <source src="put the link here" type="audio/mpeg"></source> O player de áudio não funciona neste navegador. Experimente abrir em outro...</audio><br /></div> It works perfectly on the computer, I can click and restart the audio, but when I try to hear the audio on my cellphone it just let me hear one time, I can't restart it. My question is: How can I fix this problem to hear how many times I want on the cellphone? |
miles_muso |
Jan 22 2021, 04:32 PM
Post
#2
|
Group: Members Posts: 2 Joined: 22-January 21 Member No.: 27,741 |
Hi,
I'm no expert, in fact I posted a question on here about 4 hours ago, but I was looking at HTML audio and MAYBE this is your solution: Some browsers, such as the one on your phone, don't like certain audio formats. I've read that you should give as many audio options as possible, so the browser can choose its preferred format. The code is this: CODE <audio controls="controls"> <source src="media/birds.mp3" type="audio/mpeg"> <source src="media/birds.ogg" type="audio/ogg"> <source src="media/birds.wav" type="audio/wav"> Your browser does not support the HTML5 Audio element. </audio> I think setting audio controls = "controls" means that a control bar will appear, which has play/stop/pause controls embedded. You'll need to duplicate your audio files in each format, and make sure they're all in the same folder on your server. As I said, I'm a newbie, and so I might have got this completely wrong. But there's no harm in trying!! There's also the option to set it as audio controls = "loop", which means the audio will loop automatically, which might be useful to you. I found all this at https://www.bitdegree.org/learn/html-audio-tag Hope it helps! This post has been edited by miles_muso: Jan 22 2021, 04:41 PM |
Lo-Fi Version | Time is now: 28th March 2024 - 04:09 PM |