Workaround setting protocol on external player url (#4403)

This commit is contained in:
WithoutPants
2023-12-29 14:26:30 +11:00
committed by GitHub
parent f8a93789bb
commit 5a6504b4ba

View File

@@ -32,15 +32,21 @@ export const ExternalPlayerButton: React.FC<IExternalPlayerButtonProps> = ({
streamURL.hash = `Intent;action=android.intent.action.VIEW;scheme=${scheme};type=video/mp4;S.title=${encodeURI( streamURL.hash = `Intent;action=android.intent.action.VIEW;scheme=${scheme};type=video/mp4;S.title=${encodeURI(
title title
)};end`; )};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) { } else if (isAppleDevice) {
streamURL.host = "x-callback-url"; streamURL.host = "x-callback-url";
streamURL.port = ""; streamURL.port = "";
streamURL.pathname = "stream"; streamURL.pathname = "stream";
streamURL.search = `url=${encodeURIComponent(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 ( return (