Skip to content

Commit 8af6671

Browse files
authored
Merge pull request #90 from Stremio/fix-shell-issues
Fix shell issues
2 parents 7a104d9 + d46370e commit 8af6671

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/ShellVideo/ShellVideo.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function ShellVideo(options) {
116116
break;
117117
}
118118
case 'duration': {
119+
setBackground(false);
119120
var intDuration = args.data | 0;
120121
// Accumulate average duration over time. if it is greater than minClipDuration
121122
// and equal to the currently reported duration, it is returned as video length.
@@ -325,8 +326,6 @@ function ShellVideo(options) {
325326
stream = commandArgs.stream;
326327
onPropChanged('stream');
327328

328-
setBackground(false);
329-
330329
ipc.send('mpv-set-prop', ['no-sub-ass']);
331330

332331
// 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) {
352351
}
353352
ipc.send('mpv-set-prop', ['pause', false]);
354353
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+
}
356361
ipc.send('mpv-set-prop', ['mute', 'no']);
357362

358363
onPropChanged('paused');

0 commit comments

Comments
 (0)