mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Fix the issue of blurry media images in notifications. (#1493)
(cherry picked from commit bec168009d)
This commit is contained in:
committed by
Niels van Velzen
parent
727db54baa
commit
ed9768a4d2
@@ -8,6 +8,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.graphics.Bitmap
|
||||
import android.media.MediaMetadata
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.getSystemService
|
||||
import androidx.core.graphics.drawable.toBitmap
|
||||
@@ -120,6 +121,18 @@ class PlayerNotificationHelper(private val viewModel: PlayerViewModel) : KoinCom
|
||||
}.build()
|
||||
|
||||
nm.notify(VIDEO_PLAYER_NOTIFICATION_ID, notification)
|
||||
|
||||
mediaIcon?.let {
|
||||
viewModel.mediaSession.controller.metadata?.let {
|
||||
if (!it.containsKey(MediaMetadata.METADATA_KEY_ART)) {
|
||||
viewModel.mediaSession.setMetadata(
|
||||
MediaMetadata.Builder(it)
|
||||
.putBitmap(MediaMetadata.METADATA_KEY_ART, mediaIcon)
|
||||
.build()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (receiverRegistered.compareAndSet(false, true)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<dimen name="media_notification_height">140dp</dimen>
|
||||
<dimen name="media_notification_height">196dp</dimen>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user