From 8494d49b96104255966b088b0f6a7d2ac1883dfb Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Thu, 3 Feb 2022 01:46:08 -0500 Subject: [PATCH] Fix issue where wrong plugin could be disabled --- src/scripts/site.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/site.js b/src/scripts/site.js index 232f29a167..ccfbe9d308 100644 --- a/src/scripts/site.js +++ b/src/scripts/site.js @@ -137,11 +137,11 @@ function loadPlugins() { return getPlugins().then(function (list) { if (!appHost.supports('remotecontrol')) { // Disable remote player plugins if not supported - list.splice(list.indexOf('sessionPlayer'), 1); - list.splice(list.indexOf('chromecastPlayer'), 1); + list = list.filter(plugin => !plugin.startsWith('sessionPlayer') + && !plugin.startsWith('chromecastPlayer')); } else if (!browser.chrome && !browser.edgeChromium && !browser.opera) { // Disable chromecast player in unsupported browsers - list.splice(list.indexOf('chromecastPlayer'), 1); + list = list.filter(plugin => !plugin.startsWith('chromecastPlayer')); } // add any native plugins