我的 YouTube 视频在 iframe 中完美,但没有声音。下面是我的代码。if (slideType === "youtube") { switch (control) { case "play": postMessageToPlayer(player, { "event": "command", "func": "mute" }); postMessageToPlayer(player, { "event": "command", "func": "playVideo" }); break; case "pause": postMessageToPlayer(player, { "event": "command", "func": "pauseVideo" }); break; } }// POST commands to YouTube APIfunction postMessageToPlayer(player, command){ if (player == null || command == null) return; player.contentWindow.postMessage(JSON.stringify(command), "*");}从上面的部分来看,如果我删除静音部分,视频将无法播放。如果我发送取消静音而不是静音,视频仍然无法播放。如何让正在播放的视频有声音?
- 2 回答
- 0 关注
- 111 浏览
添加回答
举报
0/150
提交
取消