Current song time?
epon93 opened this issue · comments
Is it possible to grab the current play time that the song is at?
idk probably, I don't have a system to test it at the moment.
try dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'
and see what data you get.
That command returns:
variant string "Paused"
or
variant string "Playing"
dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'Position'
http://www.frandieguez.com/blog/2010/11/playing-with-d-bus-interface-of-spotify-for-linux/
hmm, the Position always comes back as 'int64 0'
I found this from 2012 with the same issue https://community.spotify.com/t5/Desktop-Linux-Windows-Web-Player/Spotify-DBus-position-property-always-returns-0/m-p/1015074
Apparently it has still not been fixed 6 years later? :/
ya I'm honestly surprised their backend still supports the linux player all these years later
if you really want you could try keeping track of time yourself. maybe start and stop a clock by reading the PlaybackStatus
frequently.
might take a while to get working :p