Compare commits

..

No commits in common. "1e40cc10395df30672bbdf602fb5e24ec3ee9ebf" and "84563d18290b0314db2f8eb7d266662344e54e0c" have entirely different histories.

2 changed files with 13 additions and 16 deletions

View File

@ -64,12 +64,12 @@ async function stream() {
}); });
}; };
r.onstart = () => { r.onstart = () => {
setTimeout(() => r.state === 'recording' && r.stop(), 500); setTimeout(() => r.state === 'recording' && r.stop(), 100);
}; };
r.start(); r.start();
} }
record(); record();
handle = setInterval(record, 500); handle = setInterval(record, 100);
} }
let audioctx; let audioctx;
@ -114,14 +114,15 @@ function loadStreams() {
render(div, html.node` render(div, html.node`
<button id='streaming' onclick=${stream}>start streaming</button> <button id='streaming' onclick=${stream}>start streaming</button>
<span>stream name:</span> <span>stream name:</span>
<input id='streamname' oninput=${event => { <input id='streamname'>`);
if (handle) div.children['streamname'].oninput = event => {
window.emit('stream', { if (handle)
id: streamid, window.emit('stream', {
thread: window.currentThread.id, id: streamid,
name: event.target.value thread: window.currentThread.id,
}); name: div.children['streamname'].value
}}>`); });
};
} }
div.insertAdjacentHTML('beforeend', ` div.insertAdjacentHTML('beforeend', `
<p>streams:</p> <p>streams:</p>

View File

@ -60,7 +60,7 @@ async function stream(msg, respond, socket) {
stream = { stream = {
id: newstreamid++, id: newstreamid++,
thread: msg.thread, thread: msg.thread,
user: msg.auth_user.displayname, user: msg.auth_user.name,
name: msg.name name: msg.name
}; };
thread.streams.push(stream); thread.streams.push(stream);
@ -98,11 +98,7 @@ async function streamdata(msg, respond) {
}); });
} }
for (let id in stream.listeners) for (let id in stream.listeners)
stream.listeners[id].emit('streamdata', { stream.listeners[id].emit('streamdata', msg);
id: msg.id,
audio: msg.audio,
video: msg.video
});
respond({ respond({
success: true success: true
}); });