var vimeoURL = "http://player.vimeo.com/video/35740045";
//organic url - https://vimeo.com/127677319
I have that organic URL, and I need to convert it to the vimeoURL format. E.g. I need it to be player.vimeo.com, not vimeo.com, and I need the /video/ after .com. Could someone help me out? Are there tools online for this to automate this / make it easy?
Ignore the different numbers for the video IDs. Not relevant.
Glad I could help. I was wondering if there might be an easier way via RegEx.
var organicURL = "https://vimeo.com/35740045";
var vimeoURL = organicURL.replace(/^(https?:\/\/)(vimeo.com\/)(\d+)$/,'$1player.$2video/$3');
alert(vimeoURL);
I tested this one. It works. And it keeps the protocol (http or https).
Well I didn’t try your most recent one, because the client decided he wanted something COMPLETELY DIFFERENT. So I wasted 3-4 hours . Thanks for your efforts though.