aboutsummaryrefslogtreecommitdiffstats
path: root/src/fullscreen_credits.ts
diff options
context:
space:
mode:
authorTeddy Wing2020-05-09 00:32:16 +0200
committerTeddy Wing2020-05-09 00:50:19 +0200
commit9eecf1c6be59ff3c04152390d7ce556e36965fd8 (patch)
tree2d6cec9c91a0585eca48847acfc729fbca7f1fd2 /src/fullscreen_credits.ts
parent21afe4648732d2fc6b6fc0a92de3a0b0d7f91264 (diff)
downloadnetflix-immersive-9eecf1c6be59ff3c04152390d7ce556e36965fd8.tar.bz2
Add documentation comments
Diffstat (limited to 'src/fullscreen_credits.ts')
-rw-r--r--src/fullscreen_credits.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/fullscreen_credits.ts b/src/fullscreen_credits.ts
index 06cc873..d8b25b9 100644
--- a/src/fullscreen_credits.ts
+++ b/src/fullscreen_credits.ts
@@ -19,18 +19,24 @@ import controls from './controls';
import wait_element from './wait_element';
+// Prevent credits from being minimised.
function init_mutation_observer (player) {
const observer = new MutationObserver(function(mutation_list) {
for (var i = 0; i < mutation_list.length; i++) {
const mutation = mutation_list[i];
const player = mutation.target as HTMLElement;
+ // The `postplay` class minimises the movie. Remove it if it gets
+ // added to remain in full frame.
if (player.classList.contains('postplay')) {
player.classList.remove('postplay');
- // Activate player controls.
+ // Playback controls are removed when postplay is activated.
+ // Re-enable them.
player.click();
+ // Activating playback controls makes them visible. Keep them
+ // hidden.
controls.hide();
return;
@@ -47,6 +53,7 @@ function init_mutation_observer (player) {
);
}
+// Initialise the mutation observer when the video player becomes available.
export default function init () {
wait_element('.NFPlayer.nf-player-container')
.then(function(player) {