src/js/glightbox.js
function getYoutubeID(url) {
    let videoID = '';
    url = url.replace(/(>|<)/gi, '').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
    if (url[2] !== undefined) {
        videoID = url[2].split(/[^0-9a-z_\-]/i);
        videoID = videoID[0];
    } else {
        videoID = url;
    }
    return videoID;
}
function getYoutubeID(url) {
    let videoID = '';
    url = url.replace(/(>|<)/gi, '').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
    if (url[2] !== undefined) {
        videoID = url[2].split(/[^0-9a-z_\-]/i);
        videoID = videoID[0];
    } else {
        videoID = url;
    }
    return videoID;
}
function getYoutubeID ( url ) { let videoID = '' ; url = url . replace ( / (>|<) / gi , '' ) . split ( / (vi\/|v=|\/v\/|youtu\.be\/|\/embed\/) / ) ; if ( url [ 2 ] !== undefined ) { videoID = url [ 2 ] . split ( / [^0-9a-z_\-] / i ) ; videoID = videoID [ 0 ] ; } else { videoID = url ; } return videoID ; }
Get youtube ID

@param {string} url
@returns {string} video id
Get youtube ID