Skip to content

Implement refresh rate matching for native player#997

Open
TwoToneEddy wants to merge 3 commits into
DonutWare:developfrom
TwoToneEddy:match-fr
Open

Implement refresh rate matching for native player#997
TwoToneEddy wants to merge 3 commits into
DonutWare:developfrom
TwoToneEddy:match-fr

Conversation

@TwoToneEddy

Copy link
Copy Markdown

Pull Request Description

Ports refresh rate matching from the native Android TV client to Fladder's native player backend on Android. When a video begins playing, the display refresh rate is switched to match the video's frame rate using Surface.setFrameRate() / Window preferred display mode. Playback pauses during the mode switch and resumes automatically once the display has settled. A toggle to enable/disable the feature is added to player settings.

Also fixes a visual artifact on player exit where the video texture was released mid-frame during the pop animation, causing the top-left quadrant of the video to flash briefly in the bottom-right of the UI. closePlayer() now awaits endOfFrame before navigating so the widget tree can rebuild and cleanly detach the texture first.

Tested On

  • Android
  • Android TV
  • iOS
  • Linux
  • Windows
  • macOS
  • Web

Checklist

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

The video texture was being released while still visible during the
pop animation. closePlayer() now awaits endOfFrame before navigating
so the widget tree can rebuild first, and the video widget hides
itself when VideoPlayerState.disposed is set.

@PartyDonut PartyDonut left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for implementing this, looks good and seems to work.

I will admit not sure if I should see a visual change on TV but that might just be a me problem.

If you could re-base as well that would be great 👍

Comment thread android/gradle.properties
android.useAndroidX=true
android.enableJetifier=true
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think these might be added because the flutter version you use is different from the version in .fvmrc? Probably best to remove this if we are unsure what they do exactly.

@TwoToneEddy

Copy link
Copy Markdown
Author

Thanks for taking a look. I have since added a soundbar to my system which passes through the HDMI. Since using this rather than direct to the TV I am noticing some issues with what I believe to be handshaking. I will investigate this over the next week an hopefully fix, along with your suggestion. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants