WebRTC
WebRTC copied to clipboard
JS template not working for card styles
I noticed that version 3.6.0 introduced template support for style. However this doesn't seem to work:
style: ${ this.streamID === 0 ? '.controls { display: none }' : 'some other style' }
or even this
style: ${ '.controls { display: none }' }
Am I missing something? Thanks for the great work anyway!
This is because every JS template parsing as JSON. So style should be JSON string and require additional quotations. This should be fixed... style: "\"${ '.mode {display: none}' }\"".
Also, the style will not update when the stream changes. This only works for PTZ templates.
Oh I see, thanks for the clarification! I was thinking of hiding the controls when the poster is showing.