You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
1.0 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live Typing Speaker View</title>
<style>
body {
font-family: Futura, sans-serif;
font-size: 32px;
padding: 20px;
}
#typingArea {
width: 100%;
height: 200px;
font-size: 32px;
padding: 10px;
}
</style>
</head>
<body>
<h1>Live Typing Speaker View</h1>
<textarea id="typingArea" placeholder="Type subtitles here..."></textarea>
<script src="/socket.io/socket.io.js"></script>
<script>
const socket = io();
const typingArea = document.getElementById('typingArea');
// Emit typed text to audience view on keyup event
typingArea.addEventListener('keyup', () => {
const typedText = typingArea.value;
socket.emit('live_typing', typedText); // Send current text to audience
});
</script>
</body>
</html>