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

Play audio in background #110

Merged
merged 3 commits into from
Sep 9, 2024
Merged

Conversation

rygelouv
Copy link
Owner

@rygelouv rygelouv commented Sep 8, 2024


🚀 Description

Right now in version 1.1.x when the user leaves the player page the audio stops playing. We want to be able to continue playing the audio even when the user leaves the player. And we can do this in two phases. Step is playing audio in background services and second is adding a mini player.

https://developer.android.com/media/media3/session/background-playback
https://developer.android.com/media/media3/session/connect-to-media-app#create-controller
https://developer.android.com/media/media3/exoplayer/listening-to-player-events
https://developer.android.com/media/implement/playback-app

This commit introduces a new audio player implementation using Media3.

  • Migrated from ExoPlayer to Media3 for audio playback.
  • Implemented a foreground service for background playback.
  • Updated the UI to display track information and playback controls.
  • Added support for seeking and playback state updates.
  • Refactored the PlayerController interface and its implementation
  • Added unit tests for the new PlayerControllerImpl.
  • Updated dependencies to include Media3 libraries.
  • Updated the AudioTrack class to include track metadata.
  • Updated the PlaySummaryAudioViewModel to handle audio track information.
  • Updated the PlaySummaryAudioScreen to display track metadata and use the new PlayerController actions.

Issue (if applicable):

🖼 Screenshots/Videos (if applicable)

  • After:
    [Attach after screenshot or link to video]
screencapture-1725806874628.mp4

📦 Dependencies

  • Added new dependencies? List:
  • Updated existing?

🧪 Testing

  • Open a summary, play audio and leave the player scren

📱 Checklist

  • Tested on all supported devices and OS versions
  • UI/UX conforms to project design guidelines
  • Unit/integration tests added
  • Relevant documentation updated (e.g., README, Wiki, etc.)
  • Checked linter on local.

@rygelouv rygelouv added enhancement New feature or request new feature When adding a new feature unit tests Unit tests added labels Sep 8, 2024
@rygelouv rygelouv added this to the 1.2.0 milestone Sep 8, 2024
@rygelouv rygelouv self-assigned this Sep 8, 2024
github-actions[bot]
github-actions bot previously approved these changes Sep 8, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR automatically approved by auto-approve-action

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR automatically approved by auto-approve-action

Copy link

sonarqubecloud bot commented Sep 8, 2024

@rygelouv rygelouv merged commit 73b14e6 into dev Sep 9, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new feature When adding a new feature unit tests Unit tests added
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant