Commit d529997b authored by Andreas Valder's avatar Andreas Valder
Browse files

now displaying errors inside the player, this includes l2p auth

parent 82c33535
......@@ -432,14 +432,14 @@ def lecture(id, course=None, courseid=None):
if not checkperm(perms):
mode, text = permdescr(perms)
if mode == 'rwth':
flash(text+'. <a target="_blank" class="reloadonclose" href="'+url_for('start_rwthauth')+'">Hier authorisieren</a>.')
flash(text+'. <a target="_blank" class="reloadonclose" href="'+url_for('start_rwthauth')+'">Hier authorisieren</a>.', category='player')
elif mode == 'l2p':
if 'l2p_courses' in session:
flash(text+'. Du bist kein Teilnehmer des L2P-Kurses! <a target="_blank" class="reloadonclose" href="'+url_for('start_l2pauth')+'">Kurse aktualisieren</a>.')
flash(text+'. Du bist kein Teilnehmer des L2P-Kurses! <a target="_blank" class="reloadonclose" href="'+url_for('start_l2pauth')+'">Kurse aktualisieren</a>.', category='player')
else:
flash(text+'. <a target="_blank" class="reloadonclose" href="'+url_for('start_l2pauth')+'">Hier authorisieren</a>.')
flash(text+'. <a target="_blank" class="reloadonclose" href="'+url_for('start_l2pauth')+'">Hier authorisieren</a>.', category='player')
else:
flash(text+'.')
flash(text+'.', category='player')
return render_template('embed.html' if request.endpoint == 'embed' else 'lecture.html', course=courses[0], lecture=lecture, videos=videos, chapters=chapters)
......
......@@ -112,7 +112,7 @@
{% else %}
<div class="col-xs-12 col-md-offset-{{ page_border }} col-md-{{ 12-(2*page_border) }}">
{% endif %}
{% for msg in get_flashed_messages() %}
{% for msg in get_flashed_messages(category_filter=["message"]) %}
<div class="hidden-print alert alert-danger" role="alert">{{ msg|safe }}</div>
{% endfor %}
{% for msg in get_announcements(min_announcement_level) if (not request.cookies['alert-info-'+msg.id|string]) %}
......
......@@ -8,7 +8,7 @@
{% block content %}
<div class="row">
<div class="col-xs-12" style="padding: 0px">
{{ player(lecture, videos) }}
{{ player(lecture, videos, get_flashed_messages()) }}
</div>
</div>
......
......@@ -34,7 +34,7 @@
</div>
<div class="row">
<div class="col-xs-12" style="padding: 0px">
{{ player(lecture, videos) }}
{{ player(lecture, videos, get_flashed_messages(category_filter=['player'])) }}
</div>
{% if ismod() %}
<div class="col-xs-12" style="padding-top: 10px;">
......
......@@ -45,7 +45,7 @@
{% endmacro %}
{% macro player(lecture, videos) %}
{% macro player(lecture, videos, msgs) %}
<video id="videoplayer" style="width: 100%" class="video-js vjs-default-skin vjs-big-play-centered" width="640" height="320" controls data-wasnotplayed="1" data-setup='{ "plugins" : {"hotkeys": {"seekStep": 15, "enableVolumeScroll": false, "alwaysCaptureHotkeys": true}, "videoJsResolutionSwitcher": { "ui": true, "default": "720p", "dynamicLabel": true } }, "customControlsOnMobile": true, "playbackRates": [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4] }'>
{% for v in videos|sort(attribute='player_prio', reverse=True) %}
<source type="{{ v.mimetype }}" src="{{ config.VIDEOPREFIX }}/{{ v.path }}" label="{{ v.format_description }}"/>
......@@ -89,6 +89,11 @@ $(function() {
if (document.hasFocus()) {
playerplay();
}
//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>';
{% endfor %}
});
</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