summaryrefslogtreecommitdiffstats
path: root/BrowserSource/index.html
blob: decdba2824a3caea3cff6b43a838e0a7fb22e01f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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>