feat(a11y): Added roles and labels to the playback controls (#2167)
This commit is contained in:
@@ -610,6 +610,8 @@ function renderPlayerControls (state) {
|
|||||||
key='skip-previous'
|
key='skip-previous'
|
||||||
className={'icon skip-previous float-left ' + prevClass}
|
className={'icon skip-previous float-left ' + prevClass}
|
||||||
onClick={dispatcher('previousTrack')}
|
onClick={dispatcher('previousTrack')}
|
||||||
|
role='button'
|
||||||
|
aria-label='Previous track'
|
||||||
>
|
>
|
||||||
skip_previous
|
skip_previous
|
||||||
</i>,
|
</i>,
|
||||||
@@ -618,6 +620,8 @@ function renderPlayerControls (state) {
|
|||||||
key='play'
|
key='play'
|
||||||
className='icon play-pause float-left'
|
className='icon play-pause float-left'
|
||||||
onClick={dispatcher('playPause')}
|
onClick={dispatcher('playPause')}
|
||||||
|
role='button'
|
||||||
|
aria-label={state.playing.isPaused ? 'Play' : 'Pause'}
|
||||||
>
|
>
|
||||||
{state.playing.isPaused ? 'play_arrow' : 'pause'}
|
{state.playing.isPaused ? 'play_arrow' : 'pause'}
|
||||||
</i>,
|
</i>,
|
||||||
@@ -626,6 +630,8 @@ function renderPlayerControls (state) {
|
|||||||
key='skip-next'
|
key='skip-next'
|
||||||
className={'icon skip-next float-left ' + nextClass}
|
className={'icon skip-next float-left ' + nextClass}
|
||||||
onClick={dispatcher('nextTrack')}
|
onClick={dispatcher('nextTrack')}
|
||||||
|
role='button'
|
||||||
|
aria-label='Next track'
|
||||||
>
|
>
|
||||||
skip_next
|
skip_next
|
||||||
</i>,
|
</i>,
|
||||||
@@ -634,6 +640,8 @@ function renderPlayerControls (state) {
|
|||||||
key='fullscreen'
|
key='fullscreen'
|
||||||
className='icon fullscreen float-right'
|
className='icon fullscreen float-right'
|
||||||
onClick={dispatcher('toggleFullScreen')}
|
onClick={dispatcher('toggleFullScreen')}
|
||||||
|
role='button'
|
||||||
|
aria-label={state.window.isFullScreen ? 'Exit full screen' : 'Enter full screen'}
|
||||||
>
|
>
|
||||||
{state.window.isFullScreen ? 'fullscreen_exit' : 'fullscreen'}
|
{state.window.isFullScreen ? 'fullscreen_exit' : 'fullscreen'}
|
||||||
</i>
|
</i>
|
||||||
@@ -646,6 +654,8 @@ function renderPlayerControls (state) {
|
|||||||
key='subtitles'
|
key='subtitles'
|
||||||
className={'icon closed-caption float-right ' + captionsClass}
|
className={'icon closed-caption float-right ' + captionsClass}
|
||||||
onClick={handleSubtitles}
|
onClick={handleSubtitles}
|
||||||
|
role='button'
|
||||||
|
aria-label='Closed captions'
|
||||||
>
|
>
|
||||||
closed_caption
|
closed_caption
|
||||||
</i>
|
</i>
|
||||||
@@ -727,6 +737,8 @@ function renderPlayerControls (state) {
|
|||||||
<i
|
<i
|
||||||
className='icon volume-icon float-left'
|
className='icon volume-icon float-left'
|
||||||
onMouseDown={handleVolumeMute}
|
onMouseDown={handleVolumeMute}
|
||||||
|
role='button'
|
||||||
|
aria-label='Mute'
|
||||||
>
|
>
|
||||||
{volumeIcon}
|
{volumeIcon}
|
||||||
</i>
|
</i>
|
||||||
|
|||||||
Reference in New Issue
Block a user