forked from webex/EmbeddedAppKitchenSink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparticipant.js
49 lines (43 loc) · 1.64 KB
/
participant.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var app = new window.Webex.Application();
app.onReady().then(() => {
log('onReady()', { message: 'participant app is ready' })
app.listen().then(() => {
app.on('application:displayContextChanged', (payload) => log('application:displayContextChanged', payload));
app.on('application:shareStateChanged', (payload) => log('application:shareStateChanged', payload));
app.on('application:themeChanged', (payload) => log('application:themeChanged', payload));
app.on('meeting:infoChanged', (payload) => log('meeting:infoChanged', payload));
app.on('meeting:roleChanged', (payload) => log('meeting:roleChanged', payload));
app.on('space:infoChanged', (payload) => log('space:infoChanged', payload));
})
});
function handleGetUser() {
app.context.getUser().then((u) => {
log('getUser()', u);
}).catch((error) => {
log('getUser() promise failed with error', Webex.Application.ErrorCodes[error]);
})
}
function handleGetMeeting() {
app.context.getMeeting().then((m) => {
log('getMeeting()', m);
}).catch((error) => {
log('getMeeting() promise failed with error', Webex.Application.ErrorCodes[error]);
});
}
function handleGetSpace() {
app.context.getSpace().then((s) => {
log('getSpace()', s);
}).catch((error) => {
log('getSpace() promise failed with error', Webex.Application.ErrorCodes[error]);
});
}
function handleDisplayAppInfo() {
log('Display Application', app);
}
function log(type, data) {
var ul = document.getElementById("console");
var li = document.createElement("li");
var payload = document.createTextNode(`${type}: ${JSON.stringify(data)}`);
li.appendChild(payload)
ul.prepend(li);
}