Skip to content

Commit

Permalink
fix: regression with AD audio track menu items (#7559)
Browse files Browse the repository at this point in the history
In #7337, a lot of code was updated to no longer user innerHTML, but we
accidentally caused an issue with Audio Description (AD) tracks where
the track title was included twice. Once before and once after the AD
icon.

This is because we were calling `super.createEl()` but MenuItem created
a specific element and didn't just pass things the arguments along.
Instead, we should use `Dom.createEl()` directly.

Fixes #7556
  • Loading branch information
gkatsev authored Dec 8, 2021
1 parent 3c21345 commit 1d4bad8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import MenuItem from '../../menu/menu-item.js';
import Component from '../../component.js';
import * as Dom from '../../utils/dom.js';

/**
* An {@link AudioTrack} {@link MenuItem}
Expand Down Expand Up @@ -49,14 +50,14 @@ class AudioTrackMenuItem extends MenuItem {
const parentSpan = el.querySelector('.vjs-menu-item-text');

if (this.options_.track.kind === 'main-desc') {
parentSpan.appendChild(super.createEl('span', {
parentSpan.appendChild(Dom.createEl('span', {
className: 'vjs-icon-placeholder'
}, {
'aria-hidden': true
}));
parentSpan.appendChild(super.createEl('span', {
parentSpan.appendChild(Dom.createEl('span', {
className: 'vjs-control-text',
textContent: this.localize('Descriptions')
textContent: ' ' + this.localize('Descriptions')
}));
}

Expand Down

0 comments on commit 1d4bad8

Please sign in to comment.