-
Notifications
You must be signed in to change notification settings - Fork 528
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
default: | ||
// Note: when triggered via a MutationRecord, it's possible that the | ||
// target is not the immediate parent. This appends the controller as | ||
|
@@ -646,14 +645,15 @@ function initializeNow(document) { | |
break; | ||
case "attributes": | ||
if ( | ||
mutation.target.attributes["aria-hidden"] && | ||
mutation.target.attributes["aria-hidden"].value == "false" | ||
(mutation.target.attributes["aria-hidden"] && | ||
mutation.target.attributes["aria-hidden"].value == "false") | ||
|| mutation.target.nodeName === 'APPLE-TV-PLUS-PLAYER' | ||
) { | ||
var flattenedNodes = getShadow(document.body); | ||
var node = flattenedNodes.filter( | ||
var nodes = flattenedNodes.filter( | ||
(x) => x.tagName == "VIDEO" | ||
)[0]; | ||
if (node) { | ||
); | ||
for (let node of nodes) { | ||
if (node.vsc) | ||
node.vsc.remove(); | ||
checkForVideo(node, node.parentNode || mutation.target, true); | ||
|
@@ -667,7 +667,7 @@ function initializeNow(document) { | |
); | ||
}); | ||
observer.observe(document, { | ||
attributeFilter: ["aria-hidden"], | ||
attributes: true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
childList: true, | ||
subtree: true | ||
}); | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good
There was a problem hiding this comment.
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)