@ormoshe/js-video-url-parser 0.5.2 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1577,11 +1577,18 @@
1577
1577
  };
1578
1578
  }
1579
1579
 
1580
+ Voomly.prototype.parseUrl = function(url) {
1581
+ var match = url.match(
1582
+ /(?:v|embed)\/([a-zA-Z\d]+)/i
1583
+ );
1584
+ return match ? match[1] : undefined;
1585
+ };
1586
+
1580
1587
  Voomly.prototype.parse = function(url, params) {
1581
1588
  var result = {
1582
1589
  mediaType: this.mediaTypes.VIDEO,
1583
1590
  params: params,
1584
- id: this.parseUrl(url),
1591
+ id: this.parseUrl(url)
1585
1592
  };
1586
1593
  return result.id ? result : undefined;
1587
1594
  };
@@ -24,7 +24,7 @@ Voomly.prototype.parse = function(url, params) {
24
24
  var result = {
25
25
  mediaType: this.mediaTypes.VIDEO,
26
26
  params: params,
27
- id: this.parseUrl(url),
27
+ id: this.parseUrl(url)
28
28
  };
29
29
  return result.id ? result : undefined;
30
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ormoshe/js-video-url-parser",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "A parser to extract provider, video id, starttime and others from YouTube, Vimeo, ... urls",
5
5
  "main": "lib/index.js",
6
6
  "browser": "dist/jsVideoUrlParser.js",