-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seeking fixes and related improvements #17
Open
groszdaniel
wants to merge
10
commits into
sunsetsonwheels:master
Choose a base branch
from
groszdaniel:seeking
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adapt to breaking change in the Kodi JSON-RPC protocol xbmc/xbmc#15939
ArrowLeft/ArrowRight only seek, long press seeks repeatedly SoftLeft/SoftRight go forward/backward in playlist Call opens player options
Support calling multiple methods in a single request to simplify async code and improve performance over separate requests. JSON-RPC supports this by sending and receiving arrays.
As a further improvement, use the user's seeksteps and seekdelay settings from Kodi: gradually increasing steps. Though we use them differently: in Kodi, one has to press the arrow keys repeatedly, and the delay determines when steps are reset, while in Kaidi, now one has to long-press Left/Right, and the delay determines the key repetition frequency.
Update the player time when seeking, to make it easier to seek (since in some cases it doesn't show up on the Kodi screen when playing music).
Update info such as track title during polling, along with time. Since we're polling every 2 seconds anyway, requesting some more info has little extra cost. Events only work with the port 9090 interface, which is very insecure; this way, Kaidi is more usable when only the web server interface is available.
It improves seeking in particular. Playing status is now only hidden when there is no active player at all. Also use refreshProperties() at the beginning instead of duplicate code.
Use the visibilitychange event to start/stop the timer. This should save a little battery.
Continue polling even when the player isn't running. This doesn't make sense if Kodi events are available, but if events don't work, it makes Kaidi recognize when another client starts playback or switches tracks while playback isn't running. In conjunction with stopping polling when the document is invisible, it should have little cost.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes two seeking bugs, and adds several related improvements.
Seeking was broken with recent Kodi versions due to a backwards-incompatible change in Kodi's protocol. The first commit fixes this.
There were several issues with interpreting Left/Right buttons as seeking vs. switching tracks/files. A timer measured the time elapsed from the most recent keydown event to the keyup event, and would interpret it as seeking if it was more than 150 ms.
The second commit assigns seeking to the Left/Right keys on the D-pad, going backward/forward in the playlist to the softkeys, and the menu that was previously assigned to SoftLeft to the Call button. Long pressing the D-pad Left/Right keys repeats seeking every 250 ms. Subsequent keydown events while holding the button are ignored. The third commit refines this by taking the amounts of time to seek by, and the repetition delay, from the Kodi settings if possible.
See the commit messages' description lines (click ... next to the commit message) for more details on the other commits. If you don't want to apply all commits, you can cherry-pick what you want, though some commits rely on changes made in some earlier commits.