FichteFoll / discordrp-mpris

Discord Rich Presence through media players providing the mpris2 dbus interface
MIT License
86 stars 19 forks source link

Support FireFox (and Chrome?) #18

Closed FichteFoll closed 2 years ago

FichteFoll commented 3 years ago

FireFox added mpris2 support some time late last year (2020) and I've been using it with playerctl to great success, but the interface does not support the "Position" property, apparently.

ERROR:__main__:Unknown DBusError encountered during tick
Traceback (most recent call last):
  File "/home/fichte/code/discordrp-mpris/discordrp_mpris/__main__.py", line 71, in run
    await self.tick()
  File "/home/fichte/code/discordrp-mpris/discordrp_mpris/__main__.py", line 105, in tick
    await asyncio.gather(
  File "/usr/lib/python3.9/site-packages/ravel.py", line 2951, in get_prop
    reply.expect_return_objects("v")[0][1]
  File "/usr/lib/python3.9/site-packages/dbussy.py", line 4383, in expect_return_objects
    raise DBusError(self.error_name, self.expect_objects("s")[0])
dbussy.DBusError: org.freedesktop.DBus.Error.NotSupported -- /org/mpris/MediaPlayer2.org.mpris.MediaPlayer2.Player Position is not supported

No idea about Chrome since I haven't tested it, but it seems that discord itself offers a player under a 'chromium' suffied bus that defines /org/mpris/MediaPlayer2 but no interfaces (using QDBusViewer). This will need some investigation.

vpzomtrrfrt commented 3 years ago

relevant firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1659199

Probably should still add support here for sources that don't support Position

vpzomtrrfrt commented 3 years ago

Even using the plasma integration extension doesn't work since it still tries to access Position from the firefox one sometimes