From 671325dd176c8a6c04a180a5a61a823e3a822c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Renaud-Allaire?= Date: Tue, 24 Jul 2018 16:36:25 -0400 Subject: Add support for YouTube's hl param --- src/js/plugins/youtube.js | 1 + src/js/plyr.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index b521be3c..99a505c5 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -188,6 +188,7 @@ const youtube = { videoId, playerVars: { autoplay: player.config.autoplay ? 1 : 0, // Autoplay + hl: player.config.hl, // iframe interface language controls: player.supported.ui ? 0 : 1, // Only show controls if not fully supported rel: 0, // No related vids showinfo: 0, // Hide info diff --git a/src/js/plyr.js b/src/js/plyr.js index 0f27b750..6d321112 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -171,7 +171,7 @@ class Plyr { this.elements.container.className = ''; // Get attributes from URL and set config - if (url.searchParams.length) { + if (url.search.length) { const truthy = ['1', 'true']; if (truthy.includes(url.searchParams.get('autoplay'))) { @@ -185,6 +185,7 @@ class Plyr { // YouTube requires the playsinline in the URL if (this.isYouTube) { this.config.playsinline = truthy.includes(url.searchParams.get('playsinline')); + this.config.hl = url.searchParams.get('hl'); } else { this.config.playsinline = true; } -- cgit v1.2.3 From 24deff0e2d6f85cfb9a0dfc19444aa66edf8d469 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Sat, 28 Jul 2018 03:54:10 +0200 Subject: Fix #1108: Make sure youtube.onReady doesn't run twice --- src/js/plugins/youtube.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index b521be3c..d380df80 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -239,6 +239,10 @@ const youtube = { triggerEvent.call(player, player.media, 'ratechange'); }, onReady(event) { + // Bail if onReady has already been called. See issue #1108 + if (is.function(player.media.play)) { + return; + } // Get the instance const instance = event.target; -- cgit v1.2.3 From 5eda4985160b168464ac62ba174a847cbc099f7c Mon Sep 17 00:00:00 2001 From: mjfwebb Date: Sun, 29 Jul 2018 22:02:16 +0200 Subject: If the plyr__controls is empty it is still showing the transition causing captions to be pushed up when hovering over where the controls would be. This change hides the plyr__controls div when it is empty. --- src/sass/components/controls.scss | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/sass/components/controls.scss b/src/sass/components/controls.scss index 9b203f43..4ed5b28a 100644 --- a/src/sass/components/controls.scss +++ b/src/sass/components/controls.scss @@ -109,3 +109,7 @@ .plyr--fullscreen-enabled [data-plyr='fullscreen'] { display: inline-block; } + +.plyr__controls:empty { + display: none; +} \ No newline at end of file -- cgit v1.2.3 From e5e169a1e2edf53a90913b838f4c9d59c011aa12 Mon Sep 17 00:00:00 2001 From: Albin Larsson Date: Mon, 30 Jul 2018 01:02:13 +0200 Subject: Don't move caption up when "showing" the lower controls when the controls are empty --- src/js/controls.js | 9 +++------ src/sass/components/controls.scss | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/js/controls.js b/src/js/controls.js index 2bc8b4de..e95cfc86 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -1455,12 +1455,9 @@ const controls = { target = this.elements.container; } - // Inject controls HTML - if (is.element(container)) { - target.appendChild(container); - } else if (container) { - target.insertAdjacentHTML('beforeend', container); - } + // Inject controls HTML (needs to be before captions, hence "afterbegin") + const insertMethod = is.element(container) ? 'insertAdjacentElement' : 'insertAdjacentHTML'; + target[insertMethod]('afterbegin', container); // Find the elements if need be if (!is.element(this.elements.controls)) { diff --git a/src/sass/components/controls.scss b/src/sass/components/controls.scss index 4ed5b28a..91f332df 100644 --- a/src/sass/components/controls.scss +++ b/src/sass/components/controls.scss @@ -112,4 +112,7 @@ .plyr__controls:empty { display: none; -} \ No newline at end of file + ~ .plyr__captions { + transform: translateY(0px); + } +} -- cgit v1.2.3 From e1780a4df0fb5c5d20001ddf59f7006c64bf9afc Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Mon, 30 Jul 2018 22:44:19 +1000 Subject: Fix for redraw issue --- src/sass/lib/mixins.scss | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/sass/lib/mixins.scss b/src/sass/lib/mixins.scss index 8b333f65..7bbf94f5 100644 --- a/src/sass/lib/mixins.scss +++ b/src/sass/lib/mixins.scss @@ -28,7 +28,6 @@ border: 0; border-radius: ($plyr-range-track-height / 2); height: $plyr-range-track-height; - transition: all 0.3s ease; user-select: none; } -- cgit v1.2.3 From 021ba0b8e911184e06b3010cb00f66f5691aec0e Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Mon, 30 Jul 2018 22:46:48 +1000 Subject: Update controls.scss --- src/sass/components/controls.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sass/components/controls.scss b/src/sass/components/controls.scss index 91f332df..d06cb232 100644 --- a/src/sass/components/controls.scss +++ b/src/sass/components/controls.scss @@ -112,7 +112,8 @@ .plyr__controls:empty { display: none; + ~ .plyr__captions { - transform: translateY(0px); + transform: translateY(0); } } -- cgit v1.2.3 From 2679c5898edd534d19b5b2f68d895641c3e3fb1a Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Mon, 30 Jul 2018 22:55:34 +1000 Subject: v3.2.23 --- src/js/plyr.js | 2 +- src/js/plyr.polyfilled.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/js/plyr.js b/src/js/plyr.js index 6d321112..65b6c94d 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr -// plyr.js v3.3.22 +// plyr.js v3.3.23 // https://github.com/sampotts/plyr // License: The MIT License (MIT) // ========================================================================== diff --git a/src/js/plyr.polyfilled.js b/src/js/plyr.polyfilled.js index 574ad5e5..7553ee91 100644 --- a/src/js/plyr.polyfilled.js +++ b/src/js/plyr.polyfilled.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr Polyfilled Build -// plyr.js v3.3.22 +// plyr.js v3.3.23 // https://github.com/sampotts/plyr // License: The MIT License (MIT) // ========================================================================== -- cgit v1.2.3