0
I’m trying to understand the moment a video was completed. I tried to use video events as the documentation says, but I can’t add an event listener to my video player; when I do, I get the "addeventlistener is not fuction" error. I hope someone knows what’s going on. This is my code:
VideoModule.createPlayer('myplayer');
VideoModule.play('myplayer', {
source: { url: videoPath },
stereo: '3DTB',
volume: 1,
muted: false,
});
Environment.setBackgroundVideo('myplayer');
// the evet should be here
VideoModule.addEventListener('onVideoStatusChanged', (event: VideoStatusEvent) => {
if (event.status === 'finished') {
console.log('Video is finished');
}
})
}