YouTube에서 동영상을 퍼가려면이 스크립트가 있습니다. 동영상이 잘 재생되지만 동영상 응답 속도를 높이기 위해 너비를 %로 설정할 수 없습니다. 어떻게 할 수 있습니까? 내 내장 비디오가 응답하지 않는 이유는 무엇입니까?
<div class="video-container" id="VideoPlayer"></div>
<script async src="https://www.youtube.com/iframe_api"></script>
<script>
function onYouTubeIframeAPIReady() {
var player;
player = new YT.Player('VideoPlayer', {
videoId: 'yusGUGTVAyw', // YouTube Video ID
width: 560, // Player width (in px)
height: 400, // 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: 5, // 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();
}
}
});
}
</script>
이 CSS :
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden;
}
.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
그러나이 비디오는 응답되지 않습니다. CSS가 효과가없는 것 같아. 내가 뭘 잘못하고있는거야?