Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi all,
I have put some educational video tutorials in a web site. I want to make sure that the users will be watching the videos in a stepwise order, and do not let him go further if he has not watched the preceding ones. The total number of video files would be something around 20. The CMS I am using is dotCMS, and I am only allowed to add html and javascript codes to my web pages.

I am new to this site, so, please let me know if this is the right way of asking question.
Thanks a lot
Posted
Comments
Nina designer 12-Mar-14 21:25pm    
what do you exactly mean by improving question? Can you please give me an example, because I guess I have asked my question clearly :(

1 solution

Truth is you can't do that with HTML and javascript alone, reliably.

What the educational websites tend to do is that they embed the video in RIA technologies such as Flash, JavaFX or Silverlight. So then, when the video finishes, the program will send a notification to the server that user has indeed finished the video.
That notification will be saved in a database, and with that data, the website/application can aknowledge a video as 'watched'.
That is one good way to do it....


But if you still want to go on HTML alone there is a trick, which will fail in case the user flushes cookies. HTML5 supports native video, so you can add an "onended" event in the video triggering javascript to set up a cookie.
Want to know if the user watched the video? Check the cookies.
Again, if the user flushes cookies, then it's bye-bye.

Alternative to cookies? set up "onended" to post to the server and save user's track in a database.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900