Giter Club home page Giter Club logo

kodi-ws's People

Contributors

aborovsky avatar bartels avatar bramvanoploo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kodi-ws's Issues

Socket error: unexpected server response (200)

Hi, I am getting this error in terminal from my code. I also tried it with mute.js and am getting the same error. My node version is v0.12.15. I understand I'm not doing something correctly.

user@dev:~/test$ node mute.js
Error: Socket error: unexpected server response (200)
at ClientRequest.response (/home/user/testcode/node_modules/kodi-ws/node_modules/ws/lib/WebSocket.js:674:15)
at ClientRequest.g (events.js:199:16)
at ClientRequest.emit (events.js:107:17)
at HTTPParser.parserOnIncomingClient as onIncoming
at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
at Socket.socketOnData (_http_client.js:317:20)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:540:20)

Unhandeld error Connection timeout?

i'm getting this error if the target is not online:

Unhandled rejection Error: connect ETIMEDOUT
at exports._errnoException (util.js:746:11)
at TCPConnectWrap.afterConnect as oncomplete

i looked, but i could not find where this error is coming from.
is this something the client needs to handle? (only thing i'm doing is reconnecting every 60 sec.)

it looks to be coming from the websocket library. but i have no idea where the rejection should be caught.

Need to update dependency of "ws@^0.7.1"

ws@^0.7.1 too old and depends on old [email protected] which cannot be compiled for node.js >=4.x.x
I've tested with latest ws and it's compiled successfully.
But did't try: is it works nice.
Guys, can you try in your own environment?

My env:

`bash-3.2$ node -v

v4.4.3

bash-3.2$ npm -v

2.15.1`

Error: Could not load 'util'

I am not sure what I am doing wrong, but when I import the kodi-ws package I get the error Error: Could not load 'util'

Its like npm didn't install the dependencies or something. Looking into this.

Support for react-native

I was trying to use this library from react-native and notice that websocket dependency is not available. Is it possible to use socket.io rather than ws?

connection.notification not working

Hi,

First off, the code looks very nice and tidy!

But the following is not working:
connection.notification('Player.OnPause', function() {
console.log('Paused');
});

As Notification is not a function for connection.
i checked, and connection is only adding the methods and notifications from the schema as functions. But it never add's this general notification listener!

examples/youtube.es7.js errors

Running youtube.es7.js results in an error TypeError: Cannot read property 'Player' of undefined

Adding con as an argument on lines 33 and 42 should fix.

await stopAllActivePlayers(con);

Batch requests

Thank you for this very elegant library! It's working great and I love the minimalistic approach.

For my application I need to do batch requests to Kodi. I can't figure out how to do this with the jrpc-schema library. Do you know if this is possible?

Player.Open Throwing "Invalid parameters" error.

When I tried to play a movie with a specific id I get an error. Below is the code I used to attempt to play the movie.

connection.run('Player.Open')({
    'item' : {
        "movieid" : 12
    },
    'options' : {
        'resume' : true
    }
}, function(err, results) {
    console.log(err);
    console.log(results);
});

Adding a movieid property to the item object in the parameters has always been the way I have played movies in other XBMC libraries and as far as I can tell it is the way to do it. However, it generates this error

[ERROR] 12:15:33 Error
Error: Invalid parameters

Is this user error or a bug?

incompatibility with Node V0.10.x

Hi,

i noticed that the library is not compatible with Node versions that do not have Promise integrated.

i created a fork which uses Bluebird for the primises instead of the NodeJS integrated one.
This makes it compatible with the older versions of NodeJS as well.

In theory this should be faster as well, but i don't know it well enough to know for sure ;)

Perhaps it is an idea to use Bluebird instead of NodeJS, but i do not know what the implications may be for other users.

Crash when shutting down.

When running:

kodi(host, 9090)
        .then(connection => {
          connection.System.Shutdown()
          console.log("Kodi Power Off Success")
        })
Kodi Power Success
events.js:165
      throw er; // Unhandled 'error' event
      ^

SyntaxError: Failed to handle response: Unexpected token � in JSON at position 0
    at JSON.parse (<anonymous>)
    at Schema.handleResponse (/Users/marcgodard/GitHub/remote-api/node_modules/jrpc-schema/lib/Schema.js:80:21)
    at WebSocket.<anonymous> (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/lib/Connection.js:30:18)
    at WebSocket.emit (events.js:180:13)
    at Receiver.ontext (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/WebSocket.js:841:10)
    at /Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/Receiver.js:536:18
    at Receiver.applyExtensions (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/Receiver.js:371:5)
    at /Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/Receiver.js:508:14
    at Receiver.flush (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/Receiver.js:347:3)
    at Receiver.finish (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/Receiver.js:541:12)
    at Receiver.expectHandler (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/Receiver.js:499:31)
    at Receiver.add (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/Receiver.js:103:24)
    at Socket.realHandler (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/node_modules/ws/lib/WebSocket.js:825:20)
    at Socket.emit (events.js:180:13)
    at addChunk (_stream_readable.js:269:12)
    at readableAddChunk (_stream_readable.js:256:11)
Emitted 'error' event at:
    at WebSocket.<anonymous> (/Users/marcgodard/GitHub/remote-api/node_modules/kodi-ws/lib/Connection.js:33:11)
    at WebSocket.emit (events.js:180:13)
    [... lines matching original stack trace ...]
    at readableAddChunk (_stream_readable.js:256:11)
    at Socket.Readable.push (_stream_readable.js:213:10)
    at TCP.onread (net.js:581:20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.