Commit 6abee6fa authored by Andreas Valder's avatar Andreas Valder

made chapter suggestion use the current playback time of the video

parent f2f2a130
......@@ -37,8 +37,19 @@ $(function() {
{
html:true,
title:'Kapitelmarkierung vorschlagen',
content:'<form method="post" action="{{url_for('suggest_chapter', ref=request.url, lectureid=lecture.id)}}"><input placeholder="00:00.000" name="time" type="text"><br><input placeholder="Kapitel" name="text" type="texz"><br><input type="submit" value="Vorschlagen"></form>'
content: function() {
var zeropad = function (num, places) {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
};
var timestamp = $('.player video')[0].currentTime
var h = zeropad( Math.trunc(timestamp/3600),2);
var m = zeropad( Math.trunc((timestamp%3600)/60),2);
var s = zeropad( Math.trunc(timestamp%60),2);
var timeasstring = h+':'+m+':'+s
return '<form method="post" action="{{url_for('suggest_chapter', ref=request.url, lectureid=lecture.id)}}"><input placeholder="00:00.000" name="time" type="text" value="'+timeasstring+'"><br><input placeholder="Kapitel" name="text" type="texz"><br><input type="submit" value="Vorschlagen"></form>'
}
})
});
......
Markdown is supported
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