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

Silent while loading url #40

Closed wojjtkuju closed 6 years ago

wojjtkuju commented 6 years ago

Hi I have problem with play music, this is my code var mpv = require('node-mpv'); var mpvPlayer = new mpv({ "audio_only": true, "binary": null, "debug": true, "verbose": true, }); mpvPlayer.load("https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3"); version of my mpv: mpv 0.14.0 (C) 2000-2015 I have silent and error, logs; Lost connection to socket. Atemping to reconnect { Error: connect ENOENT /tmp/node-mpv.sock at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1170:14) errno: 'ENOENT', code: 'ENOENT', syscall: 'connect', address: '/tmp/node-mpv.sock' } Lost connection to socket. Atemping to reconnect { Error: connect ENOENT /tmp/node-mpv.sock at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1170:14) errno: 'ENOENT', code: 'ENOENT', syscall: 'connect', address: '/tmp/node-mpv.sock' } Lost connection to socket. Atemping to reconnect { Error: connect ENOENT /tmp/node-mpv.sock at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1170:14) errno: 'ENOENT', code: 'ENOENT', syscall: 'connect', address: '/tmp/node-mpv.sock' } Lost connection to socket. Atemping to reconnect { Error: connect ENOENT /tmp/node-mpv.sock at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1170:14) errno: 'ENOENT', code: 'ENOENT', syscall: 'connect', address: '/tmp/node-mpv.sock' } Lost connection to socket. Atemping to reconnect { Error: connect ENOENT /tmp/node-mpv.sock at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1170:14) errno: 'ENOENT', code: 'ENOENT', syscall: 'connect', address: '/tmp/node-mpv.sock' } Lost connection to socket. Atemping to reconnect how I can fix it?

AxelTerizaki commented 6 years ago

Your mpv is way too old, you should upgrade it to the latest version and see if it works better

wojjtkuju commented 6 years ago

Which version will be best?

wojjtkuju commented 6 years ago

So now I have version: mpv git-2018-03-22-a04ac82 Copyright © 2000-2018 and error: `node_modules/node-mpv/lib/util.js:41 const match = (output.match(/(mpv) \d+.\d+.\d+/))[0]; ^

TypeError: Cannot read property '0' of null `

j-holub commented 6 years ago

Hey there, sorry that you have done trouble with the module.

As @AxelTerizaki pointed out your mpv version is super old, even older than the module. The best is usually the latest, which currently is 0.28.0 if I recall correctly.

The lost connection error messages are normal in Version 1 unfortunately, Version 2 fixes this Problem is still subject to change. You can find it here if you‘re interested.

You are trying to load a stream from soundhelix. mpv needs YouTube-dl for that, did you make sure that it is installed and that soundhelix is supported by youtube-dl? A list of supported sites can be found here

I hope we can fix your problem :)

j-holub commented 6 years ago

I just saw your new comment. This issue is know and was already reported in #38 . I currently working on a fix but university is keeping me super busy at the moment. And it's a difficult decision since different old and new mpv versions clash together when checking for the right command.

But you can temporarily fix this by providing the ipc command yourself as mentioned in #38 and seen below

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

I hope this solves your problem for now, if not I'm trying to assist you further. Sorry that you have trouble using the module.

j-holub commented 6 years ago

I closed this issue for now because I just pushed a commit fixing the issue with the version check you encountered. If this did not resolve your problem please feel free to reopen the issue.