Commit 20243182 by Piotr Mitros

cjt fixed schematic bug. Back in the system

parent ef942ac0
...@@ -67,20 +67,25 @@ function caption_index(now) { ...@@ -67,20 +67,25 @@ function caption_index(now) {
return i-1; return i-1;
} }
function format_time(t)
{
seconds = Math.round(t);
minutes = Math.round(seconds / 60);
hours = Math.round(minutes / 60);
seconds = seconds % 60;
minutes = minutes % 60;
return hours+":"+((minutes < 10)?"0":"")+minutes+":"+((seconds < 10)?"0":"")+(seconds%60);
}
function update_captions(t) { function update_captions(t) {
var i=caption_index(t); var i=caption_index(t);
$("#std_n5").html(caption_at(i-5)); $("#vidtime").html(format_time(ytplayer.getCurrentTime())+'/'+format_time(ytplayer.getDuration()));
$("#std_n4").html(caption_at(i-4)); var j;
$("#std_n3").html(caption_at(i-3)); for(j=1; j<9; j++) {
$("#std_n2").html(caption_at(i-2)); $("#std_n"+j).html(caption_at(i-j));
$("#std_n1").html(caption_at(i-1)); $("#std_p"+j).html(caption_at(i+j));
}
$("#std_0").html(caption_at(i)); $("#std_0").html(caption_at(i));
$("#std_p1").html(caption_at(i+1));
$("#std_p2").html(caption_at(i+2));
$("#std_p3").html(caption_at(i+3));
$("#std_p4").html(caption_at(i+4));
$("#std_p5").html(caption_at(i+5));
$("#std_p6").html(caption_at(i+6));
} }
function title_seek(i) { function title_seek(i) {
...@@ -106,8 +111,8 @@ var ajax_video=function(){}; ...@@ -106,8 +111,8 @@ var ajax_video=function(){};
function onYouTubePlayerReady(playerId) { function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer"); ytplayer = document.getElementById("myytplayer");
setInterval(updateytplayerInfo, 1000); setInterval(updateytplayerInfo, 500);
setInterval(ajax_video,1000); setInterval(ajax_video,5000);
ytplayer.addEventListener("onStateChange", "onytplayerStateChange"); ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
ytplayer.addEventListener("onError", "onPlayerError"); ytplayer.addEventListener("onError", "onPlayerError");
if((typeof load_id != "undefined") && (load_id != 0)) { if((typeof load_id != "undefined") && (load_id != 0)) {
...@@ -126,21 +131,23 @@ function videoDestroy() { ...@@ -126,21 +131,23 @@ function videoDestroy() {
} }
function log_event(e, d) { function log_event(e, d) {
// CRITICAL TODO: Change to AJAX
//$("#eventlog").append("<br>"); //$("#eventlog").append("<br>");
//$("#eventlog").append(JSON.stringify(e)); //$("#eventlog").append(JSON.stringify(e));
// TODO: Figure out // TODO: Decide if we want seperate tracking server.
// XMLHttpRequest cannot load http://localhost:7000/userlog. Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin. // If so, we need to resolve:
// * AJAX from different domain (XMLHttpRequest cannot load http://localhost:7000/userlog. Origin http://localhost:8000 is not allowed by Access-Control-Allow-Origin.)
/*window['console'].log(JSON.stringify(e)); // * Verifying sessions/authentication
$.get("http://localhost:7000/userlog",
{'user':'pmitros', /*window['console'].log(JSON.stringify(e));*/
'key':'key', $.get("/event",
'event_type':'unknown', {
'data':'e'}, "event_type" : e,
"event" : JSON.stringify(d),
"page" : document.URL
},
function(data) { function(data) {
});*/ });
} }
function seek_slide(type,oe,value) { function seek_slide(type,oe,value) {
......
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