aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2020-05-05 23:03:38 +0200
committerTeddy Wing2020-05-05 23:06:13 +0200
commit0c56f4361c836f15d22daf7ce70570f9f95afdae (patch)
tree34f89b1ad4cc9a23ece4abd5ef976381f3567cb6
parente1383d531a4c3eb4d83e500aad09f92967abd395 (diff)
downloadnetflix-immersive-0c56f4361c836f15d22daf7ce70570f9f95afdae.tar.bz2
Move fullscreen credits init function to fullscreen_credits.ts
Makes more sense to put it in the fullscreen_credits module.
-rw-r--r--src/fullscreen_credits.ts10
-rw-r--r--src/index.ts7
2 files changed, 10 insertions, 7 deletions
diff --git a/src/fullscreen_credits.ts b/src/fullscreen_credits.ts
index a569fa2..6d174ed 100644
--- a/src/fullscreen_credits.ts
+++ b/src/fullscreen_credits.ts
@@ -1,4 +1,4 @@
-export function with_player (callback) {
+function with_player (callback) {
var interval = setInterval(
function() {
var player = document.querySelector('.NFPlayer.nf-player-container');
@@ -13,7 +13,7 @@ export function with_player (callback) {
);
}
-export function init_mutation_observer (player) {
+function init_mutation_observer (player) {
var observer = new MutationObserver(function(mutation_list) {
for (var i = 0; i < mutation_list.length; i++) {
var mutation = mutation_list[i];
@@ -58,3 +58,9 @@ export function init_mutation_observer (player) {
}
);
}
+
+export default function init () {
+ with_player(function(player) {
+ init_mutation_observer(player);
+ });
+}
diff --git a/src/index.ts b/src/index.ts
index 1ea3d28..504a7d7 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,9 +1,6 @@
-import { init_mutation_observer, with_player } from './fullscreen_credits';
+import fullscreen_credits from './fullscreen_credits';
import { styles } from './styles';
-with_player(function(player) {
- init_mutation_observer(player);
-});
-
+fullscreen_credits();
styles();