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/plyr.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/js/plyr.js') 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