@ormoshe/js-video-url-parser 0.5.8 → 0.5.10

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.
@@ -1712,14 +1712,11 @@
1712
1712
  }
1713
1713
 
1714
1714
  Canva.prototype.parse = function(url, params) {
1715
- var match = url.match(
1716
- /(?:design)\/([a-zA-Z\d]+)\/([\w-]+)/i
1717
- );
1715
+ var match = url.match(/\/design\/([\w-]+)/);
1718
1716
  var result = {
1719
1717
  mediaType: this.mediaTypes.VIDEO,
1720
1718
  params: params,
1721
- library: match[1],
1722
- id: match[2]
1719
+ id: match[1]
1723
1720
  };
1724
1721
  return result.id ? result : undefined;
1725
1722
  };
@@ -1729,7 +1726,7 @@
1729
1726
  return undefined;
1730
1727
  }
1731
1728
 
1732
- var url = baseUrl + vi.library + '/' + vi.id + '/watch?embed';
1729
+ var url = baseUrl + vi.id + '/watch?embed';
1733
1730
  url += combineParams$i(params);
1734
1731
  return url;
1735
1732
  };
@@ -14,14 +14,11 @@ function Canva() {
14
14
  module.exports = Canva;
15
15
 
16
16
  Canva.prototype.parse = function(url, params) {
17
- var match = url.match(
18
- /(?:design)\/([a-zA-Z\d]+)\/([\w-]+)/i
19
- );
17
+ var match = url.match(/\/design\/([\w-]+)/);
20
18
  var result = {
21
19
  mediaType: this.mediaTypes.VIDEO,
22
20
  params: params,
23
- library: match[1],
24
- id: match[2]
21
+ id: match[1]
25
22
  };
26
23
  return result.id ? result : undefined;
27
24
  };
@@ -31,7 +28,7 @@ Canva.prototype.createUrl = function(baseUrl, vi, params) {
31
28
  return undefined;
32
29
  }
33
30
 
34
- var url = baseUrl + vi.library + '/' + vi.id + '/watch?embed';
31
+ var url = baseUrl + vi.id + '/watch?embed';
35
32
  url += combineParams(params);
36
33
  return url;
37
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ormoshe/js-video-url-parser",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
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",