My goal: I am trying to allow users to embed a link to a Youtube video in my site, while giving me control over the player’s settings.
I would like to do this by only asking the user to supply the link (not the entire embed code), from where I can somehow paste that link into the embed code.
I’ve tried doing a simple substitution with a few Youtube links (http://youtu.be/...) but they don’t work, saying ‘movie not loaded’. Is there a dependable way to do this?
I do this quite often for clients, the gist of it is that you parse out the ID from the URL, then generate the
iframeHTML using this.I put this in a helper. Change the height, width and options to taste.