Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get youtube id from url javascript

<script type="text/javascript">
function youtube_parser(url){
    var regExp = /^.*((youtu.be/)|(v/)|(/u/w/)|(embed/)|(watch?))??v?=?([^#&?]*).*/;
    var match = url.match(regExp);
    return (match&&match[7].length==11)? match[7] : false;
}
</script>
Source by # #
 
PREVIOUS NEXT
Tagged: #youtube #id #url #javascript
ADD COMMENT
Topic
Name
1+1 =