var point = url.indexOf("?v="); url = url.substring(point + 3, url.length); url = "http://www.youtube.com/embed/" + url;