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

Android API 32+ media session artwork fit #224

Open
KestasVenslauskas opened this issue Nov 9, 2023 · 1 comment
Open

Android API 32+ media session artwork fit #224

KestasVenslauskas opened this issue Nov 9, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@KestasVenslauskas
Copy link

KestasVenslauskas commented Nov 9, 2023

Is there a way to change the "fit" style for the artwork on android so it would cover the space?

Screenshot_1699518783

@KestasVenslauskas KestasVenslauskas changed the title Android API 32+ media session artwork scale Android API 32+ media session artwork fit Nov 9, 2023
@tvanlaerhoven tvanlaerhoven self-assigned this Nov 14, 2023
@tvanlaerhoven tvanlaerhoven added the question Further information is requested label Nov 14, 2023
@tvanlaerhoven
Copy link
Member

Hi @KestasVenslauskas, here's the code that is responsible for downloading and setting the image or the notification:

downloading:
https://github.com/THEOplayer/react-native-theoplayer/blob/develop/android/src/main/java/com/theoplayer/media/MediaNotificationBuilder.kt#L180

setting:
https://github.com/THEOplayer/react-native-theoplayer/blob/develop/android/src/main/java/com/theoplayer/media/MediaNotificationBuilder.kt#L123

The resizing has to happen before setting the image:

int desiredWidth = 100;
int desiredHeight = 100;
Bitmap resizedBitmap = Bitmap.createScaledBitmap(originalBitmap, desiredWidth, desiredHeight, false);

We'll try to plan such a feature in a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants