Support for username/password in camera URLs if authentication is required

This commit is contained in:
Fabio Manganiello 2019-12-24 13:49:18 +01:00
parent 5d5e8b54ae
commit ef58cc9e32

View file

@ -85,6 +85,11 @@ Vue.component('camera-android-ipcam', {
if (cam[attr].startsWith('https://')) {
cam[attr] = cam[attr].replace('https://', 'http://');
}
if (cam[name] in this.config && this.config[cam[name]].username) {
cam[attr] = 'http://' + this.config[cam[name]].username + ':' +
this.config[cam[name]].password + cam[attr].substr(7);
}
}
cameras[cam.name] = cam;