Skip to content

Commit 00eaca9

Browse files
committed
remove the diff again. I don't think this was good.
1 parent 867c21f commit 00eaca9

File tree

1 file changed

+0
-60
lines changed

1 file changed

+0
-60
lines changed

src/speed/speed.js

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -213,22 +213,6 @@ Object.assign(MediaElementPlayer.prototype, {
213213

214214
menuIsHidden = false;
215215
}
216-
217-
/**
218-
* Store a reference to the radio buttons to prevent a scope bug in keyboard events
219-
* when multiple MediaElement players are on the same page. Otherwise these keyboard
220-
* events would always control the first speed button instance on the page.
221-
*/
222-
player.speedRadioButtons = radios;
223-
224-
// hover or keyboard focus
225-
for (let i = 0, total = inEvents.length; i < total; i++) {
226-
player.speedButton.addEventListener(inEvents[i], () => {
227-
mejs.Utils.removeClass(player.speedSelector, `${t.options.classPrefix}offscreen`);
228-
player.speedSelector.style.height = player.speedSelector.querySelector('ul').offsetHeight;
229-
player.speedSelector.style.top = `${(-1 * parseFloat(player.speedSelector.offsetHeight))}px`;
230-
});
231-
}
232216

233217
function hideMenu() {
234218
const now = Date.now();
@@ -255,7 +239,6 @@ Object.assign(MediaElementPlayer.prototype, {
255239
}
256240
}
257241

258-
259242
speedButton.addEventListener('mouseenter', showMenu);
260243

261244
player.speedContainer.addEventListener('mouseleave', hideMenu);
@@ -300,49 +283,6 @@ Object.assign(MediaElementPlayer.prototype, {
300283
function updateSpeedButtonLabel() {
301284
speedButtonLabel.innerHTML = getSpeedNameFromValue(currentPlaybackSpeed)
302285
}
303-
304-
305-
t.options.keyActions.push({
306-
/*
307-
* Need to listen for both because keyActions dispatches
308-
* based on e.which || e.keyCode instead of e.key, so we
309-
* get the same value for comma as for less than.
310-
*/
311-
keys: [60, 188], // "<" & ","
312-
action: (player, media, key, event) => {
313-
if (event.key != '<')
314-
return;
315-
316-
const _radios = player.speedRadioButtons;
317-
for (let i = 0; i < _radios.length - 1; i++) {
318-
if (_radios[i].checked) {
319-
const nextRadio = _radios[i+1];
320-
nextRadio.dispatchEvent(mejs.Utils.createEvent('click', nextRadio));
321-
break;
322-
}
323-
}
324-
}
325-
}, {
326-
keys: [62, 190], // ">" & "."
327-
action: (player, media, key, event) => {
328-
if (event.key != '>')
329-
return;
330-
331-
const _radios = player.speedRadioButtons;
332-
for (let i = 1; i < _radios.length; i++) {
333-
if (_radios[i].checked) {
334-
const prevRadio = _radios[i-1];
335-
prevRadio.dispatchEvent(mejs.Utils.createEvent('click', prevRadio));
336-
break;
337-
}
338-
}
339-
}
340-
});
341-
342-
//Allow up/down arrow to change the selected radio without changing the volume.
343-
player.speedSelector.addEventListener('keydown', (e) => {
344-
e.stopPropagation();
345-
});
346286

347287
media.addEventListener('loadedmetadata', () => {
348288
if (currentPlaybackSpeed) {

0 commit comments

Comments
 (0)