react-native-video: [BUG]: onEnd callback is not triggered android
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:
- Reach the end of the video and check that it won’t trigger an onEnd callback. (I have tried to add alert or console.log to check it is working or not.)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15
I cannot reproduce the issue with the sample app also. Are you able to provide a sample stream or sample app or reproduce it with sample ?