mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Fix thumbnail sometimes not set to media session metadata
The thumbnail was not being updated in the media session metadata after it was loaded, since there was no metadata update in that case, only a notification update.
This commit is contained in:
parent
bc33322d4b
commit
3cc43e9fb9
@ -1,9 +1,11 @@
|
|||||||
package org.schabi.newpipe.player.mediasession;
|
package org.schabi.newpipe.player.mediasession;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
import android.support.v4.media.session.MediaSessionCompat;
|
import android.support.v4.media.session.MediaSessionCompat;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import org.schabi.newpipe.R;
|
import org.schabi.newpipe.R;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfo;
|
import org.schabi.newpipe.extractor.stream.StreamInfo;
|
||||||
@ -60,6 +62,12 @@ public class MediaSessionPlayerUi extends PlayerUi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onThumbnailLoaded(@Nullable final Bitmap bitmap) {
|
||||||
|
super.onThumbnailLoaded(bitmap);
|
||||||
|
player.getCurrentStreamInfo().ifPresent(this::onMetadataChanged);
|
||||||
|
}
|
||||||
|
|
||||||
public void handleMediaButtonIntent(final Intent intent) {
|
public void handleMediaButtonIntent(final Intent intent) {
|
||||||
if (mediaSessionManager != null) {
|
if (mediaSessionManager != null) {
|
||||||
mediaSessionManager.handleMediaButtonIntent(intent);
|
mediaSessionManager.handleMediaButtonIntent(intent);
|
||||||
|
Loading…
Reference in New Issue
Block a user