You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
558 B
JavaScript

class StreamWidget extends BaseWidget {
$el;
constructor(data, renderer) {
super(data, renderer);
this.makeLayout({
type: 'img',
name: 'el',
style: {
width: '100%',
}
});
this.update(data);
}
update(data){
super.update(data);
if ('port' in data || 'path' in data)
this.$el.src = `http://${this.renderer.device.info.ip}:${data.port}/${data.path ?? ''}`;
}
}
Renderer.register('stream', StreamWidget);