Commit 7f4d8a8d authored by Andreas Valder's avatar Andreas Valder
Browse files

fixes modal dialogs in player

parent 01de5dd1
......@@ -59,6 +59,8 @@
$('#videoplayer').addClass("vjs-16-9");
$('#videoplayer').css("width");
$(function() {
videojs("videoplayer").ready(function() {
//resume
var progress_key = "progress_{{ lecture.id }}";
var seconds_played;
......@@ -92,11 +94,20 @@ $(function() {
if (document.hasFocus()) {
playerplay();
}
var modals = [];
//display errors
{% for msg in msgs %}
videojs("videoplayer").createModal('',{"uncloseable": true }).contentEl().innerHTML='<div class="hidden-print alert alert-danger" role="alert">{{ msg|safe }}</div>';
var m = videojs("videoplayer").createModal('',{"uncloseable": true });
modals.push(m);
m.contentEl().innerHTML='<div class="hidden-print alert alert-danger" role="alert">{{ msg|safe }}</div>';
{% endfor %}
videojs("videoplayer").on('play', function() {
for (var i=0; i < modals.length; i++) {
modals[i].close();
}
});
//markers
$.ajax({method: "GET", url: "{{url_for('chapters',lectureid=lecture.id, json=1)}}", dataType: "json",
......@@ -116,6 +127,7 @@ $(function() {
markers: data});
}});
});
});
</script>
{% endmacro %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment