圍棋的YouTube視頻頁面,並記下從URL中視頻的ID。例如,如果YouTube視頻鏈接是http://youtube.com/watch?v=xyz-123,則視頻ID爲xyz-123。一旦你有了ID,你所要做的就是用下面的代碼將YOUR_VIDEO_ID替換爲該字符串。
<div id="muteYouTubeVideoPlayer"></div>
<script async src="https://www.youtube.com/iframe_api"></script>
<script>
function onYouTubeIframeAPIReady() {
var player;
player = new YT.Player('muteYouTubeVideoPlayer', {
videoId: 'YOUR_VIDEO_ID', // YouTube Video ID
width: 560, // Player width (in px)
height: 316, // Player height (in px)
playerVars: {
autoplay: 1, // Auto-play the video on load
controls: 1, // Show pause/play buttons in player
showinfo: 0, // Hide the video title
modestbranding: 1, // Hide the Youtube Logo
loop: 1, // Run the video in a loop
fs: 0, // Hide the full screen button
cc_load_policy: 0, // Hide closed captions
iv_load_policy: 3, // Hide the Video Annotations
autohide: 0 // Hide video controls when playing
},
events: {
onReady: function(e) {
e.target.mute();
}
}
});
}
https://stackoverflow.com/questions/24868226/how-do-you-mute-an-embedded-youtube-player – Goombah
https://stackoverflow.com/questions/35044594/youtube-how-到現在嵌入視頻與聲音靜音 – Goombah
https://stackoverflow.com/questions/8869372/how-do-i-automatically-play-a-youtube-video-iframe-api-muted – Goombah