mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-11-22 01:21:01 +00:00
lower thirds: look up to five minutes into the future and into the past
This commit is contained in:
parent
2b02350e29
commit
191ce772c5
1 changed files with 20 additions and 12 deletions
|
@ -7,8 +7,6 @@ $(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function update_lower_third() {
|
function update_lower_third() {
|
||||||
current_time = new Date(Date.now()).getTime()
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
hash = decodeURIComponent(window.location.hash.substring(1));
|
hash = decodeURIComponent(window.location.hash.substring(1));
|
||||||
room_name = hash;
|
room_name = hash;
|
||||||
|
@ -43,19 +41,29 @@ function update_lower_third() {
|
||||||
|
|
||||||
current_talk = null;
|
current_talk = null;
|
||||||
|
|
||||||
for (talk_i in schedule['talks']) {
|
for (let offset = 0; offset <= 5; offset++) {
|
||||||
talk = schedule['talks'][talk_i]
|
time_start = new Date(Date.now() + offset*60000).getTime();
|
||||||
|
time_end = new Date(Date.now() - offset*60000).getTime();
|
||||||
|
|
||||||
if (schedule['rooms'].length > 1 && talk['room'] != room_name) {
|
for (talk_i in schedule['talks']) {
|
||||||
// not in this room
|
talk = schedule['talks'][talk_i]
|
||||||
continue;
|
|
||||||
|
if (schedule['rooms'].length > 1 && talk['room'] != room_name) {
|
||||||
|
// not in this room
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
talk_start = new Date(talk['start']).getTime();
|
||||||
|
talk_end = new Date(talk['end']).getTime();
|
||||||
|
|
||||||
|
if (talk_start < time_start && talk_end > time_end) {
|
||||||
|
current_talk = talk;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
talk_start = new Date(talk['start']).getTime();
|
if (current_talk) {
|
||||||
talk_end = new Date(talk['end']).getTime();
|
break;
|
||||||
|
|
||||||
if (talk_start < current_time && talk_end > current_time) {
|
|
||||||
current_talk = talk;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue