如何在https中发出http请求
我需要在我的网站中使用 https 请求运行 http 请求。
此代码在我的网站中使用 http: 例如 http://mywebsite.com 播放,但不要在 https 中播放:例如https://mywebsite.com。
<audio id="stream" controls preload="none" autoplay style="width: 400px;">
<source src="http://185.88.177.45:9948/;" type="audio/mpeg">
</audio>
<script>
var audio = document.getElementById('stream');
audio.volume = 0.5;
</script>
如何在 https 网站上玩?
I need run http request in my website with https request.
This code play in my website with http: for example http://mywebsite.com but dont play in https: for example https://mywebsite.com.
<audio id="stream" controls preload="none" autoplay style="width: 400px;">
<source src="http://185.88.177.45:9948/;" type="audio/mpeg">
</audio>
<script>
var audio = document.getElementById('stream');
audio.volume = 0.5;
</script>
How to play in https webiste?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(1)
不幸的是,浏览器策略规定,如果您对页面使用 HTTPS,则必须对音频流使用 HTTPS。
SHOUTcast 的较旧版本和免费版本不支持 HTTPS。 Icecast 可以,并且可以直接替代您。
Unfortunately, browser policy dictates that you must use HTTPS for your audio stream if you're using HTTPS for the page.
Older and free builds of SHOUTcast do not support HTTPS. Icecast does, and can be a drop-in replacement for you.