Skip to content

Commit

Permalink
Merge pull request #90 from Stremio/fix-shell-issues
Browse files Browse the repository at this point in the history
Fix shell issues
  • Loading branch information
jaruba authored Dec 23, 2024
2 parents 7a104d9 + d46370e commit 8af6671
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ShellVideo/ShellVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function ShellVideo(options) {
break;
}
case 'duration': {
setBackground(false);
var intDuration = args.data | 0;
// Accumulate average duration over time. if it is greater than minClipDuration
// and equal to the currently reported duration, it is returned as video length.
Expand Down Expand Up @@ -325,8 +326,6 @@ function ShellVideo(options) {
stream = commandArgs.stream;
onPropChanged('stream');

setBackground(false);

ipc.send('mpv-set-prop', ['no-sub-ass']);

// opengl-cb is an alias for the new name "libmpv", as shown in mpv's video/out/vo.c aliases
Expand All @@ -352,7 +351,13 @@ function ShellVideo(options) {
}
ipc.send('mpv-set-prop', ['pause', false]);
ipc.send('mpv-set-prop', ['speed', props.speed]);
ipc.send('mpv-set-prop', ['aid', props.aid]);
if (props.aid) {
if (typeof props.aid === 'string' && props.aid.startsWith('EMBEDDED_')) {
ipc.send('mpv-set-prop', ['aid', props.aid.slice('EMBEDDED_'.length)]);
} else {
ipc.send('mpv-set-prop', ['aid', props.aid]);
}
}
ipc.send('mpv-set-prop', ['mute', 'no']);

onPropChanged('paused');
Expand Down

0 comments on commit 8af6671

Please sign in to comment.