Hubert
April 27, 2021, 11:42am
1
Hi Forum!
I want to use JavaScript in my webpage to find out if it is rendered in CasparCG. This is for analytics purposes.
In OBS I can simply check if window.obsstudio exists. Does anybody know if there is something similar in CasparCG?
In this thread here this topic came up and the suggestion was to check for
if (screen.colorDepth == 0) {
}
but I don’t think that this will be unique to CasparCG. Does anybody know a more reliable way to detect CasparCG from JavaScript?
best regards,
Hubert
CasparCG will always call for update()
. You can set a variable in there that CasparCG is involved.
Well, only if it’s added as a template
1 Like
if(window.caspar || window.casparcg || window.tickAnimations) {
// Checking for tickAnimations is for older CCG versions since it injected JS for rAF. caspar exists in most and window.casparcg exists in NRK
console.log('Running in CCG');
}
2 Likes
Hubert
April 27, 2021, 12:20pm
4
This is exactly what I need!
Thanks a lot!
Hubert
I Again checked and found this works.
Hubert
April 28, 2021, 2:19am
6
Hi Vimlesh!
I will also give that a try and test it.
best regards,
Hubert
1 Like