Commit a1e0f711 by Valera Rozuvan

Added hard-coded flag to video.html that turns on/off autohiding of captions.

Front-end functionality was not removed. When flag is set to "True", old
behaviour of autohiding of controls and captions will be enabled.
parent 9f871e53
......@@ -295,6 +295,11 @@ function (VideoPlayer) {
),
youtubeStreams: this.el.data('streams'),
autohideHtml5: (
this.el.data('autohide-html5')
.toString().toLowerCase() === 'true'
),
sub: this.el.data('sub'),
mp4Source: this.el.data('mp4-source'),
webmSource: this.el.data('webm-source'),
......@@ -307,6 +312,8 @@ function (VideoPlayer) {
availableQualities: ['hd720', 'hd1080', 'highres']
};
console.log('this.config.autohideHtml5 = ' + this.config.autohideHtml5);
// Check if the YT test timeout has been set. If not, or it is in
// improper format, then set to default value.
tempYtTestTimeout = parseInt(this.el.data('yt-test-timeout'), 10);
......
......@@ -57,7 +57,7 @@ function () {
state.videoControl.play();
}
if (state.videoType === 'html5') {
if ((state.videoType === 'html5') && (state.config.autohideHtml5)) {
state.videoControl.fadeOutTimeout = state.config.fadeOutTimeout;
state.videoControl.el.addClass('html5');
......@@ -81,7 +81,7 @@ function () {
state.videoControl.fullScreenEl.on('click', state.videoControl.toggleFullScreen);
$(document).on('keyup', state.videoControl.exitFullScreen);
if (state.videoType === 'html5') {
if ((state.videoType === 'html5') && (state.config.autohideHtml5)) {
state.el.on('mousemove', state.videoControl.showControls);
state.el.on('keydown', state.videoControl.showControls);
}
......
......@@ -152,7 +152,7 @@ function () {
this.videoCaption.onMovement
);
if (this.videoType === 'html5') {
if ((this.videoType === 'html5') && (this.config.autohideHtml5)) {
this.el.on('mousemove', this.videoCaption.autoShowCaptions);
this.el.on('keydown', this.videoCaption.autoShowCaptions);
......@@ -335,7 +335,7 @@ function () {
this.videoCaption.setSubtitlesHeight();
if (this.videoType === 'html5') {
if ((this.videoType === 'html5') && (this.config.autohideHtml5)) {
this.videoCaption.fadeOutTimeout = this.config.fadeOutTimeout;
this.videoCaption.subtitlesEl.addClass('html5');
......@@ -698,7 +698,7 @@ function () {
function setSubtitlesHeight() {
var height = 0;
if (this.videoType === 'html5'){
if ((this.videoType === 'html5') && (this.config.autohideHtml5)) {
// on page load captionHidden = undefined
if (
(
......
......@@ -26,6 +26,19 @@
data-yt-test-timeout="${yt_test_timeout}"
data-yt-test-url="${yt_test_url}"
## For now, the option "data-autohide-html5" is hard coded. This option
## either enables or disables autohiding of controls and captions on mouse
## inactivity. If set to true, controls and captions will autohide for
## HTML5 sources (non-YouTube) after a period of mouse inactivity over the
## whole video. When the mouse moves (or a key is pressed while any part of
## the video player is focused), the captions and controls will be shown
## once again.
##
## There is no option in the "Advanced Editor" to set this option. However,
## this option will have an effect if changed to "True". The code on
## front-end exists.
data-autohide-html5="False"
tabindex="-1"
>
<div class="focus_grabber first"></div>
......
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