File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -236,14 +236,29 @@ Object.assign(MediaElementPlayer.prototype, {
236236 labels = player . qualitiesContainer . querySelectorAll ( `.${ t . options . classPrefix } qualities-selector-label` )
237237 ;
238238
239+ let lastShowChange = Date . now ( ) ;
239240 function hideSelector ( ) {
241+ const now = Date . now ( ) ;
242+ const diff = now - lastShowChange ;
243+ if ( diff < 16 ) {
244+ return ;
245+ }
246+ lastShowChange = now ;
247+
240248 mejs . Utils . addClass ( qualitiesSelector , `${ t . options . classPrefix } offscreen` ) ;
241249 qualityButton . setAttribute ( 'aria-expanded' , 'false' ) ;
242250 qualityButton . focus ( ) ;
243251 isHidden = true ;
244252 }
245253
246254 function showSelector ( ) {
255+ const now = Date . now ( ) ;
256+ const diff = now - lastShowChange ;
257+ if ( diff < 16 ) {
258+ return ;
259+ }
260+ lastShowChange = now ;
261+
247262 mejs . Utils . removeClass ( qualitiesSelector , `${ t . options . classPrefix } offscreen` ) ;
248263 qualitiesSelector . style . height = `${ qualitiesSelector . querySelector ( 'ul' ) . offsetHeight } px` ;
249264 qualitiesSelector . style . top = `${ ( - 1 * parseFloat ( qualitiesSelector . offsetHeight ) ) } px` ;
You can’t perform that action at this time.
0 commit comments