heimcontrol.js icon indicating copy to clipboard operation
heimcontrol.js copied to clipboard

Webcam via Motion shows only iframe with 404 inside

Open lichtteil opened this issue 10 years ago • 1 comments

I tried to set up a webcam using 'motion'. The settings are straight forward but on the home screen the content of the webcam stream iframe only shows a 404-error produced by heimcontrol.

The source of the iframe is /webcam/motion/some-id-of-webcam. Trying to open that also results in 404-error-page.

I found out that the error page is shown before the router shows the webcam-plugin's content. My solution was use another way to handle 404s. In https://github.com/ni-c/heimcontrol.js/blob/master/heimcontrol.js#L174 I replaced

app.get('plugin helper').getPluginList(function(err, plugins) {
        app.locals.plugins = plugins;
        app.set('plugins', plugins);

        // 404 Not found
        app.all('*', Routes.notFound);

      });

by

 app.get('plugin helper').getPluginList(function(err, plugins) {
        app.locals.plugins = plugins;
        app.set('plugins', plugins);
      });

      // 404 Not found
      app.use(Routes.notFound);

Can anyone confirm that issue and also the solution? Cheers!

lichtteil avatar Nov 17 '14 17:11 lichtteil

Thanks! Working now on Safari!

Gagnon06 avatar Jan 15 '15 02:01 Gagnon06