j-holub / Node-MPV

A NodeJs Module for MPV Player
https://www.npmjs.com/package/node-mpv
MIT License
116 stars 73 forks source link

mpv has just modified the version strings #37

Closed M6ZeroG closed 6 years ago

M6ZeroG commented 6 years ago

1 I am using the latest mpv source code manually compiled the mpv executable file, and when node-mpv is loaded, it throws an error when it gets the version number of mpv application like this:

xxxx/node_modules/node-mpv/lib/util.js:41
                var end   = (output.match(/\(C\)/)).index;
                                                   ^

TypeError: Cannot read property 'index' of null
..................
..................

This mostly beacuse of the mpv version strings changed recently like this:

mpv 0.28.0-144-g0cd501d Copyright © 2000-2018 mpv/MPlayer/mplayer2 projects

And the previous version is still in this format:

mpv 0.26.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects

Link : https://github.com/mpv-player/mpv/commit/49e704cb19dfe72b293fd286395e37ed1d3c3d99

j-holub commented 6 years ago

Hey there,

thanks a lot for the detailed description. I will look into this as soon as I can (definitely within this week). Should be fairly easy to fix. I might drop the version checking part in Node-MPV completely since it's been like 2 years since they changed the ipc command command line flag.

Should be the easiest and safest fix. It just uses the new ipc command and the user of the library can pass the old one if he wishes to use a fairly outdated version of mpv (or has to).

Thank you! :)

j-holub commented 6 years ago

Hey,

sorry it's taking so long. I have troubles compiling the latest MPV version because I can't get a new enough version of ffmpeg. I'm further looking into the issue. Really sorry.

j-holub commented 6 years ago

Still looking into it. I have a version where I removed the checking and rely on the user to input the ipc option and using the later one (used since mpv 0.17.0) as a default.

However I'd like to keep the ability to decide on the argument automatically that's why I'm hesitant to remove it.

What you can do for now is set the command by hand. So if you create the mpv object do it like this

let mpvPlayer = new mpv({
    'ipc_command': '--input-ipc-server'
});

along with your other options. That should skip the version checking (since you provided the command yourself) and your player should run.

Meanwhile I'm further working on resolving the issue, sorry it's taking so lang.

j-holub commented 6 years ago

Super sorry it took so long :(