tv-samples icon indicating copy to clipboard operation
tv-samples copied to clipboard

Refactor: enhance player architecture and fix background playback issue

Open bensalcie opened this issue 7 months ago • 1 comments

Here is a list of Improvements this PR Tends to Fix.

  • Scoped ExoPlayer to ViewModel to prevent reuse after release
  • Removed singleton usage to avoid dead thread crashes
  • Ensured ExoPlayer releases on screen exit via onCleared()
  • Fixed bug where video continued playing after user left the app
  • Improved separation of concerns via VideoPlayerManager abstraction

Closes #206

Previous Behavior

  1. Initiating a new play, previous play continue and and they play concurrently.
  2. When user Quits the Jetstream app, the video continues playing in background as Audio.
  3. User is unable to tell where to stop it whenever it continues to play after app is quit.

Expected behavior

  1. Player instance is one. One single play at a time. Initiating another play, disposes previous and begins another correctly.
  2. Player releases whenever user quits app and does not continue playing in the background.
image image

bensalcie avatar Jul 01 '25 08:07 bensalcie

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Jul 01 '25 08:07 google-cla[bot]