diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-14 10:27:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-14 10:27:05 +0100 |
commit | 9af2accee68082e4e1160a4e4a7036451262be02 (patch) | |
tree | 50d74a901068c00cf16d65133bc0ddb842293b79 /client/src/assets/player/settings/settings-dialog.ts | |
parent | 637a10afb5d539b04a653abbe9b0309eb4cbf7c6 (diff) | |
download | PeerTube-9af2accee68082e4e1160a4e4a7036451262be02.tar.gz PeerTube-9af2accee68082e4e1160a4e4a7036451262be02.tar.zst PeerTube-9af2accee68082e4e1160a4e4a7036451262be02.zip |
Reorganize videojs components
Diffstat (limited to 'client/src/assets/player/settings/settings-dialog.ts')
-rw-r--r-- | client/src/assets/player/settings/settings-dialog.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/src/assets/player/settings/settings-dialog.ts b/client/src/assets/player/settings/settings-dialog.ts new file mode 100644 index 000000000..8cd98967f --- /dev/null +++ b/client/src/assets/player/settings/settings-dialog.ts | |||
@@ -0,0 +1,35 @@ | |||
1 | import videojs from 'video.js' | ||
2 | |||
3 | const Component = videojs.getComponent('Component') | ||
4 | |||
5 | class SettingsDialog extends Component { | ||
6 | constructor (player: videojs.Player) { | ||
7 | super(player) | ||
8 | |||
9 | this.hide() | ||
10 | } | ||
11 | |||
12 | /** | ||
13 | * Create the component's DOM element | ||
14 | * | ||
15 | */ | ||
16 | createEl () { | ||
17 | const uniqueId = this.id() | ||
18 | const dialogLabelId = 'TTsettingsDialogLabel-' + uniqueId | ||
19 | const dialogDescriptionId = 'TTsettingsDialogDescription-' + uniqueId | ||
20 | |||
21 | return super.createEl('div', { | ||
22 | className: 'vjs-settings-dialog vjs-modal-overlay', | ||
23 | innerHTML: '', | ||
24 | tabIndex: -1 | ||
25 | }, { | ||
26 | role: 'dialog', | ||
27 | 'aria-labelledby': dialogLabelId, | ||
28 | 'aria-describedby': dialogDescriptionId | ||
29 | }) | ||
30 | } | ||
31 | } | ||
32 | |||
33 | Component.registerComponent('SettingsDialog', SettingsDialog) | ||
34 | |||
35 | export { SettingsDialog } | ||