Videoplayer: Move loop functions outside of videojs()
This commit is contained in:
		@@ -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 %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user