Add presentation upload and management features to room functionality
Some checks failed
Build & Push Docker Image / build (push) Failing after 1m11s
Some checks failed
Build & Push Docker Image / build (push) Failing after 1m11s
This commit is contained in:
@@ -16,10 +16,13 @@ function buildUrl(apiCall, params = {}) {
|
||||
return `${BBB_URL}${apiCall}?${queryString}`;
|
||||
}
|
||||
|
||||
async function apiCall(apiCallName, params = {}) {
|
||||
async function apiCall(apiCallName, params = {}, xmlBody = null) {
|
||||
const url = buildUrl(apiCallName, params);
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const fetchOptions = xmlBody
|
||||
? { method: 'POST', headers: { 'Content-Type': 'application/xml' }, body: xmlBody }
|
||||
: {};
|
||||
const response = await fetch(url, fetchOptions);
|
||||
const xml = await response.text();
|
||||
const result = await xml2js.parseStringPromise(xml, {
|
||||
explicitArray: false,
|
||||
@@ -39,7 +42,7 @@ function getRoomPasswords(uid) {
|
||||
return { moderatorPW: modPw, attendeePW: attPw };
|
||||
}
|
||||
|
||||
export async function createMeeting(room, logoutURL, loginURL = null) {
|
||||
export async function createMeeting(room, logoutURL, loginURL = null, presentationUrl = null) {
|
||||
const { moderatorPW, attendeePW } = getRoomPasswords(room.uid);
|
||||
|
||||
// Build welcome message with guest invite link
|
||||
@@ -77,7 +80,13 @@ export async function createMeeting(room, logoutURL, loginURL = null) {
|
||||
if (room.access_code) {
|
||||
params.lockSettingsLockOnJoin = 'true';
|
||||
}
|
||||
return apiCall('create', params);
|
||||
|
||||
// Build optional presentation XML body
|
||||
const xmlBody = presentationUrl
|
||||
? `<modules><module name="presentation"><document url="${presentationUrl}" /></module></modules>`
|
||||
: null;
|
||||
|
||||
return apiCall('create', params, xmlBody);
|
||||
}
|
||||
|
||||
export async function joinMeeting(uid, name, isModerator = false, avatarURL = null) {
|
||||
|
||||
Reference in New Issue
Block a user