settings-dialog.ts 866 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import videojs, { VideoJsPlayer } from 'video.js'
  2. const Component = videojs.getComponent('Component')
  3. class SettingsDialog extends Component {
  4. constructor (player: VideoJsPlayer) {
  5. super(player)
  6. this.hide()
  7. }
  8. /**
  9. * Create the component's DOM element
  10. *
  11. * @return {Element}
  12. * @method createEl
  13. */
  14. createEl () {
  15. const uniqueId = this.id()
  16. const dialogLabelId = 'TTsettingsDialogLabel-' + uniqueId
  17. const dialogDescriptionId = 'TTsettingsDialogDescription-' + uniqueId
  18. return super.createEl('div', {
  19. className: 'vjs-settings-dialog vjs-modal-overlay',
  20. innerHTML: '',
  21. tabIndex: -1
  22. }, {
  23. 'role': 'dialog',
  24. 'aria-labelledby': dialogLabelId,
  25. 'aria-describedby': dialogDescriptionId
  26. })
  27. }
  28. }
  29. Component.registerComponent('SettingsDialog', SettingsDialog)
  30. export { SettingsDialog }