Saving & restoring video watching progress

Video progress updates:

- Mark as 'done' when 90% or more is watched.
- Keep 'done' flag when re-watching.

The video progress is stored on three events, whichever comes first:

- Every 30 seconds of video.
- Every 10% of the video.
- Every pause/stop/navigation to another page.
- When we detect the video is looping.
This commit is contained in:
2018-08-30 18:30:38 +02:00
parent 3f8e0396cf
commit 2698be3e12
7 changed files with 590 additions and 4 deletions

View File

@@ -67,6 +67,14 @@ script(type="text/javascript").
});
this.hotkeys();
{% if current_user.is_authenticated %}
let fetch_progress_url = '{{ url_for("users_api.get_video_progress", video_id=node._id) }}';
let report_url = '{{ url_for("users_api.set_video_progress", video_id=node._id) }}';
this.progressPlugin({
'report_url': report_url,
'fetch_progress_url': fetch_progress_url,
});
{% endif %}
});
function addVideoPlayerButton(data) {