Merge pull request #1617 from edx/anton/fix-speed-menu
Video: Fix speed menu when YouTube is unavailable.
This commit is contained in:
@@ -8,6 +8,8 @@ the top. Include a label indicating the component affected.
|
||||
LMS: Beta instructor dashboard will only count actively enrolled students for
|
||||
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
|
||||
their forum posts.
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ function (VideoPlayer) {
|
||||
// function _prepareHTML5Video(state)
|
||||
// The function prepare HTML5 video, parse HTML5
|
||||
// video sources etc.
|
||||
function _prepareHTML5Video(state, html5Mode) {
|
||||
function _prepareHTML5Video(state) {
|
||||
state.parseVideoSources(
|
||||
{
|
||||
mp4: state.config.mp4Source,
|
||||
@@ -176,15 +176,13 @@ function (VideoPlayer) {
|
||||
}
|
||||
);
|
||||
|
||||
if (html5Mode) {
|
||||
state.speeds = ['0.75', '1.0', '1.25', '1.50'];
|
||||
state.videos = {
|
||||
'0.75': state.config.sub,
|
||||
'1.0': state.config.sub,
|
||||
'1.25': state.config.sub,
|
||||
'1.5': state.config.sub
|
||||
};
|
||||
}
|
||||
state.speeds = ['0.75', '1.0', '1.25', '1.50'];
|
||||
state.videos = {
|
||||
'0.75': state.config.sub,
|
||||
'1.0': state.config.sub,
|
||||
'1.25': state.config.sub,
|
||||
'1.5': state.config.sub
|
||||
};
|
||||
|
||||
// We must have at least one non-YouTube video source available.
|
||||
// Otherwise, return a negative.
|
||||
@@ -313,7 +311,7 @@ function (VideoPlayer) {
|
||||
if (!(_parseYouTubeIDs(this))) {
|
||||
|
||||
// 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.
|
||||
return;
|
||||
|
||||
@@ -13,7 +13,7 @@ function () {
|
||||
if (state.videoType === 'html5') {
|
||||
_initialize(state);
|
||||
} else if (state.videoType === 'youtube' && state.youtubeXhr) {
|
||||
state.youtubeXhr.done(function () {
|
||||
state.youtubeXhr.always(function () {
|
||||
_initialize(state);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -94,6 +94,7 @@ def video_is_rendered(_step, mode):
|
||||
}
|
||||
html_tag = modes[mode.lower()]
|
||||
assert world.css_find('.video {0}'.format(html_tag)).first
|
||||
assert world.is_css_present('.speed_link')
|
||||
|
||||
|
||||
@step('all sources are correct$')
|
||||
|
||||
Reference in New Issue
Block a user