我的 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 關注
- 168 瀏覽
添加回答
舉報
0/150
提交
取消