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

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.
@@ -1564,6 +1564,44 @@
1564
1564
 
1565
1565
  base.bind(new Facebook());
1566
1566
 
1567
+ var combineParams$f = util.combineParams;
1568
+
1569
+ function Voomly() {
1570
+ this.provider = 'voomly';
1571
+ this.defaultFormat = 'long';
1572
+ this.formats = {
1573
+ long: this.createLongUrl,
1574
+ };
1575
+ this.mediaTypes = {
1576
+ VIDEO: 'video',
1577
+ };
1578
+ }
1579
+
1580
+ Voomly.prototype.parse = function(url, params) {
1581
+ var result = {
1582
+ mediaType: this.mediaTypes.VIDEO,
1583
+ params: params,
1584
+ id: this.parseUrl(url),
1585
+ };
1586
+ return result.id ? result : undefined;
1587
+ };
1588
+
1589
+ Voomly.prototype.createUrl = function(baseUrl, vi, params) {
1590
+ if (!vi.id || vi.mediaType !== this.mediaTypes.VIDEO) {
1591
+ return undefined;
1592
+ }
1593
+
1594
+ var url = baseUrl + vi.id;
1595
+ url += combineParams$f(params);
1596
+ return url;
1597
+ };
1598
+
1599
+ Voomly.prototype.createLongUrl = function(vi, params) {
1600
+ return this.createUrl('https://share.voomly.com/v/', vi, params);
1601
+ };
1602
+
1603
+ base.bind(new Voomly());
1604
+
1567
1605
  var lib = base;
1568
1606
 
1569
1607
  return lib;
package/lib/index.d.ts CHANGED
@@ -15,3 +15,4 @@ export * from './provider/youku';
15
15
  export * from './provider/youtube';
16
16
  export * from './provider/ted';
17
17
  export * from './provider/tiktok';
18
+ export * from './provider/voomly';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ormoshe/js-video-url-parser",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
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",