WebRTC icon indicating copy to clipboard operation
WebRTC copied to clipboard

JS template not working for card styles

Open kentnek opened this issue 1 year ago • 2 comments

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!

kentnek avatar Oct 20 '24 18:10 kentnek

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.

AlexxIT avatar Oct 20 '24 18:10 AlexxIT

Oh I see, thanks for the clarification! I was thinking of hiding the controls when the poster is showing.

kentnek avatar Oct 20 '24 18:10 kentnek