Skip to content

Commit

Permalink
Merge pull request #1889 from bebeeteam/patch/videos-regex
Browse files Browse the repository at this point in the history
Improve videos regex
  • Loading branch information
lqez committed May 12, 2016
2 parents 973a08f + 624fadd commit 971a060
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/bs3/module/VideoDialog.js
Expand Up @@ -44,13 +44,13 @@ define([
var ytRegExp = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
var ytMatch = url.match(ytRegExp);

var igRegExp = /\/\/instagram.com\/p\/(.[a-zA-Z0-9_-]*)/;
var igRegExp = /(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/;
var igMatch = url.match(igRegExp);

var vRegExp = /\/\/vine.co\/v\/(.[a-zA-Z0-9]*)/;
var vRegExp = /\/\/vine\.co\/v\/([a-zA-Z0-9]+)/;
var vMatch = url.match(vRegExp);

var vimRegExp = /\/\/(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/;
var vimRegExp = /\/\/(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/;
var vimMatch = url.match(vimRegExp);

var dmRegExp = /.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/;
Expand Down Expand Up @@ -78,7 +78,7 @@ define([
} else if (igMatch && igMatch[0].length) {
$video = $('<iframe>')
.attr('frameborder', 0)
.attr('src', igMatch[0] + '/embed/')
.attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')
.attr('width', '612').attr('height', '710')
.attr('scrolling', 'no')
.attr('allowtransparency', 'true');
Expand Down

0 comments on commit 971a060

Please sign in to comment.