mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2024-11-22 01:51:05 +00:00
room info: look up to 15 minutes into the past and into the future
This commit is contained in:
parent
5eabb5fa6a
commit
7d5f278536
3 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
schedule = null;
|
schedule = null;
|
||||||
event_info = null;
|
event_info = null;
|
||||||
|
|
||||||
function get_current_talk() {
|
function get_current_talk(max_offset) {
|
||||||
room_name = get_room_name();
|
room_name = get_room_name();
|
||||||
|
|
||||||
if (!room_name) {
|
if (!room_name) {
|
||||||
|
@ -10,7 +10,7 @@ function get_current_talk() {
|
||||||
|
|
||||||
current_talk = null;
|
current_talk = null;
|
||||||
|
|
||||||
for (let offset = 0; offset <= 5; offset++) {
|
for (let offset = 0; offset <= max_offset; offset++) {
|
||||||
time_start = new Date(Date.now() + offset*60000).getTime();
|
time_start = new Date(Date.now() + offset*60000).getTime();
|
||||||
time_end = new Date(Date.now() - offset*60000).getTime();
|
time_end = new Date(Date.now() - offset*60000).getTime();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ function update_lower_third() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
current_talk = get_current_talk();
|
current_talk = get_current_talk(5);
|
||||||
if (current_talk) {
|
if (current_talk) {
|
||||||
$('#l3title').text(current_talk['title']);
|
$('#l3title').text(current_talk['title']);
|
||||||
$('#l3speaker').text(current_talk['persons'].join(', '));
|
$('#l3speaker').text(current_talk['persons'].join(', '));
|
||||||
|
|
|
@ -39,7 +39,7 @@ function update_room_info() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
current_talk = get_current_talk();
|
current_talk = get_current_talk(15);
|
||||||
if (current_talk) {
|
if (current_talk) {
|
||||||
$('#broadcast_tools_room_info_title').text(current_talk['title']);
|
$('#broadcast_tools_room_info_title').text(current_talk['title']);
|
||||||
$('#broadcast_tools_room_info_speaker').text(current_talk['persons'].join(', '));
|
$('#broadcast_tools_room_info_speaker').text(current_talk['persons'].join(', '));
|
||||||
|
|
Loading…
Reference in a new issue