const youtubeUrlRegex = /^.*(youtu.be\/|youtube.com\/(v\/|watch\?v=|embed\/)|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
export const extractYoutubeId = (url) => {
    const match = url.match(youtubeUrlRegex);
    return match && match[3].length === 11 ? match[3] : '';
};
/**
 * Return Youtube embed URL.
 * @param  url link to youtube video.
 */
export const getYoutubeEmbedUrl = (url) => {
    return ('https://www.youtube.com/embed/' +
        extractYoutubeId(url) +
        '?rel=0&modestbranding=1&autohide=1&mute=1&showinfo=0&controls=1&autoplay=1');
};
//# sourceMappingURL=getYoutubeEmbedUrl.js.map