aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/js/plyr.js35
-rw-r--r--src/less/plyr.less11
2 files changed, 23 insertions, 23 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 57ce0147..aae85c29 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1842,9 +1842,6 @@
// Set button state
_toggleState(plyr.buttons.fullscreen, plyr.isFullscreen);
- // Hide on entering full screen
- _toggleControls(false);
-
// Trigger an event
_triggerEvent(plyr.container, plyr.isFullscreen ? 'enterfullscreen' : 'exitfullscreen');
}
@@ -2182,16 +2179,19 @@
if (!config.hideControls) {
return;
}
- var isMouseMove = false;
+ var delay = false,
+ isEnterFullscreen = false,
+ show = toggle;
// Default to false if no boolean
if(typeof toggle !== "boolean") {
if(toggle && toggle.type) {
- isMouseMove = toggle.type === 'mousemove';
- toggle = _inArray(['mousemove','mouseenter'], toggle.type);
+ delay = (toggle.type === 'mousemove');
+ isEnterFullscreen = (toggle.type === 'enterfullscreen');
+ show = _inArray(['mousemove','mouseenter'], toggle.type);
}
else {
- toggle = false;
+ show = false;
}
}
@@ -2199,26 +2199,26 @@
window.clearTimeout(plyr.timers.hover);
// If the mouse is not over the controls, set a timeout to hide them
- if(toggle || plyr.media.paused) {
+ if(show || plyr.media.paused) {
_toggleClass(plyr.container, config.classes.hideControls, false);
- }
- // Always show controls when paused
- if(plyr.media.paused) {
- return;
+ // Always show controls when paused
+ if(plyr.media.paused) {
+ return;
+ }
}
// If toggle is false or if we're playing (regardless of toggle), then
// set the timer to hide the controls
- if(toggle === false || !plyr.media.paused) {
+ if(!show || !plyr.media.paused) {
plyr.timers.hover = window.setTimeout(function() {
// If the mouse is over the controls, bail
- if(plyr.controls.active) {
+ if(plyr.controls.active && !isEnterFullscreen) {
return;
}
_toggleClass(plyr.container, config.classes.hideControls, true);
- }, isMouseMove ? 2000 : 0);
+ }, delay ? 2000 : 0);
}
}
@@ -2507,8 +2507,9 @@
// Toggle controls visibility based on mouse movement
if (config.hideControls) {
- _on(plyr.container, 'mouseenter mouseleave', _toggleControls);
- _on(plyr.container, 'mousemove', _debounce(_toggleControls, 500, true));
+ _on(plyr.container, 'mouseenter mouseleave mousemove', _toggleControls);
+ //_on(plyr.container, 'mousemove', _debounce(_toggleControls, 200, true));
+ _on(plyr.container, 'enterfullscreen', _toggleControls);
// Watch for cursor over controls so they don't hide when trying to interact
_on(plyr.controls, 'mouseenter mouseleave', function(event) {
diff --git a/src/less/plyr.less b/src/less/plyr.less
index 854ec28a..e452889f 100644
--- a/src/less/plyr.less
+++ b/src/less/plyr.less
@@ -302,10 +302,10 @@
font-size: @plyr-font-size-captions-medium;
}
}
-.plyr--captions-active &__captions {
+.plyr--captions-active .plyr__captions {
display: block;
}
-.plyr--fullscreen-active &__captions {
+.plyr--fullscreen-active .plyr__captions {
font-size: @plyr-font-size-captions-large;
}
@@ -426,7 +426,7 @@
}
// Hide controls
-&.plyr--hide-controls .plyr__controls,
+.plyr--hide-controls .plyr__controls,
.plyr--playing .plyr__play-large {
visibility: hidden;
opacity: 0;
@@ -444,8 +444,8 @@
}
// Some options are hidden by default
-[data-plyr='captions'],
-[data-plyr='fullscreen'] {
+.plyr [data-plyr='captions'],
+.plyr [data-plyr='fullscreen'] {
display: none;
}
.plyr--captions-enabled [data-plyr='captions'],
@@ -622,7 +622,6 @@
color: transparent;
}
-
// Time
// --------------------------------------------------------------
.plyr__time {