diff --git a/common/lib/xmodule/xmodule/js/src/video/04_video_control.js b/common/lib/xmodule/xmodule/js/src/video/04_video_control.js index 63c4cd5e85..69ebaf18c6 100644 --- a/common/lib/xmodule/xmodule/js/src/video/04_video_control.js +++ b/common/lib/xmodule/xmodule/js/src/video/04_video_control.js @@ -77,6 +77,11 @@ function () { state.el.on('mousemove', state.videoControl.showControls); state.el.on('keydown', state.videoControl.showControls); } + // The state.previousFocus is used in video_speed_control to track + // the element that had the focus before it. + state.videoControl.playPauseEl.on('blur', function () { + state.previousFocus = 'playPause'; + }); } // *************************************************************** diff --git a/common/lib/xmodule/xmodule/js/src/video/07_video_volume_control.js b/common/lib/xmodule/xmodule/js/src/video/07_video_volume_control.js index b378ba7bd0..d8398ab530 100644 --- a/common/lib/xmodule/xmodule/js/src/video/07_video_volume_control.js +++ b/common/lib/xmodule/xmodule/js/src/video/07_video_volume_control.js @@ -126,7 +126,7 @@ function () { // the volume clontrol. state.volumeBlur = true; // The following field is used in video_speed_control to track - // the element that had the focus. + // the element that had the focus before it. state.previousFocus = 'volume'; }); } diff --git a/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js b/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js index 687359c183..d9b9c300df 100644 --- a/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js +++ b/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js @@ -188,7 +188,7 @@ function () { // If we are tabbing forward (previous focus is empty ie // play button), we open the dialog and set focus on the // first speed entry. - if (state.previousFocus === '') { + if (state.previousFocus === 'playPause') { state.videoSpeedControl.el.addClass('open'); state.videoSpeedControl.videoSpeedsEl .find('a.speed_link:first') @@ -205,7 +205,6 @@ function () { .focus(); } - state.previousFocus = ''; });