I built a website in laravel 5 that have training lessons with videos about various subjects. I use vimeo as my video library. Can anybody tell me how does laracasts or udemy mark the lesson as completed when the user finishes watching a video? I tried to google it with no luck.
Record lesson as completed when user finishes watching vimeo video
Vimeo has an API that can fire a javascript event if the video ends, check developer guide on vimeo. In the OnFinish
event you can do an ajax call that marks the video as watched. You can even use the onPlayProgress
event and mark the video as watched when someone has watched a video for, let's say 90%, based on getCurrentTime()
and getDuration()
Check this codepen for a detailed example on the API usage.
© 2022 - 2024 — McMap. All rights reserved.
Laracast
usecustom video players
like Video JS. If you use custom video player you can easily detect by using player's API. – Pandurate