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

add seperate button to adjust subtitle delay (if subtitles are present). #1731

Merged
merged 5 commits into from
May 29, 2022

Conversation

tim-vk
Copy link
Contributor

@tim-vk tim-vk commented May 22, 2022

Changes

  • Add seperate button for vlc player to set subtitle delay.
  • Allow default for aformentioned subtitle delay.

Issues
fixes #1636
fixes #1234
fixes #640

test

  • Check if button not visible if no subtitles are present.
  • Check if subtitles are changed according to setting.
  • Check default subtitle.

further improvement

It would probably be nicer to share functionality with the audio delay button: but I'm unsure what would be the nicest way to achieve that. My guess would be:

  • create a single delay-popup.xml instead of seperate audio-delay-popup.xml and subtitle-delay-popup.xml
  • similarly create a single AdjustDelayAction instead of two seperate ones
  • and 1 AdjustDelayPopup which determines if one (or both) settings should be shown & adjusts size accordingly.

Not entirely sure if that would work. And my gut feeling says that there should be a way to keep the two .xml files seperate & add a level in between that merges the two. Not entirely sure how though. Input appreciated.

Copy link
Member

@nielsvanvelzen nielsvanvelzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option only works for LibVLC right now. It must also support ExoPlayer.

@tim-vk
Copy link
Contributor Author

tim-vk commented May 24, 2022

This option only works for LibVLC right now. It must also support ExoPlayer.

ExoPlayer does not support modifying subtitle timings (see here). The reason why I chose the same type of solution as with the current audiodelay feature.

@nielsvanvelzen
Copy link
Member

Ok makes sense to only add it for libvlc then

@tim-vk
Copy link
Contributor Author

tim-vk commented May 24, 2022

Ok, so new files are converted to kotlin.

I've struggled a bit with merging the two buttons into a single button. But I got it working. I've kept that as a seperate commit but I can squash them if desired.

Fix magic numbers
Fix formatting
Remove superfluous member variables
Move all logic from `init` to constructor.
@nielsvanvelzen nielsvanvelzen added the release-highlight Pull request might be suitable for mentioning in the release blog post label May 29, 2022
@nielsvanvelzen
Copy link
Member

I've pushed some final changes so we can merge:

  • Don't use context in .show function - use the one from constructor
  • Use .dp() extension when calculating sizes
  • Don't specify types when unneccesary
  • Inline width/height properties
  • Inline (and simplify by using androidx.core-ktx extensions) setSubtitlesPresent function

Thanks for your contribution!

@nielsvanvelzen nielsvanvelzen enabled auto-merge (squash) May 29, 2022 09:09
@nielsvanvelzen nielsvanvelzen merged commit 4c2ce10 into jellyfin:master May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-highlight Pull request might be suitable for mentioning in the release blog post
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust subtitle delay in player Subtitle offset Support Subtitle offset to fix delays
3 participants