YouTube Video Player with Annotations
About this app
A simple web app to watch YouTube videos with annotations.
YouTube Video Player with Annotations Hooray for A!
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>YouTube Video Player with Annotations</title>
<meta name="description" content="A simple web app to watch YouTube videos with annotations.">
<meta name="keywords" content="YouTube, Video, Player, Annotations">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
try {
let videoURL = "https://www.youtube.com/embed/3guwWkqlaGc";
let annotationTime = 17; // in seconds
let annotationText = "Hooray for A!";
window.addEventListener("DOMContentLoaded", function() {
let player = document.querySelector("#player");
let annotation = document.querySelector("#annotation");
player.src = videoURL;
annotation.style.display = "none";
setInterval(function() {
if (player.currentTime >= annotationTime) {
annotation.style.display = "block";
} else {
annotation.style.display = "none";
}
}, 1000);
});
} catch (error) {
throw error;
}
</script>
<style>
#player {
width: 100%;
height: 360px;
}
#annotation {
position: absolute;
top: 10px;
left: 10px;
background-color: rgba(255,255,255,0.7);
padding: 10px;
border-radius: 10px;
font-size: 20px;
font-family: 'Comic Sans MS', cursive, sans-serif;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<iframe id="player" src="" frameborder="0" allowfullscreen></iframe>
<div id="annotation">Hooray for A!</div>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!