]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/assets/player/videojs-components/settings-dialog.ts
dd0b1e4721343e080e8893747c34f00af5b141c3
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / videojs-components / settings-dialog.ts
1 import videojs, { VideoJsPlayer } from 'video.js'
2
3 const Component = videojs.getComponent('Component')
4
5 class SettingsDialog extends Component {
6 constructor (player: VideoJsPlayer) {
7 super(player)
8
9 this.hide()
10 }
11
12 /**
13 * Create the component's DOM element
14 *
15 * @return {Element}
16 * @method createEl
17 */
18 createEl () {
19 const uniqueId = this.id()
20 const dialogLabelId = 'TTsettingsDialogLabel-' + uniqueId
21 const dialogDescriptionId = 'TTsettingsDialogDescription-' + uniqueId
22
23 return super.createEl('div', {
24 className: 'vjs-settings-dialog vjs-modal-overlay',
25 innerHTML: '',
26 tabIndex: -1
27 }, {
28 'role': 'dialog',
29 'aria-labelledby': dialogLabelId,
30 'aria-describedby': dialogDescriptionId
31 })
32 }
33 }
34
35 Component.registerComponent('SettingsDialog', SettingsDialog)
36
37 export { SettingsDialog }