aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2017-11-21 13:12:36 +1100
committerSam Potts <me@sampotts.me>2017-11-21 13:12:36 +1100
commitedfc6cd4757217d5df9196c87d9748ad4b71d7f0 (patch)
treead3c5411826a7d4fbfc7e792a014106833bd06e7 /src/js/plyr.js
parent92cd67effb637f8b5f88bb8c62e245411171c88b (diff)
downloadplyr-edfc6cd4757217d5df9196c87d9748ad4b71d7f0.tar.lz
plyr-edfc6cd4757217d5df9196c87d9748ad4b71d7f0.tar.xz
plyr-edfc6cd4757217d5df9196c87d9748ad4b71d7f0.zip
Play button as toggle button, tooltip changes, docs updated, fullscreen fix
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r--src/js/plyr.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 4f985a31..83c1b7b8 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -710,22 +710,17 @@ class Plyr {
toggleFullscreen(event) {
// Check for native support
if (fullscreen.enabled) {
- // If it's a fullscreen change event, update the UI
if (utils.is.event(event) && event.type === fullscreen.eventType) {
+ // If it's a fullscreen change event, update the state
this.fullscreen.active = fullscreen.isFullScreen(this.elements.container);
} else {
// Else it's a user request to enter or exit
if (!this.fullscreen.active) {
- // Request full screen
fullscreen.requestFullScreen(this.elements.container);
} else {
- // Bail from fullscreen
fullscreen.cancelFullScreen();
}
- // Check if we're actually full screen (it could fail)
- this.fullscreen.active = fullscreen.isFullScreen(this.elements.container);
-
return this;
}
} else {
@@ -754,7 +749,7 @@ class Plyr {
}
// Set button state
- if (this.elements.buttons && this.elements.buttons.fullscreen) {
+ if (utils.is.htmlElement(this.elements.buttons.fullscreen)) {
utils.toggleState(this.elements.buttons.fullscreen, this.fullscreen.active);
}