Extract Youtube and Vimeo links from a string and embed as video
This script does exactly what it says on the tin. Sometimes it’s not possible to get content delivered in the way you want. Here we’re dealing with a single string outputted from something like a database. My script matches Youtube and Vimeo links, strips them from the original string and then embeds them as a video. I haven’t written the code to embed Vimeo videos but I’m sure you can work that out.