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

Vlc player resume does not work #4027

Open
hellez opened this issue Sep 27, 2024 · 20 comments · Fixed by #4032
Open

Vlc player resume does not work #4027

hellez opened this issue Sep 27, 2024 · 20 comments · Fixed by #4032
Labels
bug Something isn't working

Comments

@hellez
Copy link

hellez commented Sep 27, 2024

Describe the bug

Since the new playback code it is no longer possible to resume while using an external player (e.g., VLC).

This might be a dupe of #1208, but this issue is already closed without any reaction to questions.

Logs

No response

Application version

0.17.5

Where did you install the app from?

None

Device information

Sony XH90

Android version

Android TV

Jellyfin server version

10.9.11

@hellez hellez added the bug Something isn't working label Sep 27, 2024
@nielsvanvelzen
Copy link
Member

There is only code that sends the resume position for MX Player and Vimu:

//Start player API params
int pos = mPosition.intValue();
external.putExtra(API_MX_SEEK_POSITION, pos);
external.putExtra(API_VIMU_SEEK_POSITION, pos);

So this is not a bug, someone will need to add additional code to support VLC.

@nielsvanvelzen nielsvanvelzen added enhancement New feature or request good-first-issue Good for newcomers and removed bug Something isn't working labels Sep 27, 2024
@tobiasgiese
Copy link

tobiasgiese commented Sep 28, 2024

I tried to debug it locally. Unfortunately, data is null when VLC returns to onActivityResult(). Or is this maybe an issue with Android Studio? I never developed anything on Android before, but I have the same issue on my TV

@nielsvanvelzen
Copy link
Member

This issue is about starting VLC, not returning from VLC.

@tobiasgiese
Copy link

tobiasgiese commented Sep 28, 2024

This issue is about starting VLC, not returning from VLC.

Are you sure? The following does work w/o any changes:

  • start a video with the ExoPlayer
  • return after some time to be able to resume
  • enable Use external player
  • resume the video, it will start from the previous position

AFAIIU the issue is only that the position will not be persisted after stopping VLC -- also the popup Mark watched pops up every time.

@nielsvanvelzen
Copy link
Member

From the issue description I assumed they meant starting playback will not resume from a specific position and the constants indicated we don't set anything specifically for VLC. Although they may overlap with extras VLC also supports.

@hellez
Copy link
Author

hellez commented Sep 28, 2024

AFAIIU the issue is only that the position will not be persisted after stopping VLC

It is exactly like this, there is no resume button in the UI

@nielsvanvelzen
Copy link
Member

There not being a resume button is an entirely different thing so I misinterpreted the original issue report. In this case it likely did not save the position properly like @tobiasgiese mentioned.

@nielsvanvelzen nielsvanvelzen added bug Something isn't working and removed good-first-issue Good for newcomers enhancement New feature or request labels Sep 28, 2024
@tobiasgiese
Copy link

I deployed the latest master to my Android TV, but sadly the issue seems still not to be fixed

@tobiasgiese
Copy link

tobiasgiese commented Sep 29, 2024

The issue is still that data is empty. Using MX Player while debugging works as expected

image

while using VLC it is not working

image

@tobiasgiese
Copy link

tobiasgiese commented Sep 29, 2024

If I set the component in ExternalPlayerActivity() correctly (according to https://wiki.videolan.org/Android_Player_Intents/#Sample_code) it is working. But this solution is not a fix as it hardcodes VLC as external player.

external.setComponent(new ComponentName("org.videolan.vlc", "org.videolan.vlc.gui.video.VideoPlayerActivity"));

Edit: And here is a closed VLC bug that is related to this issue: https://code.videolan.org/videolan/vlc-android/-/issues/2776

@nielsvanvelzen
Copy link
Member

My best guess is that we should migrate from the onActivityResult function to the newer registerForActivityResult API. We may also need to add a <queries> element to our manifest.

@MichaelRUSF
Copy link
Contributor

I just realized I was using a beta version of VLC (3.6.0 Beta 6) which includes a bugfix to the issue you linked. The current version (3.5.4) on the playstore does not include the fix. So the PR resolves this issue in version 3.6.x, but it doesn’t address it in the current version due to the upstream issue.

@nielsvanvelzen
Copy link
Member

Oh that makes sense, so it's really an upstream issue then.

@tobiasgiese
Copy link

tobiasgiese commented Sep 29, 2024

Installed VLC-Android-3.6.0-Beta-6-armv7-20240929-0126 but sadly it does not solve the issue

@tobiasgiese
Copy link

tobiasgiese commented Sep 29, 2024

Ah wait, the fix #4032 is not installed on my Android TV. In Android Studio it does work as expected 👍🏻

Edit: Double-checked by installing the latest master branch of Jellyfin on my TV and I can confirm it is working.
Thanks for the quick fix @MichaelRUSF.

@tobiasgiese
Copy link

I found another issue, maybe something that is rather another bug or even not fixable.

If I return to Home instead of back to Jellyfin the position gets lost. Is this a known bug? I am not sure if this is even able to cover. WDYT @nielsvanvelzen @MichaelRUSF

@nielsvanvelzen
Copy link
Member

When you press the home button you won't return to the Jellyfin app so we never receive any information back. This is a limitation of the Android platform and not something we can do anything about.

@tobiasgiese
Copy link

This is a limitation of the Android platform and not something we can do anything about

Okay, I thought so too. Is there a way to poll periodically to set the current position?

@nielsvanvelzen
Copy link
Member

No that's also not something we can reliably do;

  • When the external app is started, the system may kill the Jellyfin app at any time
  • When the external app is closed without returning to the Jellyfin app, the progress timer wouldn't stop

@tobiasgiese
Copy link

Okay, thanks for clarification

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.

4 participants