Skip to content

Commit

Permalink
fix: update names for custom class for inset support in old browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosVillasenor committed Aug 21, 2024
1 parent a43d069 commit db21cc1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/css/components/_text-track.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ video::-webkit-media-text-track-display {
width: 80% !important;
}

.video-js .inset-alternative {
.video-js .vjs-text-track-display-inset {
top: 0;
right: 0;
bottom: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks/text-track-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class TextTrackDisplay extends Component {
textTrackDisplay.style = '';

// Add custom class to textTrackDisplay div child for not inset support styles
textTrackDisplay.firstChild.classList.add('inset-alternative');
textTrackDisplay.firstChild.classList.add('vjs-text-track-display-inset');

// textrack style updates, this styles are required to be inline
tryUpdateStyle(textTrackDisplay, 'position', 'relative');
Expand Down
2 changes: 1 addition & 1 deletion test/unit/tracks/text-track-display.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ if (!Html5.supportsNativeTextTracks()) {
assert.ok(player.textTrackDisplay.el_.querySelector('.vjs-text-track-cue').style.left === 'unset', 'Style of left for vjs-text-track-cue element should be unset');
assert.ok(player.textTrackDisplay.el_.querySelector('.vjs-text-track-cue').style.top === '1px', 'Style of top for vjs-text-track-cue element should be 1px');
assert.ok(player.textTrackDisplay.el_.querySelector('.vjs-text-track-cue').style.right === '2px', 'Style of right for vjs-text-track-cue element should be 2px');
assert.ok(player.textTrackDisplay.el_.firstChild.classList.contains('inset-alternative'), 'Child of textTrackDisplay should contain class of inset-alternative');
assert.ok(player.textTrackDisplay.el_.firstChild.classList.contains('vjs-text-track-display-inset'), 'Child of textTrackDisplay should contain class of inset-alternative');
player.dispose();
});
}

0 comments on commit db21cc1

Please sign in to comment.