diff options
Diffstat (limited to 'client/src/assets/player/shared/stats/stats-plugin.ts')
-rw-r--r-- | client/src/assets/player/shared/stats/stats-plugin.ts | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/client/src/assets/player/shared/stats/stats-plugin.ts b/client/src/assets/player/shared/stats/stats-plugin.ts index 8aad80e8a..86684a78c 100644 --- a/client/src/assets/player/shared/stats/stats-plugin.ts +++ b/client/src/assets/player/shared/stats/stats-plugin.ts | |||
@@ -7,10 +7,6 @@ class StatsForNerdsPlugin extends Plugin { | |||
7 | private statsCard: StatsCard | 7 | private statsCard: StatsCard |
8 | 8 | ||
9 | constructor (player: videojs.Player, options: StatsCardOptions) { | 9 | constructor (player: videojs.Player, options: StatsCardOptions) { |
10 | const settings = { | ||
11 | ...options | ||
12 | } | ||
13 | |||
14 | super(player) | 10 | super(player) |
15 | 11 | ||
16 | this.player.ready(() => { | 12 | this.player.ready(() => { |
@@ -19,7 +15,17 @@ class StatsForNerdsPlugin extends Plugin { | |||
19 | 15 | ||
20 | this.statsCard = new StatsCard(player, options) | 16 | this.statsCard = new StatsCard(player, options) |
21 | 17 | ||
22 | player.addChild(this.statsCard, settings) | 18 | // Copy options |
19 | player.addChild(this.statsCard) | ||
20 | } | ||
21 | |||
22 | dispose () { | ||
23 | if (this.statsCard) { | ||
24 | this.statsCard.dispose() | ||
25 | this.player.removeChild(this.statsCard) | ||
26 | } | ||
27 | |||
28 | super.dispose() | ||
23 | } | 29 | } |
24 | 30 | ||
25 | show () { | 31 | show () { |