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): ensure rate is never set to 0 #3593

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

freeboub
Copy link
Collaborator

Summary

  • Add safety check to ensure rate is never set to 0 on android
  • update and clarify documentation

Motivation

Fix: #3071

Changes

  • documentation update
  • add safety check on android
  • add 0 playback speed in sample to test easily

Test plan

  • press 0 playback speed in the sample

@KrzysztofMoch
Copy link
Member

KrzysztofMoch commented Mar 21, 2024

How about we add warning (on JS side) to don't confuse users ?

if(Platform.OS === 'android' && rate == 0) {
    console.warn('react-native-video: You should not set rate to 0 on Android');
}

@freeboub
Copy link
Collaborator Author

How about we add warning (on JS side) to don't confuse users ?

if(Platform.OS === 'android' && rate == 0) {
    console.warn('react-native-video: You should not set rate to 0 on Android');
}

@KrzysztofMoch It makes sense, but I don't see anywhere to put it easily and I don't want to add this test in each render ...
I fix the PR by adding a log on Java side and also fix the bad test (it was not working initially... )

Copy link
Member

@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.

Sure, LGTM 👍

@freeboub freeboub merged commit 3d7444a into TheWidlarzGroup:master Mar 21, 2024
4 checks passed
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.

Video resumes playback with rate=0 after app is put in background
2 participants