@@ -100,13 +100,6 @@ Object.assign(MediaElementPlayer.prototype, {
100100 radios = player . speedButton . querySelectorAll ( 'input[type="radio"]' ) ,
101101 labels = player . speedButton . querySelectorAll ( '.' + t . options . classPrefix + 'speed-selector-label' ) ;
102102
103- /**
104- * Store a reference to the radio buttons to prevent a scope bug in keyboard events
105- * with multiple MediaElement players are on the same page. Otherwise these keyboard
106- * events would always control the first speed button instance on the page.
107- */
108- player . speedRadioButtons = radios ;
109-
110103 for ( var _i2 = 0 , _total2 = inEvents . length ; _i2 < _total2 ; _i2 ++ ) {
111104 player . speedButton . addEventListener ( inEvents [ _i2 ] , function ( ) {
112105 mejs . Utils . removeClass ( player . speedSelector , t . options . classPrefix + 'offscreen' ) ;
@@ -161,10 +154,9 @@ Object.assign(MediaElementPlayer.prototype, {
161154 action : function action ( player , media , key , event ) {
162155 if ( event . key != '<' ) return ;
163156
164- const _radios = player . speedRadioButtons ;
165- for ( var _i7 = 0 ; _i7 < _radios . length - 1 ; _i7 ++ ) {
166- if ( _radios [ _i7 ] . checked ) {
167- var nextRadio = _radios [ _i7 + 1 ] ;
157+ for ( var _i7 = 0 ; _i7 < radios . length - 1 ; _i7 ++ ) {
158+ if ( radios [ _i7 ] . checked ) {
159+ var nextRadio = radios [ _i7 + 1 ] ;
168160 nextRadio . dispatchEvent ( mejs . Utils . createEvent ( 'click' , nextRadio ) ) ;
169161 break ;
170162 }
@@ -175,10 +167,9 @@ Object.assign(MediaElementPlayer.prototype, {
175167 action : function action ( player , media , key , event ) {
176168 if ( event . key != '>' ) return ;
177169
178- const _radios = player . speedRadioButtons ;
179- for ( var _i8 = 1 ; _i8 < _radios . length ; _i8 ++ ) {
180- if ( _radios [ _i8 ] . checked ) {
181- var prevRadio = _radios [ _i8 - 1 ] ;
170+ for ( var _i8 = 1 ; _i8 < radios . length ; _i8 ++ ) {
171+ if ( radios [ _i8 ] . checked ) {
172+ var prevRadio = radios [ _i8 - 1 ] ;
182173 prevRadio . dispatchEvent ( mejs . Utils . createEvent ( 'click' , prevRadio ) ) ;
183174 break ;
184175 }
0 commit comments