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.

2 responses to “Extract Youtube and Vimeo links from a string and embed as video”

  1. Tamer says:

    Hi,

    I was working on a script and it worked great for me. It was the exact thing that I needed. Thanks for sharing.

Leave a Reply