Robo3D / Robo-iOS-Beta

1 stars 0 forks source link

Webcam path is hardcoded and not taken from /api/settings #18

Closed foosel closed 8 years ago

foosel commented 8 years ago

The webcam view only works when using a stock OctoPi setup with the webcam served under http://<host>:<port>/webcam/?action=stream. Using a differently setup webcam (e.g. an actual IP cam on the LAN available at an entirely different IP address than the OctoPrint backend server) no video is available in the app.

The webcam stream URL to use is available in the /api/settings response. Note that the URL returned here might be a fully qualified URL (<protocol>://<host>:<port>/<path>), a protocol relative URL (//<host>:<port>/<path>), an absolute path on the same host (/<path>) or a relative path (<path>). You'll need to detect that and construct the URL to use for displaying accordingly.

bryantjk commented 8 years ago

Thanks, I didn't consider the other possible environments. I'll pull the URL from the API

AllenMcAfee commented 8 years ago

@bryantjk What build do you want to aim for this to be changed in?

bryantjk commented 8 years ago

I have moved this to 1.0.4 as I worked on it before I realized it was in 1.0.5. Right now, when a user adds a printer to the app, the app first does a call to api/settings to get the URL and tries to construct a valid url from whatever components are provided by the api. Then the new printer is saved to the device.

However, we still need to play with this more as it doesn't account for printers that have already been setup before this update is pushed. Right now I have an alert popup in the app prompting user to re-add the printer, but that probably isn't the best approach.

bryantjk commented 8 years ago

1.0.4 (3) Added ability to view/update the camera url from the printer edit screen so users no longer have to delete/add printer to get that url added.