heimcontrol.js
heimcontrol.js copied to clipboard
Webcam via Motion shows only iframe with 404 inside
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!
Thanks! Working now on Safari!