bumptech / bumptech/glide

Is there is any way to listen for the current GIF Frame while playing GIF?

Open
#2,524 10 comments 0 reactions 0 assignees View on GitHub
enhancement GIF help wanted
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

I am using this code in Fresco. I want to switch to Glide

```
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setUri(uri)
.setAutoPlayAnimations(true)
.setControllerListener(new BaseControllerListener() {
@Override
public void onFinalImageSet(String id, ImageInfo imageInfo, Animatable animatable) {
((SimpleDraweeView) mGIFView).setAspectRatio((float) imageInfo.getWidth() / imageInfo.getHeight());

if (animatable != null && animatable instanceof AnimatedDrawable2) {
((AnimatedDrawable2) animatable).setAnimationListener(

new AnimationListener() {
@Override
public void onAnimationStart(AnimatedDrawable2 drawable) {

}

@Override
public void onAnimationStop(AnimatedDrawable2 drawable) {

}

@Override
public void onAnimationReset(AnimatedDrawable2 drawable) {

}

@Override
public void onAnimationRepeat(AnimatedDrawable2 drawable) {

}

@Override
public void onAnimationFrame(AnimatedDrawable2 drawable, int frameNumber) {
//Current frame
}

});
}
}

@Override
public void onFailure(String id, Throwable throwable) {
super.onFailure(id, throwable);
Log.e("failed", throwable.getLocalizedMessage());
}
}).build();
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.