quanticchaos / OctoPrint-Webcamsb

9 stars 4 forks source link

Support webrtc plugin #22

Open csm10495 opened 9 months ago

csm10495 commented 9 months ago

If using this plugin: https://github.com/cp2004/OctoPrint-CameraStreamer-Control , you're encouraged to disable the "Classic Webcam" plugin.

If you use the default settings for this plugin, it'll fail to load the webcam view:

image

Here is some relevant html:

<div id="sidebar_plugin_webcamSB" class="accordion-body collapse in ">
   <div class="accordion-inner" data-test-id="sidebar-sidebar_plugin_webcamSB-content">
      <div class="row-fluid">
         <div id="webcamsb">
            <table id="wcsb_t">
               <tbody>
                  <tr>
                     <td id="wcsb_imc" data-bind="click: wcsbPOC" style="height: auto;"><img id="sidewebcam" src="undefined?1695181019831" style="transform: scale(1, 1) rotate(0deg); width: auto; height: auto;"></td>
                  </tr>
                  <tr>
                     <td id="wcsb_bot"></td>
                  </tr>
               </tbody>
            </table>
         </div>
      </div>
   </div>
</div>

It looks like if webrtc is enabled we could just use an iframe or something to embed /webcam/webrtc instead of trying to work with the mjpeg.

csm10495 commented 9 months ago

As a workaround, you can set the stream url to a legacy mjpeg one:

http://<ip>/webcam/stream

Though it would be nice to use the same webrtc/h264 stream as the main ui