diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js index eaf21b10fd..b4d31c66db 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_caption_spec.js @@ -53,7 +53,8 @@ expect($.ajaxWithPrefix).toHaveBeenCalledWith({ url: videoCaption.captionURL(), notifyOnError: false, - success: jasmine.any(Function) + success: jasmine.any(Function), + error: jasmine.any(Function), }); }); }); @@ -462,7 +463,7 @@ }); // Temporarily disabled due to intermittent failures - // Fails with error: "InvalidStateError: An attempt was made to + // Fails with error: "InvalidStateError: An attempt was made to // use an object that is not, or is no longer, usable // Expected 0 to equal 14.91." // on Firefox diff --git a/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js b/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js index 621a2ebfe4..2ebb73c692 100644 --- a/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js +++ b/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js @@ -95,7 +95,10 @@ function () { this.videoCaption.subtitlesEl = this.el.find('ol.subtitles'); this.videoCaption.hideSubtitlesEl = this.el.find('a.hide-subtitles'); - this.videoCaption.fetchCaption(); + if (!this.videoCaption.fetchCaption()) { + this.videoCaption.hideCaptions(true); + this.videoCaption.hideSubtitlesEl.hide(); + } } // function bindHandlers() @@ -190,7 +193,6 @@ function () { console.log( 'STATUS:', textStatus + ', MESSAGE:', '' + errorThrown ); - console.log('arguments:', arguments); _this.videoCaption.hideCaptions(true); _this.videoCaption.hideSubtitlesEl.hide(); @@ -281,9 +283,8 @@ function () { } function renderCaption() { - var container, + var container = $('
    '), _this = this; - container = $('
      '); this.el.find('.video-wrapper').after(this.videoCaption.subtitlesEl); this.el.find('.video-controls .secondary-controls').append(this.videoCaption.hideSubtitlesEl);