jQuery('.js-youtube-vid').on('paste', function () {
var newval = '';
$this = jQuery(this);
setTimeout(function(){
if (newval = $this.val().match(/(\?|&)v=([^&#]+)/)) {
$this.val(newval.pop());
} else if (newval = $this.val().match(/(\.be\/)+([^\/]+)/)) {
$this.val(newval.pop());
} else if (newval = $this.val().match(/(\embed\/)+([^\/]+)/)) {
$this.val(newval.pop().replace('?rel=0', ''));
}
}, 500);
});