Skip to content
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

Control remote jellyfin sessions #37

Merged
merged 10 commits into from
Jan 2, 2024

Conversation

HenkKalkwater
Copy link
Member

@HenkKalkwater HenkKalkwater commented Jan 2, 2023

  • Discovering other Jellyfin clients
  • Mirroring state from the controlled client
    • Currently playing item
    • PlayState (playback position, Play/Pause)
    • Playlist/Queue
  • Sending commands
    • Play/Pause/Seek/Next/Previous
    • Start playing an item
    • Start playing an item in a playlist
      • From the start
      • From an offset
    • Send which item is being viewed
    • Send which subtitle stream and audio stream should be used
  • Swapping between local playback and controlling another device
    • Seamlessly transfer state between the current device and the controlled device (if it is not playing anything already)
  • UI tweaks
    • Add a page to select the device to control
    • Playing bar/Now playing screen
      • Always show when controlling a remote device
      • Show which device is being controlled
      • A better "Nothing Playing" state
    • Don't go into an empty VideoPage when playing a video

 Adds a way of discovering remote sessions and in Jellyfin the UI.
@HenkKalkwater HenkKalkwater marked this pull request as draft January 2, 2023 21:25
The playback queue is now kept in sync with the playback queue of the
remote jellyfin instance the manager is controlling.

Some additional guards were added in place in the shuffle and playlist
algorithm, since the situation can occur where the now playing index
falls outside of the playing playlist. This happens because when the
an playlist update is received, we need to do another HTTP request
before we know which items are in the queue, while the now playing index
has been updated.

This is a not-optimal way to fix that, but it works well enough for now
and a better solution can be implemented later. (Hello, person in the
future reading the git blame output!)
If the mediaSourceId is not sent, Jellyfin Web will simply not take the
audioStreamIndex and subtitleStreamIndex in account when playing the
media.

A bug also surfaced where the application would crash when playing a
video, playing audio afterwards and then clicking on an item in the now
playing queue. This has also been fixed.
@HenkKalkwater
Copy link
Member Author

The "Seamlessly transfer state between the current device and the controlled device (if it is not playing anything already)" and "Send which item is being viewed" will be done in a separate merge request, because the design needs to be thought out more before implementing it and they are not an essential feature in my opinion.

@HenkKalkwater HenkKalkwater marked this pull request as ready for review January 2, 2024 12:42
Device icons for the local device is now determined by looking at what
the value of the deviceType property of the ApiClient is. This property
was newly introduced, so that applications using JellyfinQt can set
their own device type.

For other devices, a guess is made based on the client name. This guess
has been derived from what Jellyfin Web does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant