Commit 64dc5602 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

link to auto-refreshed images - decoded jpeg, tiff, jp4

parent 1a375d7a
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,8 @@ DOCUMENTROOT=$(DESTDIR)/www/pages
OWN = -o root -g root
OWN = -o root -g root
INSTDOCS = 0644
INSTDOCS = 0644
INSTALL = install
INSTALL = install
DOCS=       index.html \
DOCS=       img.html \
            index.html \
            index.php \
            index.php \
            mjpeg.html
            mjpeg.html


src/index/img.html

0 → 100644
+50 −0
Original line number Original line Diff line number Diff line
<html>
    <head>
        <style>
            body {
                margin: 0px;
            }
            #cnv_div {
                border: 0px solid red;
            }
            #display{
                height: 100%;
            }
        </style>
    </head>
    <body>

        <div id='cnv_div'></div>

        <script src="js/elphel.js"></script>
        <script src="js/UTIF.js"></script>
        <script src="js/jquery-3.1.1.js"></script>
        <script src="js/jcanvas.js"></script>
        <script src="js/exif.js"></script>
        <script src="js/jquery-jp4.js"></script>

        <script>

            const IMGSRV_PORT0 = 2323;

            const params = new URLSearchParams(location.search);
            const port = params.get('port') || 0;
            const refresh = params.get('refresh') || 5;

            if (params.get('port')===null){
                let s = "";
                if (location.search===""){
                    s = "?port="+port;
                }else{
                    s = location.search+"&port="+port;
                }
                window.history.pushState('', '', location.pathname+s);
            }

            let imgsrv_port = IMGSRV_PORT0 + parseInt(port);

            let t1 = $("#cnv_div").jp4({src:"http://"+location.host+":"+imgsrv_port+"/img",width:600,fast:true,lowres:2,debug:false,refresh:true});

    </script>
  </body>
</html>
 No newline at end of file
+8 −1
Original line number Original line Diff line number Diff line
@@ -132,7 +132,14 @@
        $table_contents .= "<div class='port_window img_window'>";
        $table_contents .= "<div class='port_window img_window'>";
        //$table_contents .= "<div><a href=\"$href1\"><img class='img_window' src='$href1' style='width:300px'/></a></div>";
        //$table_contents .= "<div><a href=\"$href1\"><img class='img_window' src='$href1' style='width:300px'/></a></div>";
        $table_contents .= "<div><a href=\"$href1\"><div index='$i' class='port_preview'></div></a></div>";
        $table_contents .= "<div><a href=\"$href1\"><div index='$i' class='port_preview'></div></a></div>";
        $table_contents .= "<div style='text-align:center;'>port $i: <a title='single image' href='$href1'>bimg</a>, <a title='multi-part image stream (M-JPEG). Played in browser as is.' href='$href2'>mimg</a>, <a href=\"mjpeg.html?port=$i\" title='MJPEG stream played in html canvas' class='canvas_mjpeg'>canvas</a></div>";
        $table_contents .= "<div style='text-align:center;'>";
        $table_contents .= "port $i: ";
        $table_contents .= "<a title='single image' href='$href1'>bimg</a>, ";
        $table_contents .= "<a href=\"img.html?port=$i\" title='single image, auto refreshed on load'>img</a>, ";
        $table_contents .= "<a title='multi-part image stream (M-JPEG). Played in browser as is.' href='$href2'>mimg</a>, ";
        $table_contents .= "<a href=\"mjpeg.html?port=$i\" title='MJPEG stream played in html canvas' class='canvas_mjpeg'>canvas</a>";
        $table_contents .= "</div>";

        $table_contents .= "</div>";
        $table_contents .= "</div>";
        $table_contents .= "</td>";
        $table_contents .= "</td>";