Videoplayer: Move loop functions outside of videojs()

This commit is contained in:
Pablo Vazquez 2018-09-10 15:22:05 +02:00
parent 9b62daec74
commit b9268337c3

View File

@ -81,6 +81,18 @@ script(type="text/javascript").
this.rememberVolumePlugin();
{% 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 %}
});
// Generic utility to add-buttons to the player.
function addVideoPlayerButton(data) {
@ -122,18 +134,6 @@ script(type="text/javascript").
videoPlayerToggleLoop(videoPlayer, videoPlayerLoopButton);
};
{% 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 %}
});
{% endif %} // if node.video_sources
| {% endblock node_scripts %}