Skip to content

Commit

Permalink
Workaround setting protocol on external player url (stashapp#4403)
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored and halkeye committed Sep 1, 2024
1 parent d109d97 commit c02641a
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
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 (
Expand Down

0 comments on commit c02641a

Please sign in to comment.