-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: onEnd callback is not triggered android #4098
Comments
Hi, thanks for reporting the issue! Could you please tell me, if you remove all of the props except source and onEnd, the issue is still active? I'm just wondering if it's connected to other prop |
yes, I already try on that way but still not giving me a response back that the video is already finished, also i have a problem with the subtitle I works perfectly fine only the problem occures when i forward the video and giving me back this error: // this is my setup also const [subtitle] = useState<{ title: string; language: string; type: string; uri: string }[]>([ selectedTextTrack={selectedSubtitleType} |
@Koykoy200078 Did you try to reproduct he issue with the sample app ? |
when you have to set repeat={false} then onEnd callback function is called other wise they can't called |
yes, i tried in a simple app without any 3rd parties except react-native-video, with the latest version of react native by fetching 3 videos length 2 mins each via link, the first link called the onEnd but somethimes when i move forward to a specific time it will not called onEnd, the second and third not called onEnd again when it called in link one |
I didn't know there is a repeat in the attributes, I will check this if work |
Let me check it out. |
When i remove other props then work perfectly. But the issues when is use repeat props then onEnd not work in android side. the same props work perfectly on IOS side. |
Sure! try to check using repeat={true} and call the onEnd callback Function |
@Koykoy200078 @noumanali53 |
I cannot reproduce the issue with the sample app also. |
This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically. |
I am still having the issue, using the latest version onEnd not working with repeat={true} |
@farhan067 could you please provide sample video when issue occurs? |
Version
^6.4.5
What platforms are you having the problem on?
Android
System Version
12
On what device are you experiencing the issue?
Real device
Architecture
Old architecture
What happened?
While playing any video till the end, the onEnd Callback sometime is not triggered
"react-native": "0.75.1",
"react-native-video": "^6.4.5",
"react-native-media-console": "^2.2.4",
// Video Player Component
<VideoPlayer videoRef={videoRef} useAnimations={useAnimations} source={{ uri: videoLink, headers: { Referer: referer, }, }} navigator={navigation} title={videoTitle} controlTimeoutDelay={3000} isFullscreen={isFullscreen} disableBack={!isFullscreen} resizeMode='contain' containerStyle={{ width: width, height: '100%' }} showDuration={true} onBuffer={onBuffer} onError={onError} onEnterFullscreen={handleFullScreen} showOnEnd={true} onEnd={() => { onVideoEnd() console.log('Video Ended') Orientation.lockToPortrait() setIsFullscreen(false) fullView(false) StatusBar.setHidden(false) showNavigationBar() changeNavigationBarColor(COLORS.background, true, true) }} onBack={() => { Orientation.lockToPortrait() setIsFullscreen(false) fullView(false) StatusBar.setHidden(false) showNavigationBar() changeNavigationBarColor(COLORS.background, true, true) }} />
// Main Layout
<VideoPlayerComponent videoLink={video_link} referer={referer} navigation={navigation} isPlaying={isPlaying} videoTitle={allData.title} isFinished={videoEnded} fullView={(val: boolean) => setHideFullScreen(val)} onBuffer={(val) => setIsBuffering(val.isBuffering)} onPressPlay={() => setIsPlaying(true)} onPressReplay={() => setIsPlaying(true)} onVideoEnd={() => { setVideoEnded(true) setIsPlaying(false) updateEpisodesWatched(lastCurrentEpisodeWatched.animeId, lastCurrentEpisodeWatched.episodeId) lastEpisodeWatched(lastCurrentEpisodeWatched.animeId, lastCurrentEpisodeWatched.episodeId) }} onError={(error) => showError({ title: 'Error', description: error, }) } />
Reproduction
repository link
Reproduction
Step to reproduce this bug are:
The text was updated successfully, but these errors were encountered: