Skip to content

Commit

Permalink
fix(a11y): video player thumbnail has no text alternative (#1486)
Browse files Browse the repository at this point in the history
* fix(a11ty): video player thumnail has no text alternative

* fix: resolve commnents

* fix(a11ty): resolve comments
  • Loading branch information
arturfrombox authored Jul 10, 2023
1 parent 2d91e38 commit bd3935b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/icons/play_48px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/lib/viewers/media/VideoBaseViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ class VideoBaseViewer extends MediaBaseViewer {
this.mediaEl.setAttribute('playsinline', '');

// Play button
this.playButtonEl = this.mediaContainerEl.appendChild(document.createElement('div'));
this.playButtonEl = this.mediaContainerEl.appendChild(document.createElement('button'));
this.playButtonEl.classList.add(CLASS_PLAY_BUTTON);
this.playButtonEl.classList.add(CLASS_HIDDEN);
this.playButtonEl.setAttribute('type', 'button');
this.playButtonEl.setAttribute('title', __('media_play'));
this.playButtonEl.innerHTML = ICON_PLAY_LARGE;

this.lowerLights();
Expand Down
13 changes: 12 additions & 1 deletion src/lib/viewers/media/_mediaBase.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
@import '../../boxuiVariables';
@import './MediaControls';

// Reset default styling that come from the “User Agent Stylesheet”
@mixin bp-reset-default-styling-button {
padding: 0;
color: inherit;
font: inherit;
background: none;
border: none;
cursor: pointer;
}

.bp-media {
position: absolute;
top: 0;
Expand Down Expand Up @@ -31,12 +41,13 @@
}

.bp-media-play-button {
@include bp-reset-default-styling-button;

position: absolute;
top: 50%;
left: 50%;
width: 80px;
height: 80px;
padding-top: 12px;
color: $white;
font-size: 40px;
text-align: center;
Expand Down

0 comments on commit bd3935b

Please sign in to comment.