stream fix

main
jerl 2024-05-30 00:01:38 -07:00
parent d687ea7a20
commit 1e40cc1039
1 changed files with 10 additions and 11 deletions

View File

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