Commit f9782ff3 by polesye

Merge pull request #1617 from edx/anton/fix-speed-menu

Video: Fix speed menu when YouTube is unavailable.
parents 218fc7b0 50674a96
...@@ -8,6 +8,8 @@ the top. Include a label indicating the component affected. ...@@ -8,6 +8,8 @@ the top. Include a label indicating the component affected.
LMS: Beta instructor dashboard will only count actively enrolled students for LMS: Beta instructor dashboard will only count actively enrolled students for
course enrollment numbers. course enrollment numbers.
Blades: Blades: Fix speed menu that is not rendered correctly when YouTube is unavailable. (BLD-457).
LMS: Users with is_staff=True no longer have the STAFF label appear on LMS: Users with is_staff=True no longer have the STAFF label appear on
their forum posts. their forum posts.
......
...@@ -167,7 +167,7 @@ function (VideoPlayer) { ...@@ -167,7 +167,7 @@ function (VideoPlayer) {
// function _prepareHTML5Video(state) // function _prepareHTML5Video(state)
// The function prepare HTML5 video, parse HTML5 // The function prepare HTML5 video, parse HTML5
// video sources etc. // video sources etc.
function _prepareHTML5Video(state, html5Mode) { function _prepareHTML5Video(state) {
state.parseVideoSources( state.parseVideoSources(
{ {
mp4: state.config.mp4Source, mp4: state.config.mp4Source,
...@@ -176,15 +176,13 @@ function (VideoPlayer) { ...@@ -176,15 +176,13 @@ function (VideoPlayer) {
} }
); );
if (html5Mode) { state.speeds = ['0.75', '1.0', '1.25', '1.50'];
state.speeds = ['0.75', '1.0', '1.25', '1.50']; state.videos = {
state.videos = { '0.75': state.config.sub,
'0.75': state.config.sub, '1.0': state.config.sub,
'1.0': state.config.sub, '1.25': state.config.sub,
'1.25': state.config.sub, '1.5': state.config.sub
'1.5': state.config.sub };
};
}
// We must have at least one non-YouTube video source available. // We must have at least one non-YouTube video source available.
// Otherwise, return a negative. // Otherwise, return a negative.
...@@ -313,7 +311,7 @@ function (VideoPlayer) { ...@@ -313,7 +311,7 @@ function (VideoPlayer) {
if (!(_parseYouTubeIDs(this))) { if (!(_parseYouTubeIDs(this))) {
// If we do not have YouTube ID's, try parsing HTML5 video sources. // If we do not have YouTube ID's, try parsing HTML5 video sources.
if (!_prepareHTML5Video(this, true)) { if (!_prepareHTML5Video(this)) {
// Non-YouTube sources were not found either. // Non-YouTube sources were not found either.
return; return;
......
...@@ -13,7 +13,7 @@ function () { ...@@ -13,7 +13,7 @@ function () {
if (state.videoType === 'html5') { if (state.videoType === 'html5') {
_initialize(state); _initialize(state);
} else if (state.videoType === 'youtube' && state.youtubeXhr) { } else if (state.videoType === 'youtube' && state.youtubeXhr) {
state.youtubeXhr.done(function () { state.youtubeXhr.always(function () {
_initialize(state); _initialize(state);
}); });
} }
......
...@@ -94,6 +94,7 @@ def video_is_rendered(_step, mode): ...@@ -94,6 +94,7 @@ def video_is_rendered(_step, mode):
} }
html_tag = modes[mode.lower()] html_tag = modes[mode.lower()]
assert world.css_find('.video {0}'.format(html_tag)).first assert world.css_find('.video {0}'.format(html_tag)).first
assert world.is_css_present('.speed_link')
@step('all sources are correct$') @step('all sources are correct$')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment