Recording lesson is complete when user finishes watching vimeo video

I have created a website in laravel 5 that has tutorials with videos on various topics. I am using vimeo as my video library. Can anyone tell me how the larakasts or udemi mark the lesson as complete when the user finishes watching the video? I tried to do this with no luck.

+3


source to share


1 answer


Vimeo has an API that can fire a javascript event if the video ends, check the vimeo developer guide . On the event, OnFinish

you can make an ajax call that marks the video as an observable. You can even use an event onPlayProgress

and mark the video as observable when someone has watched the video, say 90%, based on getCurrentTime()

andgetDuration()



Check out the codepen for a detailed example of using the API.

+6


source







All Articles