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:
@@ -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) {
|
||||
|
@@ -74,6 +74,7 @@ link(rel="amphtml", href="{{ url_for('nodes.view', node_id=node._id, _external=T
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/videojs-6.2.8.min.js') }}")
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/videojs-ga-0.4.2.min.js') }}")
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/vendor/videojs-hotkeys-0.2.20.min.js') }}")
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/video_plugins.min.js') }}")
|
||||
| {% endblock %}
|
||||
|
||||
| {% block css %}
|
||||
|
Reference in New Issue
Block a user