Skip to content
Snippets Groups Projects
Select Git revision
  • 18aa2bbc91e7179554f9a041a37e5d954a24fd06
  • master default protected
  • dev
  • docker-issue-ok
  • design
  • DojoHepia-v1.0
  • DojoHepia-v0.5
  • DojoHepia-v0.4.5
  • DojoHepia-v0.4
  • DojoHepia-v0.3
  • DojoHepia-v0.2
  • DojoHepia-v0.1
12 results

fetch-kata-show-case.service.ts

Blame
  • Forked from alexandr.vanini / dojo-hepia
    Source project has a limited visibility.
    index.html 685 B
    <html>
      <head>
        <title>Video Stream</title>
      </head>
      <body style="background-color:#222;">
        <h1>Video Stream</h1>
        <img id="currentImage" style="border:2px solid teal;height:700px;">
        <script>
    
          var img = document.getElementById("currentImage");
          var ws = new WebSocket("ws://" + location.host + "/stream");
    
          ws.onopen = function() {
              console.log("connection was established");
              ws.send("next");
          };
    
          ws.onmessage = function(msg) {
              img.src = 'data:image/png;base64, ' + msg.data;
          };
    
          img.onload = function() {
            ws.send("next");
          }
        </script>
      </body>
    </html>