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

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