简体   繁体   English

HLs.js 口吃音频 stream 仅在 Safari

[英]HLs.js stuttering audio stream on Safari only

I am using Hls.js to stream live audio for radio, and it works well on chrome but the audio is stuttering on Safari only.我正在将 Hls.js 用于广播的 stream 实时音频,它在 chrome 上运行良好,但音频仅在 Safari 上卡顿。

Here is the code sandbox example(kindly, open with Safari): https://codesandbox.io/s/pensive-mendel-0xgecl?file=/src/App.tsx这是代码沙箱示例(请使用 Safari 打开): https://codesandbox.io/s/pensive-mendel-0xgecl?file=/src/App.tsx

Do I have to do anything special for it to work well on Safari?我是否必须做任何特别的事情才能让它在 Safari 上正常工作?

I have figured out that Safari has built-in HLS by default.我发现Safari默认内置了HLS。 So instead of using hls.js I am just checking if a browser has built-in one, if yes, i am just doing audio.src = mySrc otherwise use new Hls() of hls.js因此,我没有使用 hls.js,而是检查浏览器是否内置浏览器,如果是,我只是在做audio.src = mySrc否则使用 hls.js 的new Hls()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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