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

Native Audio Player #72

Merged
merged 7 commits into from May 1, 2020
Merged

Native Audio Player #72

merged 7 commits into from May 1, 2020

Conversation

fdocr
Copy link
Contributor

@fdocr fdocr commented Apr 23, 2020

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Documentation Update

Description

In order to enhance the experience for the Podcast Player this PR implements Native Audio Playback supported by the Native Bridge interface

[optional] What gif best describes this PR or how it makes you feel?

listening with headphones

# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/to/dev/dev_android/view/main/view/CustomWebViewClient.kt
@fdocr fdocr changed the title [WIP] Native Audio Player Native Audio Player Apr 30, 2020
@fdocr fdocr requested review from joshpuetz and maestromac and removed request for joshpuetz April 30, 2020 09:37
@fdocr
Copy link
Contributor Author

fdocr commented Apr 30, 2020

This turned out to be a challenging feature to implement for me 😳 Side to side with the current production release it includes the following enhancements:

  • Playback no longer pauses when the screen is locked (ExoPlayer lives in a Foreground Service triggered by Native Bridge calls)
  • Notification available with play/pause control and metadata
  • Lock screen basic controls (play/pause)

Screenshot_20200430-035018_One UI Home

The most notable inconveniences I feel are related with the lock screen controls (problems configuring PlayerNotificationManager / MediaSessionConnector):

  • Lock screen previous/next buttons are sub-optimal (rewind & fast-forward are the ideal) but I'm pretty much stuck at the moment trying to configure this the right way
  • Also in the lock screen the Podcast name is not 100% reliable to load using the correct Podcast Name (loads default otherwise)
  • Haven't been able to get rid of an Unknown label visible from the locked screen controls
  • Artwork still needs to be downloaded asynchronously and updated with the same API's available from PlayerNotificationManager / MediaSessionConnector which I don't master yet (I'm thinking this is the case doesn't necessarily has to be)
  • A bug: When listening to a podcast A, the player doesn't allow to start podcast B unless the current media in the player is terminated. I'll push in a fix for this soon with some conditionals that take the current state of the player into account

Copy link
Contributor

@maestromac maestromac left a comment

Choose a reason for hiding this comment

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

LGTM!

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

Successfully merging this pull request may close these issues.

None yet

2 participants