HTML template command best practices

Interested in what people are doing and best practices for using HTML templates. In my case i am playing HTML templates hosted on a local web server. I am using the command e.g.

PLAY 1-10 [HTML] “https://localhost/page

is there any advantage of different to using

CG 1 ADD 0 “https://localhost/page” 1

i understand that using CG ADD will trigger the PLAY and UPDATE functions in the template but other than that does it matter?

also what are people using to stop and remove?

CG 1 STOP 0 is fine and i use to trigger my outdo animation but it will not also remove the template

do i need to use CLEAR 1 for this now as i understand that from v2.2.0 the REMOVE command wont actually remove an HTML template

looking forward to hearing thoughts!

There is no performance difference between PLAY and CG and you can do all the CG commands with CALL.

You can use “window.close();” in your stop or remove functions.

1 Like

If you are using a web server (web client) to also control Caspar with a package like CasparCG Connection, I would recommend using CG Load then CG PLAY. This way you don’t attempt to play the template before any external images / videos / scripts and so on have had a chance to load.

Great tips. thanks guys. I am using jQuery document.load to not render the loading animation until the page has fully loaded

Never though of using window.close, i guess i can just delay this until my outro animation has completed

Don’t need to do LOAD then PLAY. Just set play-on-load as 0 in CG PLAY command like:
CG 1-10 ADD 1 template 0 “data”

1 Like