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

Video resumes playback with rate=0 after app is put in background #3071

Closed
rokiyama opened this issue Mar 19, 2023 · 4 comments · Fixed by #3593
Closed

Video resumes playback with rate=0 after app is put in background #3071

rokiyama opened this issue Mar 19, 2023 · 4 comments · Fixed by #3593

Comments

@rokiyama
Copy link

rokiyama commented Mar 19, 2023

Bug

When I put the app in the background with rate=0 and then bring it back to the foreground, the video resumes playback even though the rate=0.

Platform

Which player are you experiencing the problem on:

  • Android

Environment info

React native info output:

System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 88.23 MB / 16.00 GB
    Shell: 3.6.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 18.14.0 - ~/.nvm/versions/node/v18.14.0/bin/node
    Yarn: Not Found
    npm: 9.3.1 - ~/.nvm/versions/node/v18.14.0/bin/npm
    Watchman: 2023.02.20.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/oki/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 28, 29, 30, 31, 33
      Build Tools: 30.0.2, 30.0.3, 31.0.0, 33.0.0
      System Images: android-33 | Google APIs ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_292 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.3 => 0.71.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 5.2.1

Steps To Reproduce

  1. Set rate property of the video to 0.
  2. Switch the app to the background.
  3. Switch the app to foreground.

The video will then play, even though rate=0.

Expected behaviour

  1. The video will not play while rate=0.

Reproducible sample code

https://github.com/rokiyama/example-expo-with-react-native-video/blob/main/src/components/RNVideo.tsx

Video sample

720p-screen-20230319-103548.mov
@rokiyama
Copy link
Author

Workaround:

Use the paused property. The rate should be set to 1.

Example: https://github.com/rokiyama/example-expo-with-react-native-video/compare/fix/use-paused-instead-of-rate?expand=1

@freeboub
Copy link
Collaborator

freeboub commented Apr 1, 2023

Is this something reproduced on V6 ?
I confirm it is better to use pause property to pause the playback... Anyway it looks like a real bug!

@rahultripathi-dev
Copy link

Can some one assign me this issue ..? I want to contribute.

@freeboub
Copy link
Collaborator

With this message, you are the responsible for this issue ! :)

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

Successfully merging a pull request may close this issue.

3 participants