You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Blazor Server项目中Audio标签iOS点击无声音,Android/Windows正常的问题求助

Blazor Server项目中Audio标签iOS点击无声音,Android/Windows正常的问题求助

大家好,我最近在做Blazor Server项目时碰到了一个头疼的问题:页面里的audio标签在Android手机和Windows电脑上点击都能正常播放声音,但到了iOS设备上,怎么点都没反应,完全不出声。

以下是我当前用到的相关代码片段:

@if (Question.Parcours.Type == Constants.TypeLanguage)
{
    <div class="d-flex flex-column align-items-start">
        @if (Question.AudioFilePath != null)
        {
            <audio class="m-1" controls>
                <source src="./@FolderAudioFile/@Question.AudioFilePath" type="audio/mp3">
                Votre navigateur ne supporte pas l'élément audio.
            </audio>
        }

        @if (Managing)
        {
            @if (recording)
            {
                <h2 class="m-1 alert-danger">En cours d'enregistrement...</h2>
                <button type="button" class="btn btn-secondary m-3" disabled="@DisableStopRecoredingBtn" @onclick="StopRecording">
                    停止录制
                </button>
            }
            // 剩余录制相关按钮代码未完全粘贴,核心播放逻辑就是上面的audio标签部分
        }
    </div>
}

我已经确认过音频文件的路径是正确的,其他设备都能正常加载并播放,唯独iOS设备点击播放按钮毫无动静,也没有任何报错提示。有没有大佬遇到过类似的情况?或者能给我一些排查的思路?

备注:内容来源于stack exchange,提问作者mathdxdx

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 11:23:02