diff --git a/templates/lecture.html b/templates/lecture.html index e9e9f79af3d5bf4e598b4b78851900088757cefd..37ba7ea07608334b6aa2a84821351213481f25f7 100644 --- a/templates/lecture.html +++ b/templates/lecture.html @@ -55,7 +55,7 @@ {% for c in chapters|sort(attribute='time') %} <tr> <td> - <a href="javascript:videojs('videoplayer').currentTime({{c['time']}})">{{ '%02d:%02d:%02d'|format( c['time']//3600, (c['time']//60)%60, c['time']%60) }}</a> + <a class="chapterlink" href="{{url_for('lecture', course=course.handle, id=lecture.id, t=c['time'])}}" data-seek-time="{{c['time']}}">{{ '%02d:%02d:%02d'|format( c['time']//3600, (c['time']//60)%60, c['time']%60) }}</a> <br> {% if ismod() %} {{ moderator_editor(['chapters',c.id,'time'],c['time'],true) }} @@ -146,6 +146,10 @@ $(document).ready(function() { }, 500); return false; }); + $("a.chapterlink").click(function () { + videojs('videoplayer').currentTime($(this).data("seek-time")); + return false; + }); }); </script> {% endblock %}