diff options
Diffstat (limited to 'client/src/assets/player/settings-menu-button.ts')
-rw-r--r-- | client/src/assets/player/settings-menu-button.ts | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/client/src/assets/player/settings-menu-button.ts b/client/src/assets/player/settings-menu-button.ts index f0ccb5862..aa7281727 100644 --- a/client/src/assets/player/settings-menu-button.ts +++ b/client/src/assets/player/settings-menu-button.ts | |||
@@ -1,7 +1,10 @@ | |||
1 | // Author: Yanko Shterev | 1 | // Author: Yanko Shterev |
2 | // Thanks https://github.com/yshterev/videojs-settings-menu | 2 | // Thanks https://github.com/yshterev/videojs-settings-menu |
3 | 3 | ||
4 | const videojs = require('video.js') | 4 | // FIXME: something weird with our path definition in tsconfig and typings |
5 | // @ts-ignore | ||
6 | import * as videojs from 'video.js' | ||
7 | |||
5 | import { SettingsMenuItem } from './settings-menu-item' | 8 | import { SettingsMenuItem } from './settings-menu-item' |
6 | import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' | 9 | import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' |
7 | import { toTitleCase } from './utils' | 10 | import { toTitleCase } from './utils' |
@@ -11,7 +14,7 @@ const Menu: VideoJSComponentInterface = videojsUntyped.getComponent('Menu') | |||
11 | const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component') | 14 | const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component') |
12 | 15 | ||
13 | class SettingsButton extends Button { | 16 | class SettingsButton extends Button { |
14 | constructor (player: any, options: any) { | 17 | constructor (player: videojs.Player, options: any) { |
15 | super(player, options) | 18 | super(player, options) |
16 | 19 | ||
17 | this.playerComponent = player | 20 | this.playerComponent = player |
@@ -48,7 +51,7 @@ class SettingsButton extends Button { | |||
48 | } | 51 | } |
49 | } | 52 | } |
50 | 53 | ||
51 | onDisposeSettingsItem (name: string) { | 54 | onDisposeSettingsItem (event: any, name: string) { |
52 | if (name === undefined) { | 55 | if (name === undefined) { |
53 | let children = this.menu.children() | 56 | let children = this.menu.children() |
54 | 57 | ||
@@ -74,7 +77,7 @@ class SettingsButton extends Button { | |||
74 | } | 77 | } |
75 | } | 78 | } |
76 | 79 | ||
77 | onAddSettingsItem (data: any) { | 80 | onAddSettingsItem (event: any, data: any) { |
78 | const [ entry, options ] = data | 81 | const [ entry, options ] = data |
79 | 82 | ||
80 | this.addMenuItem(entry, options) | 83 | this.addMenuItem(entry, options) |
@@ -218,7 +221,7 @@ class SettingsButton extends Button { | |||
218 | } | 221 | } |
219 | 222 | ||
220 | class SettingsPanel extends Component { | 223 | class SettingsPanel extends Component { |
221 | constructor (player: any, options: any) { | 224 | constructor (player: videojs.Player, options: any) { |
222 | super(player, options) | 225 | super(player, options) |
223 | } | 226 | } |
224 | 227 | ||
@@ -232,7 +235,7 @@ class SettingsPanel extends Component { | |||
232 | } | 235 | } |
233 | 236 | ||
234 | class SettingsPanelChild extends Component { | 237 | class SettingsPanelChild extends Component { |
235 | constructor (player: any, options: any) { | 238 | constructor (player: videojs.Player, options: any) { |
236 | super(player, options) | 239 | super(player, options) |
237 | } | 240 | } |
238 | 241 | ||
@@ -246,7 +249,7 @@ class SettingsPanelChild extends Component { | |||
246 | } | 249 | } |
247 | 250 | ||
248 | class SettingsDialog extends Component { | 251 | class SettingsDialog extends Component { |
249 | constructor (player: any, options: any) { | 252 | constructor (player: videojs.Player, options: any) { |
250 | super(player, options) | 253 | super(player, options) |
251 | this.hide() | 254 | this.hide() |
252 | } | 255 | } |