Skip to content

Commit

Permalink
Better conform with the player behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
core1024 committed Oct 24, 2024
1 parent bf60fe7 commit 12d5f44
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ShellVideo/ShellVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var ERROR = require('../error');
var SUBS_SCALE_FACTOR = 0.0066;

var stremioToMPVProps = {
'loaded': null,
'loaded': 'loaded',
'stream': null,
'paused': 'pause',
'time': 'time-pos',
Expand Down Expand Up @@ -111,7 +111,8 @@ function ShellVideo(options) {
// for bitwise maths so the maximum supported video duration is 1073741823 (2 ^ 30 - 1)
// which is around 34 years of playback time.
avgDuration = avgDuration ? (avgDuration + intDuration) >> 1 : intDuration;
if(intDuration > 0) events.emit('propChanged', 'loaded', 'true');
props.loaded = intDuration > 0;
onPropChanged('loaded');
break;
}
case 'time-pos': {
Expand Down Expand Up @@ -351,6 +352,7 @@ function ShellVideo(options) {
}
case 'unload': {
props = {
loaded: false,
pause: false,
mute: false,
speed: 1,
Expand All @@ -363,6 +365,7 @@ function ShellVideo(options) {
continueFrom = 0;
avgDuration = 0;
ipc.send('mpv-command', ['stop']);
onPropChanged('loaded');
onPropChanged('stream');
onPropChanged('paused');
onPropChanged('time');
Expand Down

0 comments on commit 12d5f44

Please sign in to comment.