@stremio/stremio-video 0.0.71 → 0.0.73

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stremio/stremio-video",
3
- "version": "0.0.71",
3
+ "version": "0.0.73",
4
4
  "description": "Abstraction layer on top of different media players",
5
5
  "author": "Smart Code OOD",
6
6
  "main": "src/index.js",
@@ -12,6 +12,7 @@ var stremioToMPVProps = {
12
12
  'time': 'time-pos',
13
13
  'duration': 'duration',
14
14
  'buffering': 'buffering',
15
+ 'buffered': 'demuxer-cache-time',
15
16
  'volume': 'volume',
16
17
  'muted': 'mute',
17
18
  'playbackSpeed': 'speed',
@@ -73,6 +74,7 @@ function ShellVideo(options) {
73
74
 
74
75
  ipc.send('mpv-observe-prop', 'paused-for-cache');
75
76
  ipc.send('mpv-observe-prop', 'cache-buffering-state');
77
+ ipc.send('mpv-observe-prop', 'demuxer-cache-time');
76
78
 
77
79
  ipc.send('mpv-observe-prop', 'aid');
78
80
  ipc.send('mpv-observe-prop', 'vid');
@@ -177,6 +179,12 @@ function ShellVideo(options) {
177
179
  }
178
180
  break;
179
181
  }
182
+ case 'demuxer-cache-time': {
183
+ var cacheTime = args.data || 0;
184
+ props[args.name] = cacheTime > 0 ? Math.floor(cacheTime * 1000) : null;
185
+ onPropChanged('buffered');
186
+ break;
187
+ }
180
188
  case 'aid':
181
189
  case 'sid':
182
190
  case 'vid': {
@@ -397,6 +405,7 @@ function ShellVideo(options) {
397
405
  onPropChanged('time');
398
406
  onPropChanged('duration');
399
407
  onPropChanged('buffering');
408
+ onPropChanged('buffered');
400
409
  onPropChanged('muted');
401
410
  onPropChanged('subtitlesTracks');
402
411
  onPropChanged('selectedSubtitlesTrackId');
@@ -418,6 +427,7 @@ function ShellVideo(options) {
418
427
  subtitlesTracks: [],
419
428
  audioTracks: [],
420
429
  buffering: false,
430
+ buffered: null,
421
431
  aid: null,
422
432
  sid: null,
423
433
  };
@@ -429,6 +439,7 @@ function ShellVideo(options) {
429
439
  onPropChanged('time');
430
440
  onPropChanged('duration');
431
441
  onPropChanged('buffering');
442
+ onPropChanged('buffered');
432
443
  onPropChanged('muted');
433
444
  onPropChanged('subtitlesTracks');
434
445
  onPropChanged('selectedSubtitlesTrackId');
@@ -28,7 +28,9 @@ function createTorrent(streamingServerURL, infoHash, fileIdx, sources, seriesInf
28
28
 
29
29
  if (Array.isArray(sources) && sources.length > 0) {
30
30
  body.peerSearch = {
31
- sources: ['dht:' + infoHash].concat(sources).filter(function(source, index, sources) {
31
+ sources: ['dht:' + infoHash].concat(sources.map(function(source) {
32
+ return source.startsWith('tracker:') || source.startsWith('dht:') ? source : 'tracker:' + source;
33
+ })).filter(function(source, index, sources) {
32
34
  return sources.indexOf(source) === index;
33
35
  }),
34
36
  min: 40,