Commit ba954ff1 by Valera Rozuvan

Fixing code as per suggestions on PR 771.

parent e788d6ce
...@@ -28,11 +28,9 @@ function () { ...@@ -28,11 +28,9 @@ function () {
// Depending on whether captions file could be loaded, the following // Depending on whether captions file could be loaded, the following
// function invocation can succeed or fail. If it fails, we do not // function invocation can succeed or fail. If it fails, we do not
// go on with binding handlers to events. // go on with binding handlers to events.
if (!state.videoCaption.renderElements()) { if (state.videoCaption.renderElements()) {
return; state.videoCaption.bindHandlers();
} }
state.videoCaption.bindHandlers();
}; };
// *************************************************************** // ***************************************************************
...@@ -102,9 +100,6 @@ function () { ...@@ -102,9 +100,6 @@ function () {
this.videoCaption.subtitlesEl = this.el.find('ol.subtitles'); this.videoCaption.subtitlesEl = this.el.find('ol.subtitles');
this.videoCaption.hideSubtitlesEl = this.el.find('a.hide-subtitles'); this.videoCaption.hideSubtitlesEl = this.el.find('a.hide-subtitles');
this.el.find('.video-wrapper').after(this.videoCaption.subtitlesEl);
this.el.find('.video-controls .secondary-controls').append(this.videoCaption.hideSubtitlesEl);
// Fetch the captions file. If no file was specified, then we hide // Fetch the captions file. If no file was specified, then we hide
// the "CC" button, and return. // the "CC" button, and return.
if (!this.videoCaption.fetchCaption()) { if (!this.videoCaption.fetchCaption()) {
...@@ -113,6 +108,9 @@ function () { ...@@ -113,6 +108,9 @@ function () {
return false; return false;
} }
this.el.find('.video-wrapper').after(this.videoCaption.subtitlesEl);
this.el.find('.video-controls .secondary-controls').append(this.videoCaption.hideSubtitlesEl);
this.videoCaption.setSubtitlesHeight(); this.videoCaption.setSubtitlesHeight();
if (this.videoType === 'html5') { if (this.videoType === 'html5') {
......
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