Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toggleLiveCallingStats() {
const containerId = 'live-calling-stats';
const containerElement = document.getElementById(containerId);
if (containerElement) {
clearInterval(this.liveCallingStatsInterval);
document.body.removeChild(containerElement);
return;
}
const statsDomElement = Object.assign(document.createElement('div'), {id: containerId});
document.body.appendChild(statsDomElement);
const patch = snabbdomInit([style]);
let vdom = createElement('div');
patch(statsDomElement, vdom);
const renderStats = async participantsStats => {
return Promise.all(
participantsStats.map(async participantStats => {
const rawStats = [];
participantStats.stats.forEach(stats => {
if (
(stats.kind === 'audio' || stats.kind === 'video') &&
(stats.packetsReceived || stats.packetsSent) &&
!stats.id.includes('rtcp')
) {
rawStats.push(stats);
}
});
function render() {
return h('div#chessground-examples', [
h('menu', examples.map((ex, id) => {
return h('a', {
class: {
active: example.name === ex.name
},
on: { click: () => page(`/${id}`) }
}, ex.name);
})),
h('section', [
h('div.chessground.wood.small.merida.coordinates', {
hook: {
insert: runExample,
postpatch: runExample
}
}),
h('p', example.name)
h('menu', examples.map((ex, id) => {
return h('a', {
class: {
active: example.name === ex.name
},
on: { click: () => page(`/${id}`) }
}, ex.name);
})),
h('section', [
h('div.chessground.wood.small.merida.coordinates', {
hook: {
insert: runExample,
postpatch: runExample
}
}),
h('p', example.name)
]),
h('control', [
h('button', { on: { click() { cg.toggleOrientation(); }}}, 'Toggle orientation')
])
]);
}
function render() {
return h('div#chessground-examples', [
h('menu', examples.map((ex, id) => {
return h('a', {
class: {
active: example.name === ex.name
},
on: { click: () => page(`/${id}`) }
}, ex.name);
})),
h('section', [
h('div.chessground.wood.small.merida.coordinates', {
hook: {
insert: runExample,
postpatch: runExample
}
}),
h('p', example.name)
]),
active: example.name === ex.name
},
on: { click: () => page(`/${id}`) }
}, ex.name);
})),
h('section', [
h('div.chessground.wood.small.merida.coordinates', {
hook: {
insert: runExample,
postpatch: runExample
}
}),
h('p', example.name)
]),
h('control', [
h('button', { on: { click() { cg.toggleOrientation(); }}}, 'Toggle orientation')
])
]);
}
function render() {
return h('div#chessground-examples', [
h('menu', examples.map((ex, id) => {
return h('a', {
class: {
active: example.name === ex.name
},
on: { click: () => page(`/${id}`) }
}, ex.name);
})),
h('section', [
h('div.chessground.wood.small.merida.coordinates', {
hook: {
insert: runExample,
postpatch: runExample
}
}),
h('p', example.name)
]),
h('control', [
h('button', { on: { click() { cg.toggleOrientation(); }}}, 'Toggle orientation')
])
]);
}