Open SaintFlipper opened 4 years ago
CG ADD without the play-on-load flag is like a LOAD command for media. It will show the first frame of the video but not start playing it yet. For templates it will load and display the HTML page but not call the play function.
Some users hide the HTML body until play is called, achieving a similar effect to a LOADBG command except that nothing else can be displayed on that layer.
Just to clarify:
CG 1-1 ADD 1 TEMPLATE [data] will execute update() and play()
CG 1-1 ADD 1 TEMPLATE 0 [data] will only execute update()
You either have something displaying before the play() call or you are doing something in update() that's displaying.
You can test it by setting body{opacity:0}
in CSS and then in play() you can call document.getElementsByTagName("BODY")[0].style.opacity=1;
Thank you @baltedewit and @hreinnbeck. As you say we can hide the page in some way such as setting opacity=0 until play() is called, and I will do that. I guess the Wiki statement that "it won't show until you call CG PLAY" is really only true if the template contains no static content whereas in our case we have a static background image and logo, and play() was being used to dynamically update the page and start an animation. Nevertheless as you point out we can make play() change the page visibility too.
We're using HTML templates with CasparCG and trying to pre-load and set parameters (CG UPDATE) on a template before showing it.
The AMCP page says of CG ADD "Prepares a template for displaying. It won't show until you call CG PLAY (unless you supply the play-on-load flag, 1 for true)". However we're finding that
This is on version 2.0.7.e9fc25a Stable
Calling CG ADD without play-on-load:
but with play-on-load=0:
At this point the template has already been shown.
Has the meaning of play-on-load changed in v2.0.7 or is this a bug? Is there another way to pre-load and configure an HTML template before showing it?