Skip to content

Commit c8ac022

Browse files
committed
Deploying to Fall24-output from @ a8109b9 🚀
1 parent 28b0241 commit c8ac022

File tree

891 files changed

+340629
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

891 files changed

+340629
-0
lines changed

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
computationalthinking.mit.edu

Fall20/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
3+
Franklin = "713c75ef-9fc9-4b05-94a9-213340da978e"
4+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
5+
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"

Fall20/assets/MIT_logo.svg

Lines changed: 9 additions & 0 deletions
Loading

Fall20/assets/cute-one.png

217 KB
Loading

Fall20/assets/julia-logo.svg

Lines changed: 10 additions & 0 deletions
Loading

Fall20/assets/live-player.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
function play_live(tstr, tz, sequence, durations, seek) {
2+
var airtime = moment.tz(tstr, tz); // Construct the time in the given timezone
3+
var t_since = moment().tz(tz).diff(airtime, "s")
4+
5+
console.log(tstr, tz, sequence, durations, seek)
6+
console.log("t_since", t_since)
7+
8+
if (t_since < 0) {
9+
setTimeout(function () {
10+
play_live(tstr, tz, sequence, durations, 0);
11+
}, 1000*(-t_since + 2)); // start playing when class starts
12+
return; // Live class hasn't started
13+
}
14+
15+
var total_time = durations.reduce(function (x,y) { return x+y });
16+
if (t_since > total_time) {
17+
return; // Live class is over
18+
}
19+
20+
debugger
21+
var checkbox = document.getElementById("sync-play");
22+
var checkbox_wrap = document.getElementById("sync-play-wrap");
23+
checkbox_wrap.style.display = "block";
24+
25+
if (!(checkbox.checked)) {
26+
return;
27+
}
28+
29+
var j = 0
30+
var prev_t = 0
31+
var t = 0
32+
var time_left=300
33+
for (var i=0, l=durations.length; i<l;i++) {
34+
t += durations[i]
35+
if (t_since < t) {
36+
j = i // play this video
37+
time_left = t - t_since
38+
if (typeof(seek) === "undefined") {
39+
seek = Math.max(0, durations[i] - time_left);
40+
}
41+
break
42+
}
43+
}
44+
45+
46+
iframe = document.getElementById(sequence[j])
47+
48+
if (typeof(seek) == "undefined") {
49+
seek = 0;
50+
}
51+
52+
// Start playing!
53+
iframe.src = iframe.src + "?start=" + seek + "&autoplay=1"
54+
55+
setTimeout(function () {
56+
play_live(tstr, tz, sequence, durations, 0);
57+
}, 1000*(time_left+5)); // play next video 5 seconds after this one.
58+
}

0 commit comments

Comments
 (0)