@stremio/stremio-video 0.0.46 → 0.0.47

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.46",
3
+ "version": "0.0.47",
4
4
  "description": "Abstraction layer on top of different media players",
5
5
  "author": "Smart Code OOD",
6
6
  "main": "src/index.js",
@@ -116,6 +116,7 @@ function ShellVideo(options) {
116
116
  break;
117
117
  }
118
118
  case 'duration': {
119
+ setBackground(false);
119
120
  var intDuration = args.data | 0;
120
121
  // Accumulate average duration over time. if it is greater than minClipDuration
121
122
  // and equal to the currently reported duration, it is returned as video length.
@@ -325,8 +326,6 @@ function ShellVideo(options) {
325
326
  stream = commandArgs.stream;
326
327
  onPropChanged('stream');
327
328
 
328
- setBackground(false);
329
-
330
329
  ipc.send('mpv-set-prop', ['no-sub-ass']);
331
330
 
332
331
  // opengl-cb is an alias for the new name "libmpv", as shown in mpv's video/out/vo.c aliases
@@ -352,7 +351,13 @@ function ShellVideo(options) {
352
351
  }
353
352
  ipc.send('mpv-set-prop', ['pause', false]);
354
353
  ipc.send('mpv-set-prop', ['speed', props.speed]);
355
- ipc.send('mpv-set-prop', ['aid', props.aid]);
354
+ if (props.aid) {
355
+ if (typeof props.aid === 'string' && props.aid.startsWith('EMBEDDED_')) {
356
+ ipc.send('mpv-set-prop', ['aid', props.aid.slice('EMBEDDED_'.length)]);
357
+ } else {
358
+ ipc.send('mpv-set-prop', ['aid', props.aid]);
359
+ }
360
+ }
356
361
  ipc.send('mpv-set-prop', ['mute', 'no']);
357
362
 
358
363
  onPropChanged('paused');
@@ -6,6 +6,8 @@ var ERROR = require('../error');
6
6
  var getTracksData = require('../tracksData');
7
7
  var createAVPlay = require('./AVPlay');
8
8
 
9
+ var SSA_DESCRIPTORS_REGEX = /^\{(\\an[1-8])+\}/i;
10
+
9
11
  function TizenVideo(options) {
10
12
  options = options || {};
11
13
 
@@ -50,10 +52,12 @@ function TizenVideo(options) {
50
52
  async function renderSubtitle(duration, text) {
51
53
  if (disabledSubs) return;
52
54
  var now = await getProp('time');
55
+ var cleanedText = text.replace(SSA_DESCRIPTORS_REGEX, '');
56
+
53
57
  // we ignore custom delay here, it's not needed for embedded subs
54
58
  lastSub = {
55
59
  duration: duration,
56
- text: text,
60
+ text: cleanedText,
57
61
  now: now,
58
62
  };
59
63
  if (subtitleTimeout) {
@@ -69,7 +73,7 @@ function TizenVideo(options) {
69
73
  subtitlesElement.style.opacity = subtitlesOpacity;
70
74
 
71
75
  var cueNode = document.createElement('span');
72
- cueNode.innerHTML = text;
76
+ cueNode.innerHTML = cleanedText;
73
77
  cueNode.style.display = 'inline-block';
74
78
  cueNode.style.padding = '0.2em';
75
79
  cueNode.style.fontSize = Math.floor(size / 25) + 'vmin';