diff options
author | Teddy Wing | 2020-05-08 17:09:50 +0200 |
---|---|---|
committer | Teddy Wing | 2020-05-08 17:16:47 +0200 |
commit | c692a0a50ac8af8849e22dbca0326c274e50db38 (patch) | |
tree | cd2d15ad3fc41eaec5cdcaf27750d6f17367e18a /src/index.ts | |
parent | 09de14b4812e82ff30dae2e1d6b892bc1d076d09 (diff) | |
download | netflix-immersive-c692a0a50ac8af8849e22dbca0326c274e50db38.tar.bz2 |
Automatically click the "Watch Credits" button
TV series on Netflix now display a "Watch Credits" button when the
credits start rolling.
We can hide this button using CSS and the credits will continue playing
to the end, but while it's displayed, the player controls are hidden.
Automatically click the button to make it go away and reactivate the
player controls.
The tricky thing, though, is that the "Watch Credits" button doesn't
have a click handler. Instead, it listens to the "pointerdown" event, so
we have to construct one programmatically (and turn on `bubbles`,
otherwise the button doesn't react to the event) and dispatch it.
Moved `with_player` to `wait_element`, because now I need to wait for
more DOM elements than just the player element.
Add a new `controls` module since I need to hide the player controls in
both `fullscreen_credits` and `watch_credits`.
Add the `DOM` lib to `tsconfig.json` to give us DOM types.
Diffstat (limited to 'src/index.ts')
-rw-r--r-- | src/index.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/index.ts b/src/index.ts index 504a7d7..0097f62 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ import fullscreen_credits from './fullscreen_credits'; +import watch_credits from './watch_credits'; import { styles } from './styles'; fullscreen_credits(); +watch_credits(); styles(); |