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

Update to work with the latest Apple TV #866

Merged
merged 2 commits into from
Sep 23, 2021

Conversation

nathanielherman
Copy link
Contributor

The old insertion code no longer works, and the change that allows injection into apple-tv-plus-player is a different attribute change than 'aria-hidden'

Copy link
Owner

@igrigorik igrigorik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pulling this together! A couple of questions..

inject.js Outdated
@@ -361,8 +361,7 @@ function defineVideoController() {
p.insertBefore(fragment, p.firstChild);
break;
case location.hostname == "tv.apple.com":
// insert after parent for correct stacking context
this.parent.getRootNode().querySelector(".scrim").prepend(fragment);
// pass-through, the latest version of AppleTV works with default behavior
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this branch? No purpose, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up modifying it so that the hover works too (before it would show and you could use hotkeys but not modify the UI directly)

inject.js Outdated
@@ -667,7 +667,7 @@ function initializeNow(document) {
);
});
observer.observe(document, {
attributeFilter: ["aria-hidden"],
attributes: true,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a heavy performance tax, instead of opting in wholesale, we can provide a list of attributes. Is there an attribute we can target for AppleTV?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes there is, I'm a little worried about it changing cuz it's kind of random, but yeah the perf tax might be high otherwise

@nathanielherman nathanielherman force-pushed the appletv_fix branch 2 times, most recently from 7c07b1b to 5938a55 Compare September 13, 2021 05:07
@igrigorik
Copy link
Owner

@nathanielherman looking at your last commits, this looks good.. Good to merge from your side?

@igrigorik
Copy link
Owner

@nathanielherman testing it locally, the controller is injected successfully — yay. However, can't move it, stacking order?

LMK once we're good to merge.

@nathanielherman
Copy link
Contributor Author

@igrigorik can't move it? I can hover it and modify it successfully, I'm not familiar with what moving means though

@nathanielherman
Copy link
Contributor Author

I'm good to merge, probably won't have time to modify it further if there's more you want to do

@flubbian
Copy link

Hi! Has this issue been fixed? Is it finally working with Apple TV+? Thank you!

@igrigorik igrigorik merged commit db4d008 into igrigorik:master Sep 23, 2021
@igrigorik
Copy link
Owner

@nathanielherman merging, thanks again for your contribution!

@igrigorik igrigorik mentioned this pull request Sep 23, 2021
@flubbian
Copy link

How do I enable it on tv.apple.com? It's still not working.

@nathanielherman
Copy link
Contributor Author

@flubbian you have to install the extension directly from the latest github version rather than through the store, that should work

@notsuhas
Copy link

notsuhas commented Sep 26, 2021

image

Hi, Apple TV+ playback speed works but is stuck on the speed set before playing. For instance, if the speed before starting is 3x and I start playing, it works but I can't reduce speed anymore nor increase and inside the Chrome Extensions I'm shown the above error

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.

4 participants