@@ -209,7 +209,7 @@ class Volume extends Component<any, any> {
209
209
* @returns {void }
210
210
* @memberof Volume
211
211
*/
212
- handleKeydown ( event : KeyboardEvent ) : void {
212
+ handleKeydown ( event : KeyboardEvent , preventMute = false ) : void {
213
213
const { player} = this . props ;
214
214
/**
215
215
* Change volume operations.
@@ -246,7 +246,9 @@ class Volume extends Component<any, any> {
246
246
break ;
247
247
case KeyMap . ENTER :
248
248
case KeyMap . SPACE :
249
- this . toggleMute ( ) ;
249
+ if ( ! preventMute ) {
250
+ this . toggleMute ( ) ;
251
+ }
250
252
break ;
251
253
default :
252
254
break ;
@@ -419,7 +421,7 @@ class Volume extends Component<any, any> {
419
421
default :
420
422
event . preventDefault ( ) ;
421
423
event . stopPropagation ( ) ;
422
- this . handleKeydown ( event ) ;
424
+ this . handleKeydown ( event , true ) ;
423
425
break ;
424
426
}
425
427
} ;
@@ -447,8 +449,7 @@ class Volume extends Component<any, any> {
447
449
ref = { c => ( c ? ( this . _volumeControlElement = c ) : undefined ) }
448
450
className = { controlButtonClasses }
449
451
onMouseOver = { this . onMouseOver }
450
- onMouseOut = { this . onMouseOut }
451
- >
452
+ onMouseOut = { this . onMouseOut } >
452
453
< Tooltip label = { this . props . volumeLabel } type = { this . props . toolTipType ? this . props . toolTipType : ToolTipType . Left } >
453
454
< Button
454
455
tabIndex = "0"
@@ -457,9 +458,7 @@ class Volume extends Component<any, any> {
457
458
className = { style . controlButton }
458
459
onMouseUp = { this . toggleMute }
459
460
onTouchEnd = { this . onTouchEnd }
460
- onKeyDown = { this . onKeyDown }
461
- onFocus = { this . onFocus }
462
- >
461
+ onKeyDown = { this . onKeyDown } >
463
462
< Icon type = { IconType . VolumeBase } />
464
463
< Icon type = { IconType . VolumeWaves } />
465
464
< Icon type = { IconType . VolumeMute } />
@@ -471,17 +470,16 @@ class Volume extends Component<any, any> {
471
470
aria-label = { this . props . sliderAriaLabel }
472
471
onKeyDown = { this . onProgressBarKeyDown }
473
472
className = { style . volumeControlBar }
473
+ onFocus = { this . onFocus }
474
474
role = "slider"
475
475
aria-valuemin = { 0 }
476
476
aria-valuemax = { 100 }
477
477
aria-valuenow = { player . volume * 100 }
478
- aria-valuetext = { `${ player . volume * 100 } % volume ${ player . muted ? 'muted' : '' } ` }
479
- >
478
+ aria-valuetext = { `${ player . volume * 100 } % volume ${ player . muted ? 'muted' : '' } ` } >
480
479
< div
481
480
className = { style . bar }
482
481
ref = { c => ( c ? ( this . _volumeProgressBarElement = c ) : undefined ) }
483
- onMouseDown = { this . onVolumeProgressBarMouseDown }
484
- >
482
+ onMouseDown = { this . onVolumeProgressBarMouseDown } >
485
483
< div className = { style . progress } style = { { height : this . getVolumeProgressHeight ( ) } } />
486
484
</ div >
487
485
</ div >
0 commit comments