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

fix(android): video flickering add playback start #3746

Merged

Conversation

freeboub
Copy link
Collaborator

@freeboub freeboub commented May 8, 2024

Summary

Avoid flickering when video playback starts on android

Motivation

Fix: #3740
This issue gives a very bad quality feedback...

Changes

I fix few warning and did few clean up but the main change is to delay the shutterView removal by 15 ms

Test plan

Can be tested in the sample

@freeboub freeboub changed the title Fix/video flickering android fix(android): video flickering add playback start May 8, 2024
Copy link
Collaborator

@KrzysztofMoch KrzysztofMoch left a comment

Choose a reason for hiding this comment

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

I don't like that we need to use such workarounds...
LGTM ✅

@freeboub
Copy link
Collaborator Author

freeboub commented May 8, 2024

Yes, but the issue is quite complicated,
We have a main view to display the video, and a view to adapt to the aspect ratio of the video.
At playback start we use the main view as the video size.
One playback is started we know the expected aspect ratio of the video and then resize the view to adapt to expected resize mode.
We cannot do this resizing before knowing the real aspect ratio which will be played.
The best fix would be to provide target aspect ratio of the video in the source, then we would be able to adapt view size with target video size. The issue to implement that is mainly that when you start a playback you don't necessary know which will be the video aspect ratio, So this solution may not apply to all videos / backend implementation ...

The delay is only 15ms, so 1 additional frame for user perspective, I think this will be seemless, so it is acceptable.

@KrzysztofMoch
Copy link
Collaborator

I want to make release, so I will merge this

@KrzysztofMoch KrzysztofMoch merged commit b1cd52b into TheWidlarzGroup:master May 8, 2024
3 checks passed
ZakirBangash added a commit to ZakirBangash/react-native-video that referenced this pull request May 9, 2024
KrzysztofMoch pushed a commit that referenced this pull request May 10, 2024
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.

[BUG]: Video first frame do flickering when player load video and start playing, Demo Attached
2 participants