简体   繁体   中英

HTML5 audio player not autoplaying in ios safari

<audio controls autoplay>
  <source src="horse.ogg" type="audio/ogg">
</audio>

this audio is not getting autoplayed in IOS browsers. Even tried simulation of click. Still it's not working.

I'm using angular 7.

as far as I know, ogg format is not supported in Safari. See https://caniuse.com/#search=ogg

You could use an alternate format for your source audio, eg mp3 or wav.

<audio controls autoplay>
  <source src="horse.ogg" type="audio/ogg" />
  <source src="horse.mp3" type="audio/mpeg" />
</audio>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM