| |
| |
| |
| import TextTrackMenuItem from './text-track-menu-item.js'; |
| import Component from '../../component.js'; |
| import {createEl} from '../../utils/dom.js'; |
| |
| |
| |
| |
| |
| |
| |
| class SubsCapsMenuItem extends TextTrackMenuItem { |
| |
| createEl(type, props, attrs) { |
| const el = super.createEl(type, props, attrs); |
| const parentSpan = el.querySelector('.vjs-menu-item-text'); |
| |
| if (this.options_.track.kind === 'captions') { |
| if (this.player_.options_.experimentalSvgIcons) { |
| this.setIcon('captions', el); |
| } else { |
| parentSpan.appendChild(createEl('span', { |
| className: 'vjs-icon-placeholder' |
| }, { |
| 'aria-hidden': true |
| })); |
| } |
| parentSpan.appendChild(createEl('span', { |
| className: 'vjs-control-text', |
| |
| |
| textContent: ` ${this.localize('Captions')}` |
| })); |
| } |
| |
| return el; |
| } |
| } |
| |
| Component.registerComponent('SubsCapsMenuItem', SubsCapsMenuItem); |
| export default SubsCapsMenuItem; |