From e821a307bf36b87c0de65d2e08a921366de3d130 Mon Sep 17 00:00:00 2001 From: kayrus Date: Mon, 29 Jun 2015 12:11:25 +0200 Subject: [PATCH] Added possibility to show youtube videos with "start position" option --- clientapp/libraries/jquery.oembed.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientapp/libraries/jquery.oembed.js b/clientapp/libraries/jquery.oembed.js index b6ddca8..07d36b8 100644 --- a/clientapp/libraries/jquery.oembed.js +++ b/clientapp/libraries/jquery.oembed.js @@ -549,8 +549,8 @@ $.fn.oembed.providers = [ //Video - new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+", "youtube.com/embed"], 'https://www.youtube.com/embed/$1?wmode=transparent', { - templateRegex: /.*(?:v\=|be\/|embed\/)([\w\-]+)&?.*/, embedtag: {tag: 'iframe', width: '425', height: '349'} + new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+", "youtube.com/embed"], 'https://www.youtube.com/embed/$1?wmode=transparent&start=$2', { + templateRegex: /.*(?:v\=|be\/|embed\/)([\w\-]+)(?:&|\?)?(?:t=([0-9]+))?.*/, embedtag: {tag: 'iframe', width: '425', height: '349'} }), //new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+"], 'http://www.youtube.com/oembed', {useYQL:'json'}),