how to add a youtube video in html
<!-- 1. Find a YouTube video and copy the embedded code
2. Set width and height -->
<iframe width="420" height="345"
src="https://www.youtube.com/embed/Ly0jsIg6mKs">
</iframe>
how to add a youtube video in html
<!-- 1. Find a YouTube video and copy the embedded code
2. Set width and height -->
<iframe width="420" height="345"
src="https://www.youtube.com/embed/Ly0jsIg6mKs">
</iframe>
HOW TO USE A video on a html website from youtube
<iframe width="560" height="315" src="https://www.youtube.com/embed/thatthingonvideourl" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
get youtube embed code from url
<----------------------------------- HTML ---------------------------------->
YouTube ID: <span id="myId"></span>
<br />
<br />
Embed code: <pre id="myCode"></pre>
function getId(url) {
var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
var match = url.match(regExp);
if (match && match[2].length == 11) {
return match[2];
} else {
return 'error';
}
}
<----------------------------------- JS ---------------------------------->
var myId = getId('http://www.youtube.com/watch?v=zbYf5_S7oJo');
$('#myId').html(myId);
$('#myCode').html('<iframe width="560" height="315" src="//www.youtube.com/embed/' + myId + '" frameborder="0" allowfullscreen></iframe>');
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us