Closed lchenfox closed 1 year ago
Sorry. Finally, it's solved by the following codes:
_renderAnimation = () => {
if (!this.state.loading) return null;
const localSource = require('../Source/Common/animated.webp');
const uri = Image.resolveAssetSource(localSource).uri;
return <View style={{position: 'absolute', width: '100%', height: '100%', justifyContent: 'center', alignItems: 'center', backgroundColor: 'rgba(255, 255, 255, 0.45)'}}>
<FastImage style={{width: 88, height: 88}} source={{uri: uri, cache: 'web'}}/>
</View>;
};
Closing this issue.
Describe the bug I'm using the
"react-native-fast-image": "^8.6.3"
to load Animated Webp image animation. It works normally on iOS. But it always keeps and continues the last animation frame on Android.To Reproduce Steps to reproduce the behavior if possible, or a link to a reproduction repo:
FastImage
to load a local animated webp.FastImage
to stop animation.Code snippets:
Expected behavior
Load Animated webp normally from the first frame on Android.
Actual behavior
Actually, it starts and continues the animation from the last image frame on step 3. For example, if the animated webp animation duration is
5s
, the first time it plays to 3s, secondly, sets theloading
tofalse
to stop the animation. Thirdly, sets theloading
totrue
to rerender the webp animation that causes to continue the last animation frame(from3s
on first time). Should it start animation from the first animation frame when rendering again each time?Dependency versions
npx react-native info:
Please let me know if I miss something else or the step above is incorrect. Thanks in advance.