实时音频源冻结在基于 Chromium 的浏览器中

问题描述 投票:0回答:1

This is how the audio element is shown. 与它互动没有任何作用。

(我在未谷歌搜索的 chromium 和 Edge 上尝试过,朋友在 Android 设备上尝试过,据说是默认的基于 chrome 的浏览器)

这是音频元素的 html

<div>
    <audio controls style="position: absolute; left: 50%; top: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);">
        <!-- Ogg Vorbis format -->
        <source src="http://192.168.50.15:36000/radiox.ogg?nocache=<?php echo time(); ?>" type="audio/ogg">
        
        <!-- Fallback MP3 format -->
        <source src="http://192.168.50.15:36001/radiox.mp3?nocache=<?php echo time(); ?>" type="audio/mpeg">

        Your browser does not support the audio element.
    </audio>
</div>

来源来自MPD,网页在firefox(手机和Windows)上运行良好

这最初只是 mp3 流,我尝试将默认编解码器更改为 ogg 并添加 mp3 后备。

html audio
1个回答
0
投票

事实证明这是源未加密的问题。我添加了一个 php 脚本来处理音频,而不是传递源 URL。现在效果很好。

© www.soinside.com 2019 - 2024. All rights reserved.