Skip to content

Commit

Permalink
Introduce 'livestreamId' on auditoria
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre committed Jan 21, 2025
1 parent 9ab3fae commit 2856d16
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ livestream:
# id - The room ID/name (eg: "D.collab")
# sId - The room ID/name, but lowercase and only alphanumeric characters
# are included (eg: "dcollab")
# livestreamId - The livestream ID acquired from the conference schedule source.
auditoriumUrl: "https://stream.example.org/conference/hls/{id}.m3u8"

# The template for livestreams in talk rooms
Expand Down
1 change: 1 addition & 0 deletions src/backends/json/FosdemJsonScheduleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class FosdemJsonScheduleLoader {
talks: new Map(),
// Hardcoded: FOSDEM is always physical now.
isPhysical: true,
livestreamId: '',
};
}
}
1 change: 1 addition & 0 deletions src/backends/json/JsonScheduleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class JsonScheduleLoader {
talks,
// TODO Support physical auditoriums in the JSON schedule backend
isPhysical: false,
livestreamId: '',
};
}
}
3 changes: 2 additions & 1 deletion src/backends/penta/PentabarfParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ export class PentabarfParser {
name: metadata.name,
kind: metadata.kind,
talks: new Map(),
isPhysical: isPhysical
isPhysical: isPhysical,
livestreamId: '',
};
const existingAuditorium = this.auditoriums.find(r => r.id === auditorium.id);
if (existingAuditorium) {
Expand Down
1 change: 1 addition & 0 deletions src/backends/pretalx/PretalxParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export async function parseFromJSON(rawJson: string, prefixConfig: IPrefixConfig
talks: new Map(),
isPhysical: isPhysical,
qaEnabled: qaEnabled,
livestreamId: '',
};
auditoriums.set(room.name, auditorium);
}
Expand Down
5 changes: 5 additions & 0 deletions src/models/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ export interface IAuditorium {
* If true, this auditorium is just a virtual representation of a real-world physical auditorium.
*/
isPhysical: boolean;
/**
* Identifier useful for the video livestream URL.
* If not required by the conference backend, should be an empty string.
*/
livestreamId: string;
}

export interface IConference {
Expand Down
6 changes: 4 additions & 2 deletions src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export function renderAuditoriumWidget(req: Request, res: Response, conference:
return res.sendStatus(404);
}

if (!conference.getAuditorium(audId)) {
let aud = conference.getAuditorium(audId);
if (!aud) {
return res.sendStatus(404);
}

Expand All @@ -45,7 +46,8 @@ export function renderAuditoriumWidget(req: Request, res: Response, conference:

const streamUrl = template(auditoriumUrl, {
id: audId.toLowerCase(),
sId: sid
sId: sid,
livestreamId: aud.getDefinition().livestreamId,
});

return res.render('auditorium.liquid', {
Expand Down

0 comments on commit 2856d16

Please sign in to comment.