Advertisement

YT embed

<meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <div id="youtube-container"></div>

    <script>
        function embedYouTubeVideo(videoId) {
            var iframe = document.createElement('iframe');
            iframe.width = '560';
            iframe.height = '315';
            iframe.src = `https://www.youtube.com/embed/${videoId}`;
            iframe.frameBorder = '0';
            iframe.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture';
            iframe.allowFullscreen = true;
            document.getElementById('youtube-container').appendChild(iframe);
        }

        // Call the function with the YouTube video ID
        embedYouTubeVideo('');  // Replace with your video ID

Post a Comment

0 Comments