Answers for "how to play a youtube video by id javascript"

1

youtube embed video

//Author:Mohammad Arman Khan
<div>
       <iframe class="videoframe" src="https://www.youtube.com/watch?v=VfGW0Qiy2I0">
       </iframe>
</div>
Posted by: Guest on January-04-2021
0

get youtube video id from url javascript

// true when ID is found, false otherwise. 
//Extracts youtube ID
<script type="text/javascript">
function youtube_parser(url){
    var regExp = /^https?\:\/\/(?:www\.youtube(?:\-nocookie)?\.com\/|m\.youtube\.com\/|youtube\.com\/)?(?:ytscreeningroom\?vi?=|youtu\.be\/|vi?\/|user\/.+\/u\/\w{1,2}\/|embed\/|watch\?(?:.*\&)?vi?=|\&vi?=|\?(?:.*\&)?vi?=)([^#\&\?\n\/<>"']*)/i;
    var match = url.match(regExp);
    return (match && match[1].length==11)? match[1] : false;
}
</script>
Posted by: Guest on June-01-2020

Code answers related to "how to play a youtube video by id javascript"

Browse Popular Code Answers by Language