Commit 9c350669 authored by Andreas Valder's avatar Andreas Valder
Browse files

closes #187

parent cac09d9d
......@@ -55,6 +55,29 @@
$('#videoplayer').addClass("vjs-16-9");
$('#videoplayer').css("width");
$(function() {
//resume
var progress_key = "progress_{{ lecture.id }}";
var seconds_played;
if (localStorage) {
seconds_played = localStorage.getItem(progress_key);
if (!seconds_played) {
seconds_played = 0;
} else {
videojs('videoplayer').currentTime(seconds_played);
}
}
videojs("videoplayer").on("timeupdate", function() {
if (localStorage) {
var player_cur_Time = Math.round(videojs("videoplayer").currentTime());
if(Math.abs(player_cur_Time - seconds_played) >= 10) {
seconds_played = player_cur_Time;
localStorage.setItem( progress_key , seconds_played)
}
}
});
//autoplay
var playerplay = function() {
if ($('#videoplayer').data("wasnotplayed") == 1) {
videojs('videoplayer').play();
......
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