@stremio/stremio-video 0.0.75 → 0.0.76

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.75",
3
+ "version": "0.0.76",
4
4
  "description": "Abstraction layer on top of different media players",
5
5
  "author": "Smart Code OOD",
6
6
  "main": "src/index.js",
@@ -26,6 +26,7 @@ var stremioToMPVProps = {
26
26
  'subtitlesTextColor': 'sub-color',
27
27
  'subtitlesBackgroundColor': 'sub-back-color',
28
28
  'subtitlesOutlineColor': 'sub-border-color',
29
+ 'hdrInfo': null,
29
30
  };
30
31
 
31
32
  function parseVersion(version) {
@@ -191,6 +192,23 @@ function ShellVideo(options) {
191
192
  props[args.name] = embeddedProp(args);
192
193
  break;
193
194
  }
195
+ case 'video-params': {
196
+ props[args.name] = args.data;
197
+ var params = args.data || {};
198
+ var gamma = typeof params.gamma === 'string' ? params.gamma : null;
199
+ if (gamma === 'pq' || gamma === 'hlg') {
200
+ props.hdrInfo = {
201
+ gamma: gamma,
202
+ primaries: typeof params.primaries === 'string' ? params.primaries : null,
203
+ maxCll: typeof params['max-cll'] === 'number' ? params['max-cll'] : null,
204
+ maxLuma: typeof params['max-luma'] === 'number' ? params['max-luma'] : null,
205
+ };
206
+ } else {
207
+ props.hdrInfo = null;
208
+ }
209
+ onPropChanged('hdrInfo');
210
+ break;
211
+ }
194
212
  // In that case onPropChanged() is manually invoked as track-list contains all
195
213
  // the tracks but we have different event for each track type
196
214
  case 'track-list': {
@@ -243,6 +261,7 @@ function ShellVideo(options) {
243
261
  });
244
262
 
245
263
  function getProp(propName) {
264
+ if (propName === 'hdrInfo') return props.hdrInfo || null;
246
265
  if(stremioToMPVProps[propName]) return props[stremioToMPVProps[propName]];
247
266
  // eslint-disable-next-line no-console
248
267
  console.log('Unsupported prop requested', propName);
@@ -371,9 +390,14 @@ function ShellVideo(options) {
371
390
  var hwdecValue = commandArgs.hardwareDecoding ? 'auto-copy' : 'no';
372
391
  ipc.send('mpv-set-prop', ['hwdec', hwdecValue]);
373
392
 
374
- // Video mode
375
- var videoOutput = commandArgs.platform === 'windows' ? (commandArgs.videoMode === null ? 'gpu-next' : 'gpu') : 'libmpv';
376
- ipc.send('mpv-set-prop', ['vo', videoOutput]);
393
+ // On macOS the shell manages vo and HDR/EDR configuration
394
+ // directly do not override vo here.
395
+ var platformLower = String(commandArgs.platform || '').toLowerCase();
396
+ var isMac = platformLower.indexOf('mac') !== -1;
397
+ if (!isMac) {
398
+ var videoOutput = platformLower === 'windows' ? (commandArgs.videoMode === null ? 'gpu-next' : 'gpu') : 'libmpv';
399
+ ipc.send('mpv-set-prop', ['vo', videoOutput]);
400
+ }
377
401
 
378
402
  var separateWindow = options.mpvSeparateWindow ? 'yes' : 'no';
379
403
  ipc.send('mpv-set-prop', ['osc', separateWindow]);