export default (function (url) {
  var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
  var match = url.match(regExp);
  var id = match && match[2].length === 11 ? match[2] : null;
  if (!id) return null;
  return "https://youtube.com/embed/".concat(id);
});