in cdk-stacks/docker/recording/recording-app/src/js/app.js [23:79]
async function start() {
if (window.meetingSession) {
console.info('MeetingSession already exists');
return
}
const chimeMeetingDataEncoded = urlParams.get("chimeMeetingData");
if (!chimeMeetingDataEncoded) {
console.error(`URL Parameter missing: chimeMeetingData`);
return
}
const chimeAttendeeDataEncoded = urlParams.get("chimeAttendeeData");
if (!chimeAttendeeDataEncoded) {
console.error(`URL Parameter missing: chimeAttendeeData`);
}
try {
const chimeMeetingData = JSON.parse(atob(chimeMeetingDataEncoded));
const chimeAttendeeData = JSON.parse(atob(chimeAttendeeDataEncoded));
displayExternalMeetingId(chimeMeetingData.ExternalMeetingId);
const configuration = new ChimeSDK.MeetingSessionConfiguration(
chimeMeetingData,
chimeAttendeeData,
);
window.meetingSession = new ChimeSDK.DefaultMeetingSession(
configuration,
logger,
deviceController
);
const observer = {
// videoTileDidUpdate is called whenever a new tile is created or tileState changes.
videoTileDidUpdate: (tileState) => {
console.info("Video tile updated...");
console.info(tileState);
// Ignore a tile without attendee ID and other attendee's tile.
if (!tileState.boundAttendeeId) {
return;
}
updateTiles(window.meetingSession);
},
};
await window.meetingSession.audioVideo.addObserver(observer);
const audioOutputElement = document.getElementById("meeting-audio");
await window.meetingSession.audioVideo.bindAudioElement(audioOutputElement);
await window.meetingSession.audioVideo.start();
} catch (err) {
console.error("Error occurred: ", err.message)
}
}