Replace url with video

HTML

<div id='player'></div>

JavaScript

var videoUrl = "https://www.youtube.com/watch?v=PFT3kXm7MGQ";
videoUrl = "https://vine.co/v/bjHh0zHdgZT";




videoUrl = videoUrl.replace(/(?:http:\/\/)?(?:https:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)/g, youEmbed).replace(/(?:http:\/\/)?(?:https:\/\/)(?:www\.)?(?:vimeo\.com)\/(.+)/g, vimeoEmbed).replace(/(?:http:\/\/)?(?:https:\/\/)?(?:www\.)?(?:vine\.co)\/?(.+)/g, vineEmbed);

console.log(videoUrl);
$('#player').html(videoUrl);