Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(accessibility): By default, show track selection buttons at all responsive breakpoints #7603

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 15 additions & 21 deletions src/css/components/_adaptive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
// - Play button
// - Volume Mute button
// - Progress bar
// - Subs-Caps button
// - Track buttons
// - Native PiP button
// - Fullscreen button
//
// When the player is "small", display only:
// When the player is "x-small", display only:
// - Play button
// - Volume Mute button
// - Progress bar
// - Spacer
// - Track buttons
// - Native PiP button
// - Fullscreen button
//
// When the player is "tiny", display only:
// - Play button
// - Volume Mute button
// - Track buttons
// - Native PiP button
// - Fullscreen Button
//
.video-js {
Expand All @@ -28,11 +33,6 @@
.vjs-duration,
.vjs-remaining-time,
.vjs-playback-rate,
.vjs-chapters-button,
.vjs-descriptions-button,
.vjs-captions-button,
.vjs-subtitles-button,
.vjs-audio-button,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of simply showing the subtitles/captions button, show all track selection buttons, by default. This seemed more prudent in the light of accessibility concerns.

.vjs-volume-control {
display: none;
}
Expand All @@ -50,20 +50,18 @@
}
}

// Hide the subs-caps button for non-Live UI "x-small" and for "tiny" players.
&.vjs-layout-x-small:not(.vjs-liveui),
&.vjs-layout-x-small:not(.vjs-live),
// At x-small and tiny, the progress control is too narrow to be useful.
&.vjs-layout-x-small,
&.vjs-layout-tiny {
.vjs-subs-caps-button {

.vjs-progress-control {
Comment on lines +53 to +57
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Progress control is now hidden in all cases of x-small.

display: none;
}
}

// With the new Live UI, we can have the same treatment as "tiny". At
// "x-small", the Live UI makes the progress control very small and almost
// useless.
&.vjs-layout-x-small.vjs-liveui,
&.vjs-layout-tiny {
// At x-small, the buttons alone leave a large gap on the right. Fill it with
// the spacer element.
&.vjs-layout-x-small {
Comment on lines +62 to +64
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with the progress control hidden, there is still some real estate left in some cases at x-small, so instead of a large gap on the right, use the spacer element in the middle to fill the real estate.


.vjs-custom-control-spacer {
@include flex(auto);
Expand All @@ -73,9 +71,5 @@
&.vjs-no-flex .vjs-custom-control-spacer {
width: auto;
}

.vjs-progress-control {
display: none;
}
}
}