<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Embedded YouTube Video</title>
</head>
<body>
<!-- The div container for the YouTube player -->
<div id="player"></div>
<!-- Load the YouTube IFrame Player API -->
<script src="https://www.youtube.com/iframe_api"></script>
<script>
// This function creates an <iframe> (and YouTube player)
// after the API code downloads.
let player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '315',
width: '560',
videoId: 'nGeKSiCQkPw', // Replace with your video ID
playerVars: {
controls: 0, // Hide player controls
disablekb: 1, // Disable keyboard controls
modestbranding: 0, // Hide YouTube logo
fs: 0, // Disable fullscreen button
rel: 0, // Disable related videos at the end
showinfo: 0 // Hide video title and uploader information
},
events: {
'onReady': onPlayerReady
}
});
}
function onPlayerReady(event) {
// Do something when player is ready
}
</script>
</body>
</html>
Post a Comment