1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-11-17 23:34:54 +00:00

Fix image loader bug

This commit is contained in:
Mauricio Colli 2017-05-09 00:12:06 -03:00
parent 58137aadc9
commit 9ca8c5480c
2 changed files with 4 additions and 1 deletions

View File

@ -189,6 +189,7 @@ public abstract class BasePlayer implements ExoPlayer.EventListener, AudioManage
ImageLoader.getInstance().loadImage(videoThumbnailUrl, new SimpleImageLoadingListener() { ImageLoader.getInstance().loadImage(videoThumbnailUrl, new SimpleImageLoadingListener() {
@Override @Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
if (simpleExoPlayer == null) return;
if (DEBUG) Log.d(TAG, "onLoadingComplete() called with: imageUri = [" + imageUri + "], view = [" + view + "], loadedImage = [" + loadedImage + "]"); if (DEBUG) Log.d(TAG, "onLoadingComplete() called with: imageUri = [" + imageUri + "], view = [" + view + "], loadedImage = [" + loadedImage + "]");
videoThumbnail = loadedImage; videoThumbnail = loadedImage;
onThumbnailReceived(loadedImage); onThumbnailReceived(loadedImage);

View File

@ -677,7 +677,9 @@ public class PopupVideoPlayer extends Service {
imageLoader.resume(); imageLoader.resume();
imageLoader.loadImage(info.thumbnail_url, displayImageOptions, new SimpleImageLoadingListener() { imageLoader.loadImage(info.thumbnail_url, displayImageOptions, new SimpleImageLoadingListener() {
@Override @Override
public void onLoadingComplete(String imageUri, View view, final Bitmap loadedImage) { public void onLoadingComplete(final String imageUri, View view, final Bitmap loadedImage) {
if (playerImpl == null || playerImpl.getPlayer() == null) return;
if (DEBUG) Log.d(TAG, "FetcherRunnable.imageLoader.onLoadingComplete() called with: imageUri = [" + imageUri + "]");
mainHandler.post(new Runnable() { mainHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {