Skip to content

Commit 99f4869

Browse files
committed
a11y: add aria-label to controls
1 parent e1a0588 commit 99f4869

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Controls.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import './Styles.css';
55
import * as React from 'react';
66

77
import { ColorPicker } from './ColorPicker';
8-
import { PlayerState } from './Player';
8+
import { PlayerEvent, PlayerState } from './Player';
99
import { Popover } from './Popover';
1010
import { Seeker } from './Seeker';
1111

@@ -83,6 +83,7 @@ export class Controls extends React.Component<IControlProps, { mouseDown: boolea
8383
{showPlayButton && (
8484
<div
8585
role="button"
86+
aria-label={playerState === PlayerState.Playing ? PlayerEvent.Pause : PlayerEvent.Play}
8687
tabIndex={0}
8788
onClick={() => {
8889
if (playerState === PlayerState.Playing) {
@@ -125,6 +126,7 @@ export class Controls extends React.Component<IControlProps, { mouseDown: boolea
125126
<div
126127
tabIndex={0}
127128
role="button"
129+
aria-label={PlayerEvent.Stop}
128130
onClick={() => stop && stop()}
129131
onKeyDown={() => stop && stop()}
130132
className={playerState === PlayerState.Stopped ? 'lf-player-btn active' : 'lf-player-btn'}
@@ -184,6 +186,7 @@ export class Controls extends React.Component<IControlProps, { mouseDown: boolea
184186
{showRepeatButton && (
185187
<div
186188
role="button"
189+
aria-label={PlayerEvent.Loop}
187190
tabIndex={0}
188191
onClick={() => {
189192
if (instance && setLoop) {

0 commit comments

Comments
 (0)