diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index bc3e4fc..7ff69e6 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -35,7 +35,11 @@ const StoryImage: FC = ( { if ( data.uri === story.sourceUrl ) { - onLoad( videoDuration.value ); + if ( !loading.value ) { + + onLoad( videoDuration.value ); + + } } else { @@ -69,7 +73,12 @@ const StoryImage: FC = ( { } loading.value = false; - onLoad( duration ); + + if ( isActive.value ) { + + onLoad( duration ); + + } }; diff --git a/src/components/List/index.tsx b/src/components/List/index.tsx index fd848cf..4da907e 100644 --- a/src/components/List/index.tsx +++ b/src/components/List/index.tsx @@ -29,12 +29,6 @@ const StoryList: FC = ( { }; - const onImageLoad = ( duration?: number ) => { - - onLoad( duration ); - - }; - const lastSeenIndex = stories.findIndex( ( item ) => item.id === seenStories.value[id], ); @@ -48,7 +42,7 @@ const StoryList: FC = ( { defaultImage={stories[lastSeenIndex + 1]?.sourceUrl ?? stories[0]?.sourceUrl} isDefaultVideo={( stories[lastSeenIndex + 1]?.mediaType ?? stories[0]?.mediaType ) === 'video'} onImageLayout={onImageLayout} - onLoad={onImageLoad} + onLoad={onLoad} paused={paused} isActive={isActive} videoProps={videoProps} diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx index 78e81a8..c178735 100644 --- a/src/components/Modal/index.tsx +++ b/src/components/Modal/index.tsx @@ -229,7 +229,7 @@ const StoryModal = forwardRef( ( { } else { y.value = withTiming( 0 ); - startAnimation(); + startAnimation( true ); }