import * as React from 'react'; import {VideoWebView} from './video-webview'; export const isYouTube = (url: string) => { return url.indexOf('youtube.com/') > -1; }; export const getYoutubeEmbed = (url: string) => { function getId(url: string) { const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/; const match = url.match(regExp); return match && match[2].length === 11 ? match[2] : null; } const videoId = getId(url); if (videoId) { const iframeMarkup = `