Youtube Random Video With Cover Image
How do I make an youtube random video with cover image?
What is a youtube random video with cover image? How do you make a youtube random video with cover image? This script and codes were developed by Joo Vctor De Oliveira Santos on 17 September 2022, Saturday.
Youtube Random Video With Cover Image - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Youtube Random Video With Cover Image</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <!-- <ul class="videoList"> <li><a href="#" class="active" data-videoid="0">Cat Watching Horror Movie</a></li> <li><a href="#" data-videoid="1">The Ultimate Viral Cat Video</a></li> <li><a href="#" data-videoid="2">Cats Saying "No" to Bath - A Funny Cats In Water Compilation</a></li>
</ul> -->
<div class="video-container"> <div id="video-placeholder"></div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://www.youtube.com/iframe_api'></script> <script src="js/index.js"></script>
</body>
</html>
Youtube Random Video With Cover Image - Script Codes CSS Codes
.videoList a.active{ background-color: green; color: white;
}
.video-container{ position: relative; width: min-content; width: -moz-min-content; width: -webkit-min-content;
}
#imagemCover{ position: absolute; max-height: 400px; left: 50%; transform: translateX(-50%);
}
Youtube Random Video With Cover Image - Script Codes JS Codes
var videos = ["_kgRFHaNo-Y", "7WZPysRdP8A", "fzzjgBAaWZw"];
var player;
function onYouTubeIframeAPIReady() { player = new YT.Player('video-placeholder', { width: 600, height: 400, videoId: '_kgRFHaNo-Y', events: { onReady: initialize, onStateChange: verificaFim } });
}
function initialize(){ // Update the controls on load //updateTimerDisplay(); //updateProgressBar(); // Clear any old interval. //clearInterval(time_update_interval); // Start interval to update elapsed time display and // the elapsed part of the progress bar every second. // time_update_interval = setInterval(function () { // updateTimerDisplay(); // updateProgressBar(); // }, 1000)
}
function verificaFim(event) { if (event.data != YT.PlayerState.ENDED) { return; } mostrarImg();
}
function mostrarImg(){ $('.video-container').prepend('<img id="imagemCover" src="https://www.youtube.com/yts/img/yt_1200-vfl4C3T0K.png" />'); setTimeout(proximoVideo, 5000);
}
function proximoVideo(){ $("#imagemCover").remove(); var current = player.getVideoData()['video_id']; var nextVideo = -1; do{ nextVideo = Math.round(Math.random() * (videos.length - 1)); }while(videos[nextVideo] == current || !videos[nextVideo]); console.log(nextVideo, videos[nextVideo]); player.loadVideoById(videos[nextVideo]);
}
Developer | Joo Vctor De Oliveira Santos |
Username | jvhti |
Uploaded | September 17, 2022 |
Rating | 3 |
Size | 2,600 Kb |
Views | 28,336 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Testimonial Gallery | 3,887 Kb |
Random Quote Machine | 2,611 Kb |
Tic Tac Toe Game | 3,932 Kb |
Love Letter | 3,237 Kb |
Portfolio Flat | 3,642 Kb |
Local Weather | 2,478 Kb |
Pomodoro | 3,113 Kb |
Stylize Stories | 2,465 Kb |
Page Size Menu Example | 2,009 Kb |
Price Table | 2,460 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Mobile Nav Menu | AliKlein | 4,745 Kb |
CSS Gem Badge | Orchard | 3,335 Kb |
Eunice A | Ejbronze | 2,203 Kb |
Drawing a Terminal with CSS | Lachlanjc | 3,185 Kb |
TestTube CSS | EZPK | 2,710 Kb |
React Recipe Box | Krokodill | 5,347 Kb |
See Through | Larrygeams | 77,410 Kb |
Client-side Email Validation | Collizo4sky | 1,538 Kb |
Page Transitions in Backbone | Mikefowler | 3,691 Kb |
Slider for stackoverflow | KKOKU | 3,222 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!