HTML音频标签在Safari上不起作用,如何修复它。

huangapple go评论85阅读模式
英文:

HTML audio tag do not work on SAFARI how to fix it

问题

I try to stream audio from server http://185.34.28.166:8000/;stream.mp3
and when i play on Chrome or Mozilla it work good but when i play this audio on Safari i see loading circle and nothing play. I tried with all formats .mp3, .wav, also .ogg (i know that this format .ogg is not supported by safari). Below code and image how looks like not working audio in safari

<audio class="kopageAudio" controls="">
    <source src="http://185.34.28.166:8000/;stream.mp3" type="audio/mp3">
    <font style="vertical-align: inherit;">
        <font style="vertical-align: inherit;">Twoja przeglądarka nie obsługuje znacznika audio.
        </font>
    </font>
</audio>

HTML音频标签在Safari上不起作用,如何修复它。

I try all formats and many parameters in <audio> tag
I would like to correctly play stream in audio tag on website

英文:

I try to stream audio from server http://185.34.28.166:8000/;stream.mp3
and when i play on Chrome or Mozilla it work good but when i play this audio on Safari i see loading circle and nothing play. I tried with all formats .mp3, .wav, also .ogg (i know that this format .ogg is not supported by safari). Below code and image how looks like not working audio in safari

&lt;audio class=&quot;kopageAudio&quot; controls=&quot;&quot;&gt;
    &lt;source src=&quot;http://185.34.28.166:8000/;stream.mp3&quot; type=&quot;audio/mp3&quot;&gt;
    &lt;font style=&quot;vertical-align: inherit;&quot;&gt;
        &lt;font style=&quot;vertical-align: inherit;&quot;&gt;Twoja przeglądarka nie obsługuje znacznika audio.
        &lt;/font&gt;
    &lt;/font&gt;
&lt;/audio&gt;

HTML音频标签在Safari上不起作用,如何修复它。

I try all formats and many parameters in <audio> tag
I would like to correctly play stream in audio tag on website

答案1

得分: 1

您的源类型不正确。

应该是:

类型="音频/mpeg"

英文:

Your source is of the wrong type.

type=&quot;audio/mp3&quot;

It should be:

type=&quot;audio/mpeg&quot;

答案2

得分: 0

你试过按照这篇帖子上建议的方式设置属性 preload=&quot;none&quot; 吗?

https://stackoverflow.com/questions/48896656/mp3-with-audio-tag-does-not-work-in-safari

英文:

Did you try to set the attribute preload=&quot;none&quot; as suggested on this post?

https://stackoverflow.com/questions/48896656/mp3-with-audio-tag-does-not-work-in-safari

huangapple
  • 本文由 发表于 2023年5月6日 18:22:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76188365.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定