diff options
author | Teddy Wing | 2020-05-05 04:10:46 +0200 |
---|---|---|
committer | Teddy Wing | 2020-05-05 04:10:46 +0200 |
commit | ad62baaf033b7a77192ccad343b1926537b69024 (patch) | |
tree | 065ee8516aca17b2cc35b49cb1ee2432c81561b8 | |
parent | c64bbaca4dc9977eae5b0068ee580b96ba057cb2 (diff) | |
download | netflix-immersive-ad62baaf033b7a77192ccad343b1926537b69024.tar.bz2 |
Reactivate player controls and hide UI
Click the player frame to reactivate player controls. Player controls
disappear once the credits get minimised.
The problem with clicking the player frame, though, is that the controls
UI becomes visible. We want the controls DOM elements to come back, but
stay hidden.
Change the CSS class to "inactive" to hide the UI. There is a problem
with this currently: jiggling the mouse over the video after the class
is changed doesn't make the controls visible. Need to move the cursor
out of the frame and back in to reset the visibility state.
Add a couple CSS styles to hide:
* The "Back to Browse" button that appears for a second in the top left
corner of the page
* The "RATED …" label in the top left corner of the page
-rw-r--r-- | content.js | 41 |
1 files changed, 41 insertions, 0 deletions
@@ -21,6 +21,29 @@ function init_mutation_observer (player) { if (mutation.target.classList.contains('postplay')) { mutation.target.classList.remove('postplay'); + // Activate player controls. + mutation.target.click(); + + // TODO: Change .active to .inactive + // mutation.target.classList.replace('active', 'inactive'); // Didn't work + // Remove .can-resume: Removes white border on hover + // PlayerControlsNeo__bottom-controls PlayerControlsNeo__bottom-controls--faded + // PlayerControlsNeo__layout PlayerControlsNeo__layout--active + // PlayerControlsNeo__layout PlayerControlsNeo__layout--inactive + + // document.querySelector('.PlayerControlsNeo__bottom-controls') + // .classList + // .add('PlayerControlsNeo__bottom-controls--faded'); + + document.querySelector('.PlayerControlsNeo__layout.PlayerControlsNeo__layout--active') + .classList + .replace( + 'PlayerControlsNeo__layout--active', + 'PlayerControlsNeo__layout--inactive' + ); + + // .OriginalsPostPlay-BackgroundTrailer .BackToBrowse + return; } } @@ -35,9 +58,27 @@ function init_mutation_observer (player) { ); } +function styles () { + var style = document.createElement('style'); + + document.head.appendChild(style); + + style.sheet.insertRule( + '.OriginalsPostPlay-BackgroundTrailer .BackToBrowse { visibility: hidden; }', + style.sheet.cssRules.length + ); + + style.sheet.insertRule( + '.player-view-childrens { visibility: hidden; }', + style.sheet.cssRules.length + ); +} + with_player(function(player) { window.player = player; init_mutation_observer(player); }); + +styles(); |