1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2025-07-04 14:38:29 +00:00

add "room info" url to show on room info screens

This commit is contained in:
Franzi 2023-02-28 09:51:07 +01:00
parent 327981eade
commit de8065cf22
Signed by: kunsi
GPG key ID: 12E3D2136B818350
9 changed files with 238 additions and 81 deletions

View file

@ -0,0 +1,51 @@
$(function() {
$('#broadcast_tools_room_info_title').text('Content will appear soon.');
$('#broadcast_tools_room_info_speaker').text('');
$('#broadcast_tools_room_info_qr').text('');
});
function update_room_info() {
room_name = get_room_name();
if (!event_info) {
console.warn("Waiting for event info ...");
return
}
if (!schedule) {
$('#broadcast_tools_room_info_speaker').text('Waiting for schedule ...')
return
}
if ('error' in schedule) {
$('#broadcast_tools_room_info_title').text('Error')
$('#broadcast_tools_room_info_speaker').html(schedule['error'].join('<br>'));
$('#broadcast_tools_room_info_qr').text('');
return
}
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
$('#broadcast_tools_room_info_title').text('Error')
$('#broadcast_tools_room_info_speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
$('#broadcast_tools_room_info_qr').text('');
return
}
current_talk = get_current_talk();
if (current_talk) {
$('#broadcast_tools_room_info_title').text(current_talk['title']);
$('#broadcast_tools_room_info_speaker').text(current_talk['persons'].join(', '));
$('#broadcast_tools_room_info_qr').html('<img src="' + current_talk['feedback_qr_url'] + '" alt="Feedback QR Code">');
} else {
$('#broadcast_tools_room_info_title').text(event_info['no_talk']);
$('#broadcast_tools_room_info_speaker').text('');
$('#broadcast_tools_room_info_qr').text('');
}
if (current_talk && current_talk['track']) {
$('#broadcast_tools_room_info').css('background-color', current_talk['track']['color']);
} else {
$('#broadcast_tools_room_info').css('background-color', event_info['color']);
}
}
window.setInterval(update_room_info, 1000);