@stremio/stremio-video 0.0.51 → 0.0.52

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.51",
3
+ "version": "0.0.52",
4
4
  "description": "Abstraction layer on top of different media players",
5
5
  "author": "Smart Code OOD",
6
6
  "main": "src/index.js",
@@ -20,6 +20,8 @@ var stremioToMPVProps = {
20
20
  'subtitlesTracks': 'subtitlesTracks',
21
21
  'selectedSubtitlesTrackId': 'sid',
22
22
  'subtitlesSize': 'sub-scale',
23
+ 'subtitlesOffset': 'sub-pos',
24
+ 'subtitlesDelay': 'sub-delay',
23
25
  'subtitlesTextColor': 'sub-color',
24
26
  'subtitlesBackgroundColor': 'sub-back-color',
25
27
  'subtitlesOutlineColor': 'sub-border-color',
@@ -77,6 +79,7 @@ function ShellVideo(options) {
77
79
  ipc.send('mpv-observe-prop', 'sid');
78
80
  ipc.send('mpv-observe-prop', 'sub-scale');
79
81
  ipc.send('mpv-observe-prop', 'sub-pos');
82
+ ipc.send('mpv-observe-prop', 'sub-delay');
80
83
  ipc.send('mpv-observe-prop', 'speed');
81
84
 
82
85
  ipc.send('mpv-observe-prop', 'mpv-version');
@@ -122,7 +125,6 @@ function ShellVideo(options) {
122
125
  break;
123
126
  }
124
127
  case 'duration': {
125
- setBackground(false);
126
128
  var intDuration = args.data | 0;
127
129
  // Accumulate average duration over time. if it is greater than minClipDuration
128
130
  // and equal to the currently reported duration, it is returned as video length.
@@ -137,7 +139,10 @@ function ShellVideo(options) {
137
139
  // which is around 34 years of playback time.
138
140
  avgDuration = avgDuration ? (avgDuration + intDuration) >> 1 : intDuration;
139
141
  props.loaded = intDuration > 0;
140
- if(props.loaded) onPropChanged('loaded');
142
+ if(props.loaded) {
143
+ setBackground(false);
144
+ onPropChanged('loaded');
145
+ }
141
146
  break;
142
147
  }
143
148
  case 'time-pos': {
@@ -148,6 +153,14 @@ function ShellVideo(options) {
148
153
  props[args.name] = Math.round(args.data / SUBS_SCALE_FACTOR);
149
154
  break;
150
155
  }
156
+ case 'sub-pos': {
157
+ props[args.name] = 100 - args.data;
158
+ break;
159
+ }
160
+ case 'sub-delay': {
161
+ props[args.name] = Math.round(args.data*1000);
162
+ break;
163
+ }
151
164
  case 'paused-for-cache':
152
165
  case 'seeking':
153
166
  {
@@ -304,10 +317,14 @@ function ShellVideo(options) {
304
317
  ipc.send('mpv-set-prop', [stremioToMPVProps[propName], propValue * SUBS_SCALE_FACTOR]);
305
318
  break;
306
319
  }
307
- case 'subtitlesOffset': {
320
+ case 'subtitlesDelay': {
308
321
  ipc.send('mpv-set-prop', [stremioToMPVProps[propName], propValue]);
309
322
  break;
310
323
  }
324
+ case 'subtitlesOffset': {
325
+ ipc.send('mpv-set-prop', [stremioToMPVProps[propName], 100 - propValue]);
326
+ break;
327
+ }
311
328
  case 'subtitlesTextColor':
312
329
  case 'subtitlesBackgroundColor':
313
330
  case 'subtitlesOutlineColor':
@@ -342,7 +359,7 @@ function ShellVideo(options) {
342
359
  var separateWindow = options.mpvSeparateWindow ? 'yes' : 'no';
343
360
  ipc.send('mpv-set-prop', ['vo', videoOutput]);
344
361
  ipc.send('mpv-set-prop', ['osc', separateWindow]);
345
- ipc.send('mpv-set-prop', ['input-defalt-bindings', separateWindow]);
362
+ ipc.send('mpv-set-prop', ['input-default-bindings', separateWindow]);
346
363
  ipc.send('mpv-set-prop', ['input-vo-keyboard', separateWindow]);
347
364
 
348
365
  var startAt = Math.floor(parseInt(commandArgs.time, 10) / 1000) || 0;