aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/settings-menu-button.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/settings-menu-button.ts')
-rw-r--r--client/src/assets/player/settings-menu-button.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/client/src/assets/player/settings-menu-button.ts b/client/src/assets/player/settings-menu-button.ts
index b51c52506..f0ccb5862 100644
--- a/client/src/assets/player/settings-menu-button.ts
+++ b/client/src/assets/player/settings-menu-button.ts
@@ -1,7 +1,7 @@
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
4import * as videojs from 'video.js' 4const videojs = require('video.js')
5import { SettingsMenuItem } from './settings-menu-item' 5import { SettingsMenuItem } from './settings-menu-item'
6import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' 6import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
7import { toTitleCase } from './utils' 7import { toTitleCase } from './utils'
@@ -11,7 +11,7 @@ const Menu: VideoJSComponentInterface = videojsUntyped.getComponent('Menu')
11const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component') 11const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component')
12 12
13class SettingsButton extends Button { 13class SettingsButton extends Button {
14 constructor (player: videojs.Player, options) { 14 constructor (player: any, options: any) {
15 super(player, options) 15 super(player, options)
16 16
17 this.playerComponent = player 17 this.playerComponent = player
@@ -48,7 +48,7 @@ class SettingsButton extends Button {
48 } 48 }
49 } 49 }
50 50
51 onDisposeSettingsItem (event, name: string) { 51 onDisposeSettingsItem (name: string) {
52 if (name === undefined) { 52 if (name === undefined) {
53 let children = this.menu.children() 53 let children = this.menu.children()
54 54
@@ -74,7 +74,7 @@ class SettingsButton extends Button {
74 } 74 }
75 } 75 }
76 76
77 onAddSettingsItem (event, data) { 77 onAddSettingsItem (data: any) {
78 const [ entry, options ] = data 78 const [ entry, options ] = data
79 79
80 this.addMenuItem(entry, options) 80 this.addMenuItem(entry, options)
@@ -120,7 +120,7 @@ class SettingsButton extends Button {
120 this.resetChildren() 120 this.resetChildren()
121 } 121 }
122 122
123 getComponentSize (element) { 123 getComponentSize (element: any) {
124 let width: number = null 124 let width: number = null
125 let height: number = null 125 let height: number = null
126 126
@@ -178,7 +178,7 @@ class SettingsButton extends Button {
178 this.panelChild.addChild(this.menu) 178 this.panelChild.addChild(this.menu)
179 } 179 }
180 180
181 addMenuItem (entry, options) { 181 addMenuItem (entry: any, options: any) {
182 const openSubMenu = function () { 182 const openSubMenu = function () {
183 if (videojsUntyped.dom.hasClass(this.el_, 'open')) { 183 if (videojsUntyped.dom.hasClass(this.el_, 'open')) {
184 videojsUntyped.dom.removeClass(this.el_, 'open') 184 videojsUntyped.dom.removeClass(this.el_, 'open')
@@ -218,7 +218,7 @@ class SettingsButton extends Button {
218} 218}
219 219
220class SettingsPanel extends Component { 220class SettingsPanel extends Component {
221 constructor (player: videojs.Player, options) { 221 constructor (player: any, options: any) {
222 super(player, options) 222 super(player, options)
223 } 223 }
224 224
@@ -232,7 +232,7 @@ class SettingsPanel extends Component {
232} 232}
233 233
234class SettingsPanelChild extends Component { 234class SettingsPanelChild extends Component {
235 constructor (player: videojs.Player, options) { 235 constructor (player: any, options: any) {
236 super(player, options) 236 super(player, options)
237 } 237 }
238 238
@@ -246,7 +246,7 @@ class SettingsPanelChild extends Component {
246} 246}
247 247
248class SettingsDialog extends Component { 248class SettingsDialog extends Component {
249 constructor (player: videojs.Player, options) { 249 constructor (player: any, options: any) {
250 super(player, options) 250 super(player, options)
251 this.hide() 251 this.hide()
252 } 252 }