CasparCG 2.1 How to use flash template within a scene producer

flash
template
scene

#1

Hi everyone. i am trying to play a flash (swf) file within a scene producer but with no sucess. any help will be appreciated.

i am able to play videos, images, nested scene, color , but not flash
this is the syntax i use

for video layer producer “amb” amb is a video in the media folder.
for image layer producer “bg” bg is an image in the media folder
for color layer producer "red"
for nested scene layer “scene/crawler” where scene/crawler is in the template folder.

for flash layer producer , i tried “flash/clock” where flash/clock is a template in the template folder. the template accepts parameters, but i just do know how to pass it to the template in the scene. i have tried layer.parameters but it didnt wok either.


#2

I haven’t tried with flash, but have successfully used the html producer.

The docs state that any template can be run with the syntax [CG] folder/flash_template string f0 number f1
string f0 and number f1 are parameters to be passed in, which can be variables. I believe update will be auto called for you whenever they change.

A more complete example (I havent tested it, but it is based off my usage with html):

<layer id="content">
  <producer>[CG] folder/flash_template string url number interval</producer>
  <x>0</x>
  <y>0</y>
  <parameters>
    <url>${url}</url>
    <interval>${interval}</interval>
  </parameters>
</layer>

#3

@Julusian Thanks for the response . i tried it but it didn’t work for flash template.


#4

Hmm… did you try calling play on the template? I dont think the template will autoplay, as that looks to be something I added in a fork.
I’m not sure how to do that though, having never done it myself


#5

i have played it without using the scene producer and it played well. but if you mean issuing a play command within the scene, no. i have no clue on how to do that. but i thought scene producers are supposed to auto play after initializing.


#6

i replaced the flash template with an html template, it played but did not run any of my javascript. it did not call the play, update, stop functions. but when i play the same template with CG 1-2 ADD html/template 1 from the console, everything works as expected.


#7

This scene plays a flash template using 2.1Beta2. The key part is the tasks section which invokes the play command to the template.

<scene width="1920" height="1080" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/CasparCG/Server/2.1.0/core/producer/scene/scene.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <variables>
  </variables>

  <layers>
    <layer id="bg">
      <producer>[color] green</producer>
      <x>0</x>
      <y>0</y>
    </layer>
	
    <layer id="main">
      <producer>[cg] phone string f0</producer>
      <x>0</x>
      <y>0</y>
      <parameters>
		<f0>Test</f0>
	  </parameters>
    </layer>
  </layers>

  <tasks>
    <cg_play at="0" to_layer="main" />
  </tasks>

</scene>

#8

@Julusian its working now. thank you