Support Seek() command by issuing an appropriate SetPosition() call.
Fixes changing position through KDE Connect
Details
Details
- Reviewers
davidedmundson fvogt nicolasfella - Group Reviewers
Plasma - Commits
- R856:a8152f2678b9: [MPris Plugin] Support Seek()
- Can now change position in track using KDE Connect app
Using SetPosition() (dbus exported) because that one actually sends command to browser, setPosition() (note the lowecase s) is the internal one that propagates a change via mpris
Diff Detail
Diff Detail
- Repository
- R856 Plasma Browser Integration
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
Seek has a different behaviour for position() + offset < 0 and position() + offset == m_length:
A negative value seeks back. If this would mean seeking back further than the start of the track, the position is set to 0. If the value passed in would mean seeking beyond the end of the track, acts like a call to Next.
SetPosition has:
If the Position argument is less than 0, do nothing. If the Position argument is greater than the track length, do nothing.
which is different.
Comment Actions
LGTM. I just tried how the currentTime property in JS works, it actually behaves like MPRIS' seek does and does not ignore invalid values. That might need a check in SetPosition.
Comment Actions
- Check bounds in SetPosition
- Use > again since when I move the slider all the way to the end it sets the position to length and then would do nothing