Comments (26)
Hey, I'm redesigning the dbus-native service interface so it can work for this project.
https://github.com/acrisci/node-dbus-next
See a working example here.
Let me know what you think.
from mpris-service.
😎
from mpris-service.
Another problem with dbus-native is it has a very unusual and undocumented variant object format you'd need to write a converter for.
The current library node-dbus is no better. It completely ignores the types of the properties. There is no way to represent "1.0" as anything other than a byte which is needed for volume and rate.
I'm beginning to think the best way to fix this is to just write your own dbus service in C because there's not a good library for writing the services in node.
from mpris-service.
Can I say I love you guys?
from mpris-service.
@martpie can you open a new issue with some more information on the error?
from mpris-service.
You mean, switch to https://github.com/sidorares/node-dbus?
Yeah, that would be much better. What's more, the currently used dbus implementation makes fixing bugs like #1 very difficult.
from mpris-service.
Service implementation example: https://github.com/sidorares/node-dbus/blob/master/examples/service/server2.js
from mpris-service.
I'd looked into this, but I have 0 experience with dbus and this repo does not have any tests, so I either need some guidance or need to add some tests
from mpris-service.
I think the first thing to do would be to describe the org.mpris.MediaPlayer2
interface with an object like this: https://github.com/sidorares/node-dbus/blob/master/examples/service/server2.js#L15
Letters used are data types (yeah, it kind of sucks), here is the spec: https://dbus.freedesktop.org/doc/dbus-specification.html#type-system
It seems that for methods, the last item in the types list is the return value. All others are arguments.
Then, we'll need to implement org.mpris.MediaPlayer2
with JS functions. d-feet is a great tool to debug this.
Tests are a very good idea, but I don't really know how to implement them. Created an issue for that: #7
from mpris-service.
actually, that module is not purely native too, instead, it uses abstract-socket
as optional dependency (or claims to do so).
from mpris-service.
Yeah looked over the code and what it would take to patch the current dbus library, and I think it's easier just to write it out. Working on this now.
from mpris-service.
I found a bug in 0.2.5 of dbus-native that won't handle functions that return nothing, but it's fixed in the master branch.
from mpris-service.
Now I have found that the org.freedesktop.DBus.Properties
interface is not fully implemented and not overridable in the dbus-native project which is a big problem.
from mpris-service.
Thanks for looking into this! Indeed we do need a full org.freedesktop.DBus.Properties
implementation, do you know if a big piece of it is missing or if it's easy to add it?
from mpris-service.
There's an internal implementation of the properties interface that's different from the exported interface implementation. There's no way to emit events on the internal implementation, so we can't emit PropertiesChanged
which is required to make playerctl work.
The Set
method of properties is not implemented.
There's no way to make a property readonly either.
I'll do some probing PRs and see if the maintainer has a will to make this work.
from mpris-service.
Eh, these are pretty severe limitations. :\
from mpris-service.
Looks great! Keep up the good work!
from mpris-service.
@emersion Can we expect a release soon?
from mpris-service.
Yes. I wonder if this should be a new major release. @acrisci, thoughts?
from mpris-service.
Yes definitely a new major release. I'm pretty confident it works ok.
Electron integration is what worries me a little. I've tested it in the Electron sample app and it works fine. However, I can't get it to work in GPMDP. I think they might have some security thing that's disabling the node interfaces. I'm still looking into it.
from mpris-service.
Ok just figured it out. They use an invalid interface name (includes the -
character). Once I change those to _
it works fine. Going to add some validation for that.
from mpris-service.
Nice. I'll wait a little to get your fix in.
from mpris-service.
@emersion I have a branch of GPMDP with mpris functional for playerctl. Ready for release 👍 .
from mpris-service.
2.0 released! 🎉
Thanks again for your hard work!
from mpris-service.
MarshallOfSound/Google-Play-Music-Desktop-Player-UNOFFICIAL-#3513
from mpris-service.
@acrisci When trying to use mpris-service
in Electron 4, I get an error with BigInt
A JavaScript error occured in the main process
Uncaught Exception:
TypeError: JSBI.BigInt is not a function
I am a bit confused because Electron 4 is based on Node 10 so everything "should" work, any idea?
require('node-dbus-next').setBigIntCompat(true)
does not seem to change anything
from mpris-service.
Related Issues (20)
- Error: The module was compiled against a different Node.js version using NODE_MODULE_VERSION 48. HOT 6
- Metadata don't work HOT 5
- CanGoPrevious & CanGoNext variable updating but mpris is not HOT 2
- Add CI HOT 5
- mpris-service 2.0 fails because of JSBI.BigInt with Webpack HOT 9
- Sending/Receiving negative numbers HOT 2
- Player implementation status
- Support multiple instances
- DBus connection error handling
- Documentation hosting HOT 1
- Move to dbusjs organization HOT 2
- TypeError: JSBI.BigInt is not a function HOT 6
- Media Keys stop working after closing window HOT 4
- Got error when detecting the player status using other scripts HOT 3
- TypeError: JSBI.BigInt is not a function HOT 4
- Changing property results in EPIPE errors HOT 3
- use latest dbus-next HOT 4
- Typo: `that` instead of `this` HOT 1
- Error while executing `GetAll` on `org.freedesktop.DBus.Properties`
- Can I use this to discover other players? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpris-service.