infinityofspace / jellyfin_alexa_skill

Selfhosted Alexa media player skill for Jellyfin
GNU General Public License v3.0
70 stars 10 forks source link

Add support for remote control #3

Open infinityofspace opened 2 years ago

infinityofspace commented 2 years ago

Please describe which problem should be solved

Jellyfin offers a feature where devices can be controlled remotely. This feature would also be helpful for controlling Alexa supported devices.

Optional: Describe your idea for a solution

Unfortunately, it is not possible to directly trigger an Alexa-enabled device. Therefore, a constant audio/video stream after activating the remote control would be possible to work around this problem.

infinityofspace commented 2 years ago

After a long time of experimenting and several partial solutions, which do not meet the requirements for a general solution, I have to say that the workaround is not feasible. The problem with constant streaming is that we would have to convert the audio stream on the fly if needed and also modify the stream if, for example, other media formats are played or the volume is changed. Also, switching from audio to video would also only be possible with full reencoding and restarting.

Another possible solution would be to partially control the respective Alexa device via the web version API endpoints. However, this would require the credentials to the respective Amazon accounts and I don't think this is the best solution from a security point of view.

However, there must be a way to control Alexa devices externally only with access tokens from the skill authentication/account linking, at least within a limited scope. For example, the Spotify Skill offers this function.

If anyone has some information or an idea how this was implemented in the Spotify Skill or other skills I am very grateful for a comment with details or if desired a PR is also welcome.

I am now going to invest the development time previously committed to the feature into other pending features of the project and remove the feature from the current roadmap for the time being due to the unworkable solution.