Found a neat way to manage simple video URLS all within a Craft template. If the client is submitting either Vimeo or Youtube URLS you can do this regex –


{% set id = entry.videoLink|replace('/(http:|https:|)\\/\\/(player.|www.)?(vimeo\\.com|youtu(be\\.com|\\.be|be\\.googleapis\\.com))\\/(video\\/|embed\\/|watch\\?v=|v\\/)?([A-Za-z0-9._%-]*)(\\&\\S+)?/', '$6') %}

{% set service = entry.videoLink|lower|replace('/(http:|https:|)\\/\\/(player.|www.)?(vimeo\\.com|youtu(be\\.com|\\.be|be\\.googleapis\\.com))\\/(video\\/|embed\\/|watch\\?v=|v\\/)?([A-Za-z0-9._%-]*)(\\&\\S+)?/', '$3') %}

{% if 'youtu' in service %}

<iframe src="http://www.youtube.com/embed/{{id}}?autoplay=1" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

{% else %}

<iframe src="http://player.vimeo.com/video/{{id}}?title=0&byline=0&portrait=0&color=00ab55&autoplay=1&loop=1" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

{% endif %}

Though i would share 😉