Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Can't open with external player app on Android (Firefox, Chrome) #4401

Closed
kyuu840 opened this issue Dec 28, 2023 · 2 comments · Fixed by #4403
Closed

[Bug Report] Can't open with external player app on Android (Firefox, Chrome) #4401

kyuu840 opened this issue Dec 28, 2023 · 2 comments · Fixed by #4403
Labels
bug Something isn't working

Comments

@kyuu840
Copy link

kyuu840 commented Dec 28, 2023

Describe the bug
The external player button does not work on Firefox for Android 120 and 121, nor on Chrome 120. The button's link has protocol http, so Firefox and Chrome just open it itself instead of using the external apps. I tried manually forcing it to protocol intent and then it works as intended. See workaround at the bottom of the issue.

I can see the code that creates this button, here:

and it looks straightforward enough, but the fact is that the button ends up with protocol http. I'm not sure if this is a bug in Stash, or a new behavior of Firefox/Chrome when it comes to intent links.

The protocol is also wrongly http when using Firefox on Windows, with Responsive Design mode to simulate a smartphone and fake the User-agent.

When using Samsung Internet browser on Android, the bug does not happen, and the link has protocol intent as it should be, and external players work.

To Reproduce

  1. Open a scene page in Firefox for Android
  2. Press the "Open in external player" button
  3. Depending on the scene file, either Firefox will play the video by itself, or try to download it.

Expected behavior
Firefox should ask which external app to use (VLC, MX Player, ...).

Stash Version: (from Settings -> About):
v0.24.0 (3e9bd850) and v0.23.1

Desktop:

  • Unraid Docker

Smartphone:

  • OS: Android 13
  • Browsers: Firefox 121.0 and 120.0; Chrome 120
  • User-agent: Mozilla/5.0 (Android 13; Mobile; rv:120.0) Gecko/120.0 Firefox/120.0 (I didn't try playing around with Chrome's User-agent)

Workaround

  • Go to Settings > Interface > Custom Javascript
  • Enable it, and add the following code. It's ugly, but it works, and it enabled Firefox to recognize the link as an external app link for me.
// Find button with title "Open in external player", get its "a" child, and set its href protocol from http:// to intent://
function fixButton() {
    var button = document.querySelector('button[title="Open in external player"]');
    if (button) {
        var buttonA = button.querySelector('a');
        var extAppLink = buttonA.href;
        var intentLink = extAppLink.replace('http://', 'intent://');
        buttonA.href = intentLink;
    }
}

// Call it 1 second after page load
setTimeout(fixButton, 1000);
@kyuu840 kyuu840 added the bug report Bug reports that are not yet verified label Dec 28, 2023
@DoctorD1501
Copy link

I'm also having the same issue with "Open in external player" being broken on iPad. Same sort of problem, where the protocol is set as http instead of 'vlc-x-callback'.

I should note there is some general buggyness with this button appearing on firefox on iOS, even when requesting the mobile site. I tested using Safari as the button will not show on firefox on iOS no matter what I try.

@WithoutPants
Copy link
Collaborator

This looks to be due to the specification of the URL - see https://stackoverflow.com/a/77154615

It's a bit bonkers. I'm not sure why this is occurring now, but we'll have to do a bit of a hack to fix it.

@WithoutPants WithoutPants added bug Something isn't working and removed bug report Bug reports that are not yet verified labels Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants