diff options
| author | yum <yum.food.vr@gmail.com> | 2023-02-24 13:31:11 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-02-24 13:31:11 -0800 |
| commit | c18b6842757e1a40f27bd940a810e32f3a0c485c (patch) | |
| tree | 13e0a474eaeb9ea492bfcb65969e68da253ffe34 /BrowserSource | |
| parent | c1c8d552d2d6643aa34f3fde8816c3a9101ac157 (diff) | |
Add HTML for BrowserSource
Browser source queries /api/transcript at 10Hz via jquery and renders
the response.
Diffstat (limited to 'BrowserSource')
| -rw-r--r-- | BrowserSource/index.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/BrowserSource/index.html b/BrowserSource/index.html new file mode 100644 index 0000000..decdba2 --- /dev/null +++ b/BrowserSource/index.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<html> + <head> + <title>TaSTT</title> + <script src="https://code.jquery.com/jquery-3.6.3.min.js"></script> + </head> + <body> + <div id="transcript"></div> + <script> + function getTranscript() { + $.ajax({ + // TODO(yum) parameterize the port + url: 'http://localhost:9517/api/transcript', + method: 'GET', + dataType: 'json', + success: function(data) { + var transcript = data.transcript; + $('#transcript').html(transcript); + }, + error: function(jqXHR, textStatus, errorThrown) { + console.error('Error getting transcript: ', textStatus, errorThrown); + } + }); + } + setInterval(getTranscript, /*interval_ms=*/100); + </script> + </body> +</html> |
