place controller inside scrim div & better filter to find old controller

This commit is contained in:
Jonathan Dawson
2019-11-22 16:07:50 -06:00
parent d08563305a
commit 58e0912712

View File

@@ -272,7 +272,7 @@
break;
case (location.hostname == 'tv.apple.com'):
// insert after parent for correct stacking context
this.parent.getRootNode().host.prepend(fragment);
this.parent.getRootNode().querySelector('.scrim').prepend(fragment);
default:
// Note: when triggered via a MutationRecord, it's possible that the
@@ -456,7 +456,7 @@
if ((mutation.target.tagName == 'APPLE-TV-PLUS-PLAYER') && (mutation.target.attributes['aria-hidden'].value == "false")) {
var flattenedNodes = getShadow(document.body)
var node = flattenedNodes.filter(x => x.tagName == 'VIDEO')[0]
var oldController = flattenedNodes.filter(x => x.className == 'vsc-controller')[0]
var oldController = flattenedNodes.filter(x => x.classList.contains('vsc-controller'))[0]
if (oldController) {
oldController.remove()
}