From 9b91c05a8ff5c34148e79860236afcb7eef1f48c Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Fri, 29 Dec 2023 14:08:15 +1100 Subject: [PATCH] Workaround setting protocol on external player url --- .../Scenes/SceneDetails/ExternalPlayerButton.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/v2.5/src/components/Scenes/SceneDetails/ExternalPlayerButton.tsx b/ui/v2.5/src/components/Scenes/SceneDetails/ExternalPlayerButton.tsx index eef8db91421..b17dfb6bb3f 100644 --- a/ui/v2.5/src/components/Scenes/SceneDetails/ExternalPlayerButton.tsx +++ b/ui/v2.5/src/components/Scenes/SceneDetails/ExternalPlayerButton.tsx @@ -32,15 +32,21 @@ export const ExternalPlayerButton: React.FC = ({ streamURL.hash = `Intent;action=android.intent.action.VIEW;scheme=${scheme};type=video/mp4;S.title=${encodeURI( title )};end`; - streamURL.protocol = "intent"; - url = streamURL.toString(); + + // #4401 - not allowed to set the protocol from a "special" protocol to a non-special protocol + url = streamURL + .toString() + .replace(new RegExp(`^${streamURL.protocol}`), "intent:"); } else if (isAppleDevice) { streamURL.host = "x-callback-url"; streamURL.port = ""; streamURL.pathname = "stream"; streamURL.search = `url=${encodeURIComponent(stream)}`; - streamURL.protocol = "vlc-x-callback"; - url = streamURL.toString(); + + // #4401 - not allowed to set the protocol from a "special" protocol to a non-special protocol + url = streamURL + .toString() + .replace(new RegExp(`^${streamURL.protocol}`), "vlc-x-callback:"); } return (