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

fix bugs that were preventing successful casting #45

Merged
merged 1 commit into from
Jul 28, 2020

Conversation

jasonmeisel
Copy link
Contributor

@jasonmeisel jasonmeisel commented Jul 28, 2020

There are three main fixes in here:

maincontroller.js

  • the playbackMgr object was not being constructed with its constructor parameters.

playbackmanager.js

  • many callback functions were using this. inside unbound anonymous functions, and thus was hitting undefined references. fixed by using arrow functions instead.
  • getNextPlaybackItemInfo was failing because it uses window.playlist, which was not being assigned by playbackManager. Since removing window.playlist will require more refactoring, I just assign it before calling the function.

These fixes allow casting to work successfully, including media control using the Google Home app:
image

@jasonmeisel jasonmeisel marked this pull request as ready for review July 28, 2020 07:27
@dkanada dkanada merged commit 5c1e2e6 into jellyfin:master Jul 28, 2020
@dkanada
Copy link
Member

dkanada commented Jul 28, 2020

The changes should be available on the unstable version by the time you read this, feel free to make any other improvements since we'd love to tag a new stable release soon.

@jasonmeisel
Copy link
Contributor Author

jasonmeisel commented Jul 28, 2020

The changes should be available on the unstable version by the time you read this, feel free to make any other improvements since we'd love to tag a new stable release soon.

@dkanada Thinking about it, some of these bugs would have been prevented if the codebase was using Typescript. I'd be happy to convert it, if you'd like.

If you haven't used Typescript before, it's literally just JS with type annotations. So the code changes would be fairly minor.

@jasonmeisel jasonmeisel deleted the bug-fixes branch July 28, 2020 19:36
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.

2 participants