Closed vankasteelj closed 4 years ago
When the above happens, the mpv.mpvPlayer.connected is false
, but there is no exit code (it's set to default null
).
The exit code does update to 0
after a manual closing of the MPV spawned window
So, it does seem that the issue is that mpv sends back (through ipcInterface) an "idle" event before playing the actual file. Causing the player to disconnect.
Disabling the this.emit('stopped')
in case of "idle" message from ipc (_events.js) corrects the issue. Now the file loads correctly everytime. Of course, it also disables the auto-close feature at the end of the file: the mpv player does close, but this module isnt made aware of it, logically because I presume mpv sends a "idle" message at that time. MMmmh
Maybe this is an issue with how I use your module? I interpret the "stop" event as a "the file playback has stopped", when it is, as I see in your code, "the player idles". Anyway, I worked around it, but it still is wierd that it happens randomly.
Which version of MPV are you using ? I know I've had some weird issues depending on which version I used.
0.29 (31/07/2018)
Thanks for letting me know. At the moment university keeps me really really busy that's why I haven't done much for this project in the past month. I'll try to have a look at it soon. Thanks for the very detailed feedback I think that will help a lot.
I cannot reproduce this. I have done some changes to start()
lately, which should make it more robust. Can you see if it still occurs on your case?
Closing this for now as I cannot reproduce the error. Feel free to reopen it if the problem still prevails.
When spawning a new player, sometimes (way to often, maybe 1/10) the load doesn't work.
The player does spawn, even the file is being read by MPV, yet the module fired a "stopped" event in between and the MPV binary is "free", your module doesnt have access to it.
The "stopped" event does occur after the console log "Connected to socket '\.\pipe\mpvserver'" though.