<root>
<document scada='1' projtype='2' schema='103' license='10,36776847,QK3W86' title='Blank Web' description='A blank Web App Developer project suitable for creating apps that run in a browser' fcversion='720898' target='SCADA.SCADA.WEBEXP' >
	<config data='' clkspd='100000000' simspd='0' usewdt='0' constif='0' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<traces />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='4095' />
			<data name='ClockPin' value='0' />
			<data name='DataPort' value='4095' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='2' />
			<data name='CalculatedCommsDelay' value='2' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='1' fixedscale='1' fixedx='25' fixedy='25' fixedz='25' headcode='0' />
		<definition guid='900984dc-5047-48c0-8b71-c815a957da5d' vstate='40' vmin='0' vmaj='1' srcleaf='WEBEXP_Video.fcsx' visiblename='Video' description='Web-based video component' category=' Indicator' category2='' category3='' bIs2dOnly='1' bIs3dOnly='0' bIsWysiwyg='0' catenable='1' author='MatrixTSL' manuname='' manucode='' sysinfo='1052939' keywords='' dynamic='1' scadaCompatible='1' embeddedCompatible='0' showmacros='1' iconpath='..\..\Icons\Components\Video.png' />
		<component class_type='root' codename='WebVideo' panelId='-1' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' varnames='$(type)_$(module)__$(variable:u)' >
			<resources />
			<properties >
				<property name='Video' hidden='0' >
					<property name='Source' target='sSource' typeid='10' hidden='0' locked='0' info='The URL of the source media' />
					<property name='Type' target='sMimeType' typeid='10' hidden='0' locked='0' info='The MIME type of the media (leave blank for auto)' />
					<property name='Thumbnail' target='bThumbnail' typeid='7' hidden='0' locked='0' info='Set an optional image to be shown before the video loads/plays' />
				</property>
				<property name='Thumbnail' folder='dirThumbnail' hidden='1' layout='' >
					<property name='Location' target='imThumbnail::iSource' typeid='12' hidden='0' locked='0' info='The location of the image (a local file or a URL)' filter='000Local file
001URL' />
					<property name='Filename' target='imThumbnail::Image1::sFilename' typeid='13' hidden='0' locked='0' info='The location of a local image file' filter='Image files (*.bmp; *.jpg; *.jpeg; *.png; *.gif)|*.bmp; *.jpg; *.jpeg; *.png; *.gif' />
					<property name='URL' target='imThumbnail::sUrl' typeid='10' hidden='1' locked='0' info='The URL source of the image' />
					<property name='Embed Thumbnail' target='imThumbnail::bEmbed' typeid='7' hidden='0' locked='0' info='Set true to embed the actual image into the generated web page' />
				</property>
				<property name='Options' hidden='0' >
					<property name='Muted' target='bMuted' typeid='7' hidden='0' locked='0' info='Set true to mute the audio from the resource' />
					<property name='Loop' target='bLoop' typeid='7' hidden='0' locked='0' info='Set true to automatically seek to the start of the media once it has reached the end' />
					<property name='Show Controls' target='bControls' typeid='7' hidden='0' locked='0' info='Shows or hides the default set of controls (e.g. pause/resume, volume, seeking)' />
					<property name='Autoplay' target='bAutoplay' typeid='7' hidden='0' locked='0' info='Automatically begin to play the media as soon as it is available' />
				</property>
				<property name='Callbacks' hidden='0' >
					<property name='OnAttached' target='mOnAttached' typeid='24' hidden='0' locked='0' info='Send when a camera feed is attached to this component' filter='NamOn%cAttached
DesA camera feed has been attached to this component' />
				</property>
				<property name='Advanced' hidden='0' >
					<property name='Custom Attributes' target='sCustomAttributes' typeid='10' hidden='0' locked='0' info='' />
				</property>
			</properties>
			<values >
				<value target='sSource' data='' />
				<value target='sMimeType' data='' />
				<value target='bThumbnail' data='0' />
				<value target='imThumbnail::iSource' data='000' />
				<value target='imThumbnail::Image1::sFilename' data='' />
				<value target='imThumbnail::sUrl' data='https://www.flowcode.co.uk/images/dl-flowcode9.png' />
				<value target='imThumbnail::bEmbed' data='0' />
				<value target='bMuted' data='0' />
				<value target='bLoop' data='0' />
				<value target='bControls' data='0' />
				<value target='bAutoplay' data='0' />
				<value target='mOnAttached' data='' />
				<value target='sCustomAttributes' data='' />
			</values>
			<events >
				<event class='Compile' event='HtmlScriptHeader' target='Ev_HtmlScriptHeader' />
				<event class='Components' event='Property' target='Ev_Property' />
				<event class='Compile' event='HtmlBodyInfo' target='Ev_HtmlBodyInfo' />
			</events>
			<apis >
				<api name='AttachToDevice' alt='AttachToDevice' type='1' proto='1' />
				<api name='Pause' alt='Pause' type='1' proto='1' />
				<api name='Play' alt='Play' type='1' proto='1' />
				<api name='Load' alt='Load' type='1' proto='1' />
				<api name='JumpTo' alt='JumpTo' type='1' proto='1' />
				<api name='StopRecording' alt='StopRecording' type='1' proto='1' />
				<api name='GetRecording' alt='GetRecording' type='1' proto='1' />
				<api name='JumpBy' alt='JumpBy' type='1' proto='1' />
				<api name='GetImage' alt='GetImage' type='1' proto='1' />
				<api name='IsPlaying' alt='IsPlaying' type='1' proto='1' />
				<api name='StartRecording' alt='StartRecording' type='1' proto='1' />
				<api name='HasMedia' alt='HasMedia' type='1' proto='1' />
			</apis>
			<variables />
			<macros >
				<macro >
					<flowline name='AttachToDevice' description='Requests permission to use a camera feed.' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='IncludeAudio' type='b1' description='Captures the audio of the camera (if available)' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='native' title='JavaScript' ccode='const filter = { video: true, audio: false };
' language='C' />
						<command class_type='decision' title='Decision' exp='.IncludeAudio' swap='0' >
							<flowline >
								<command class_type='native' title='JavaScript' ccode='filter.audio = true;
' language='C' />
							</flowline>
							<flowline />
						</command>
						<command class_type='native' title='JavaScript' ccode='const video = window[FC_THIS];
const canvas = window[&apos;FCCVS_&apos; + FC_THIS];
const vidX = window[&apos;FCVID_X_&apos; + FC_THIS];

window[&apos;FCVID_ON_&apos; + FC_THIS] = false;' language='C' />
						<command class_type='native' title='Request the camera feed and stream to this component' ccode='navigator.mediaDevices
  .getUserMedia(filter)
  .then((stream) =&gt; {
    window[&apos;FCVID_CAMINIT_&apos; + FC_THIS] = true;
    video.srcObject = stream;
    video.play();
  })
  .catch((err) =&gt; {
    console.error(`An error occurred: ${err}`);
  });' language='C' />
						<command class_type='native' title='Resize the video and hidden canvas to the correct aspect ratio' ccode='//the &apos;canplay&apos; listener does this and is defined elsewhere' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Pause' description='Pauses the media' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='JavaScript' ccode='const video = window[FC_THIS];

video.pause();' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Play' description='Starts or resumes playing the media' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='JavaScript' ccode='const video = window[FC_THIS];

video.play();' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Load' description='Loads new media (or resets the current media if the parameter is blank)' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Source' type='T8' description='The source URL for the media (use empty string to keep use current media)' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
							<array size='2000' />
						</param>
						<command class_type='native' title='JavaScript' ccode='const video = window[FC_THIS];' language='C' />
						<command class_type='decision' title='Decision' exp='Length$(.Source) &gt; 0' swap='0' >
							<flowline >
								<command class_type='native' title='JavaScript' ccode='video.src = FCL_SOURCE;' language='C' />
							</flowline>
							<flowline />
						</command>
						<command class_type='native' title='JavaScript' ccode='video.load();' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='JumpTo' description='Sseeks the media to the new time' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Position' type='f32' description='The position in the media (in seconds)' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='native' title='JavaScript' ccode='const video = window[FC_THIS];' language='C' />
						<command class_type='native' title='JavaScript' ccode='video.currentTime = FCL_POSITION;' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_Property' description='Sent when a property has been changed by the User' statediag='0' >
						<return name='Return' type='u32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='sim' title='Built-in Function' macro='Component.Property.SetVisible' >
							<argument exp='this' />
							<argument exp='&quot;dirThumbnail&quot;' />
							<argument exp='bThumbnail' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Component.SetVisible' >
							<argument exp='imThumbnail' />
							<argument exp='bThumbnail' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='StopRecording' description='Stops recording the media' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='native' title='JavaScript' ccode='window[&quot;FCVID_REC_&quot; + FC_THIS].stop();' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_HtmlScriptHeader' description='Sent to a component to retrieve script code to be placed in the html header section' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to block script code insertion' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='CompID' type='T8' description='The unique name of this component' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<param name='HeaderScript' type='T8*' description='Text to amend for the header script' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='fSize' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' >
							<array size='3' />
						</local>
						<local name='sAddEventListener' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
							<array size='2000' />
						</local>
						<local name='hThumbnail' type='h32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.GetWorldSize' >
							<return exp='.fSize' />
							<argument exp='this' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.fSize[0] = .fSize[0] * 4.0 * 4.0' />
							<exp exp='.fSize[1] = .fSize[1] * 4.0 * 3.0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  var FCVID_ON_&quot; + .CompID + &quot; = false;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  var FCVID_PAUSE_&quot; + .CompID + &quot; = true;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  var FCVID_CAMINIT_&quot; + .CompID + &quot; = false;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  var FCVID_X_&quot; + .CompID + &quot; = &quot; + FloatToString$(.fSize[0],0) + &quot;;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  var FCVID_Y_&quot; + .CompID + &quot; = &quot; + FloatToString$(.fSize[1],0) + &quot;;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  var FCVID_REC_&quot; + .CompID + &quot;;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;  var FCVID_DATA_&quot; + .CompID + &quot; = null;\n\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  document.addEventListener(&apos;DOMContentLoaded&apos;, (event) =&gt; {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    var thisElement = document.getElementById(&apos;&quot; + .CompID + &quot;&apos;);\n&quot;' />
						</command>
						<command class_type='calculation' title='Hide the unnecessary thumbnail image component' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    var imThumbnail = document.getElementById(&apos;id_&quot; + .CompID + &quot;&apos;).getElementsByTagName(&apos;img&apos;)[0];\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    imThumbnail.style.visibility = &apos;hidden&apos;;\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    thisElement.addEventListener(&apos;canplay&apos;, (ev) =&gt; {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      if (FCVID_CAMINIT_&quot; + .CompID + &quot;) {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;        if (!FCVID_ON_&quot; + .CompID + &quot;) {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          //Resize the video and hidden canvas to the correct aspect ratio\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          var video = document.getElementById(&apos;&quot; + .CompID + &quot;&apos;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          var canvas = document.getElementById(&apos;FCCVS_&quot; + .CompID + &quot;&apos;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          FCVID_Y_&quot; + .CompID + &quot; = video.videoHeight / (video.videoWidth / FCVID_X_&quot; + .CompID + &quot;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          video.setAttribute(&apos;width&apos;, FCVID_X_&quot; + .CompID + &quot;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          video.setAttribute(&apos;height&apos;, FCVID_Y_&quot; + .CompID + &quot;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          canvas.setAttribute(&apos;width&apos;, FCVID_X_&quot; + .CompID + &quot;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          canvas.setAttribute(&apos;height&apos;, FCVID_Y_&quot; + .CompID + &quot;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;          FC_&quot; + .CompID + &quot;_Attached();\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;        }\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      }\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      FCVID_ON_&quot; + .CompID + &quot; = true;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    });\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    thisElement.addEventListener(&apos;canplaythrough&apos;, (ev) =&gt; {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      FCVID_ON_&quot; + .CompID + &quot; = true;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    });\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    thisElement.addEventListener(&apos;ended&apos;, (ev) =&gt; {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      FCVID_ON_&quot; + .CompID + &quot; = false;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    });\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    thisElement.addEventListener(&apos;pause&apos;, (ev) =&gt; {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      FCVID_PAUSE_&quot; + .CompID + &quot; = true;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    });\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    thisElement.addEventListener(&apos;playing&apos;, (ev) =&gt; {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      FCVID_PAUSE_&quot; + .CompID + &quot; = false;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    });\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;    thisElement.addEventListener(&apos;loadeddata&apos;, (ev) =&gt; {\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      //set the aspect\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      var video = document.getElementById(&apos;&quot; + .CompID + &quot;&apos;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      let vidY = video.videoHeight / (video.videoWidth / FCVID_X_&quot; + .CompID + &quot;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      video.setAttribute(&apos;width&apos;, FCVID_X_&quot; + .CompID + &quot;);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      video.setAttribute(&apos;height&apos;, vidY);\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;      FCVID_Y_&quot; + .CompID + &quot; = vidY;\n&quot;' />
							<exp exp='.HeaderScript = .HeaderScript + &quot;    })\n&quot;' />
						</command>
						<command class_type='calculation' title='Internal callbacks' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  });\n\n&quot;' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  function FC_&quot; + .CompID + &quot;_Attached() {\n&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='mOnAttached != &quot;&quot;' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' >
									<exp exp='.HeaderScript = .HeaderScript + &quot;    FCM_&quot; + mOnAttached + &quot;();\n&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.HeaderScript = .HeaderScript + &quot;  }\n&quot;' />
						</command>
						<command class_type='calculation' title='Set return to zero to ensure text is added to html file' >
							<exp exp='.Return = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='GetRecording' description='Returns the recorded data' statediag='0' >
						<return name='Return' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='2000' />
						</return>
						<command class_type='native' title='JavaScript' ccode='FCR_RETVAL = URL.createObjectURL(window[&quot;FCVID_DATA_&quot; + FC_THIS]);' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Ev_HtmlBodyInfo' description='Sent to a component to retrieve tags to be placed in the html body' statediag='0' >
						<return name='Return' type='u32' description='Non-zero to block code insertion' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<param name='CompID' type='T8' description='The unique name of this component' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<param name='BodyInfo' type='T8*' description='Text to amend for the body info' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</param>
						<local name='fSize' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' >
							<array size='3' />
						</local>
						<local name='fPos' type='f32' description='' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' >
							<array size='3' />
						</local>
						<local name='sHeight' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='sWidth' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='20' />
						</local>
						<local name='sThumbnail' type='T8' description='' isconst='0' isHidden='0' isinit='1' usrinit='&quot;&quot;' setinit='&quot;&quot;' >
							<array size='2000' />
						</local>
						<local name='iThumbnailSrc' type='s32' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<local name='bThumbnailEmbed' type='b1' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.GetWorldPosition' >
							<return exp='.fPos' />
							<argument exp='this' />
						</command>
						<command class_type='sim' title='Built-in Function' macro='Panel.Position.GetWorldSize' >
							<return exp='.fSize' />
							<argument exp='this' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.fSize[0] = .fSize[0] * 4.0 * 4.0' />
							<exp exp='.fSize[1] = .fSize[1] * 4.0 * 3.0' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.fPos[0] = .fPos[0] - (.fSize[0] / 2.0)' />
							<exp exp='.fPos[1] = 0.0 - .fPos[1] - (.fSize[1] / 2.0)' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.sWidth = FloatToString$ (.fSize[0])' />
							<exp exp='.sHeight = FloatToString$ (.fSize[1])' />
						</command>
						<command class_type='comment' title='' comment='Find the thumbnail (if any)' textarea='12,0,12,0' />
						<command class_type='decision' title='Decision' exp='bThumbnail' swap='0' >
							<flowline >
								<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
									<return exp='.iThumbnailSrc' />
									<argument exp='imThumbnail' />
									<argument exp='&quot;iSource&quot;' />
								</command>
								<command class_type='decision' title='Local file?' exp='.iThumbnailSrc == 0' swap='0' >
									<flowline >
										<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
											<return exp='.sThumbnail' />
											<argument exp='imThumbnail' />
											<argument exp='&quot;Image1::sFilename&quot;' />
										</command>
										<command class_type='decision' title='Decision' exp='Length$(.sThumbnail) &gt; 0' swap='0' >
											<flowline >
												<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
													<return exp='.bThumbnailEmbed' />
													<argument exp='imThumbnail' />
													<argument exp='&quot;bEmbed&quot;' />
												</command>
												<command class_type='decision' title='Decision' exp='.bThumbnailEmbed' swap='0' >
													<flowline >
														<command class_type='sim' title='Built-in Function' macro='System.ConvertFileToBase64' >
															<return exp='.sThumbnail' />
															<argument exp='.sThumbnail' />
														</command>
														<command class_type='calculation' title='Calculation' >
															<exp exp='.sThumbnail = &quot;data:image/bmp;base64,&quot; + .sThumbnail' />
														</command>
													</flowline>
													<flowline />
												</command>
											</flowline>
											<flowline />
										</command>
									</flowline>
									<flowline >
										<command class_type='sim' title='Built-in Function' macro='Component.Property.GetValue' >
											<return exp='.sThumbnail' />
											<argument exp='imThumbnail' />
											<argument exp='&quot;sUrl&quot;' />
										</command>
									</flowline>
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.BodyInfo = &quot;  &lt;div style=&apos;position: absolute; left: &quot; + FloatToString$ (.fPos[0],0) + &quot;px; top: &quot; + FloatToString$ (.fPos[1],0) + &quot;px;&quot;' />
						</command>
						<command class_type='calculation' title='Calculation' >
							<exp exp='.BodyInfo = .BodyInfo + &quot; width: &quot; + .sWidth + &quot;px; height: &quot; + .sHeight + &quot;px; line-height: &quot; + .sHeight + &quot;px;&apos; &gt;\n&quot;' />
						</command>
						<command class_type='calculation' title='Set up information for the video object' >
							<exp exp='.BodyInfo = .BodyInfo + &quot;    &lt;video id=&apos;&quot; + .CompID + &quot;&apos;&quot;' />
							<exp exp='.BodyInfo = .BodyInfo + &quot; width=&apos;&quot; + .sWidth + &quot;&apos; height=&apos;&quot; + .sHeight + &quot;&apos;&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='bMuted' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set up information for the video object' >
									<exp exp='.BodyInfo = .BodyInfo + &quot; muted&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='bControls' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set up information for the video object' >
									<exp exp='.BodyInfo = .BodyInfo + &quot; controls&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='bAutoplay' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set up information for the video object' >
									<exp exp='.BodyInfo = .BodyInfo + &quot; autoplay&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='bLoop' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set up information for the video object' >
									<exp exp='.BodyInfo = .BodyInfo + &quot; loop&quot;' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(.sThumbnail) &gt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set up information for the thumbnail' >
									<exp exp='.BodyInfo = .BodyInfo + &quot; poster=&apos;&quot; + .sThumbnail + &quot;&apos;&quot;' />
									<exp exp='' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(sCustomAttributes) &gt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set up custom attributes' >
									<exp exp='.BodyInfo = .BodyInfo + &quot; &quot; + sCustomAttributes' />
									<exp exp='' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Set up information for the video object' >
							<exp exp='.BodyInfo = .BodyInfo + &quot;&gt;&quot;' />
						</command>
						<command class_type='decision' title='Decision' exp='Length$(sSource) &gt; 0' swap='0' >
							<flowline >
								<command class_type='calculation' title='Set up information for themedia source' >
									<exp exp='.BodyInfo = .BodyInfo + &quot;\n      &lt;source src = &apos;&quot; + sSource + &quot;&apos;&quot;' />
									<exp exp='' />
								</command>
								<command class_type='decision' title='Decision' exp='Length$(sMimeType) &gt; 0' swap='0' >
									<flowline >
										<command class_type='calculation' title='Set up information for the media source' >
											<exp exp='.BodyInfo = .BodyInfo + &quot; type=&apos;&quot; + sMimeType + &quot;&apos;&quot;' />
											<exp exp='' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Set up information for the media source' >
									<exp exp='.BodyInfo = .BodyInfo + &quot;/&gt;\n&quot;' />
									<exp exp='' />
								</command>
							</flowline>
							<flowline />
						</command>
						<command class_type='calculation' title='Set up information for the video object' >
							<exp exp='.BodyInfo = .BodyInfo + &quot;Video not available.&lt;/video&gt;\n&quot;' />
						</command>
						<command class_type='calculation' title='Set up information for the hidden canvas' >
							<exp exp='.BodyInfo = .BodyInfo + &quot;    &lt;canvas id=&apos;FCCVS_&quot; + .CompID + &quot;&apos; style=&apos;display:none;&apos;&gt;&lt;/canvas&gt;\n&quot;' />
						</command>
						<command class_type='calculation' title='End the div' >
							<exp exp='.BodyInfo = .BodyInfo + &quot;  &lt;/div&gt;&quot;' />
						</command>
						<command class_type='calculation' title='Set return to zero to ensure text is added to html file' >
							<exp exp='.Return = 0' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='JumpBy' description='Seeks the media to a new position relative to the current position' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Offset' type='f32' description='The position offset of the media (in seconds)' isconst='0' isHidden='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='native' title='JavaScript' ccode='const video = window[FC_THIS];' language='C' />
						<command class_type='native' title='JavaScript' ccode='video.currentTime = video.currentTime + FCL_OFFSET;' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='GetImage' description='Captures a still image from the video.' statediag='0' >
						<return name='Return' type='T8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='2000' />
						</return>
						<command class_type='native' title='Take a snapshot of the video and return the data URL' ccode='FCR_RETVAL = &quot;&quot;;

if (window[&apos;FCVID_ON_&apos; + FC_THIS])
{
  const video = window[FC_THIS];
  const canvas = window[&apos;FCCVS_&apos; + FC_THIS];
  const vidX = window[&apos;FCVID_X_&apos; + FC_THIS];
  const vidY = window[&apos;FCVID_Y_&apos; + FC_THIS];

  const context = canvas.getContext(&quot;2d&quot;);
  if (vidX &amp;&amp; vidY)
  {
    canvas.width = vidX;
    canvas.height = vidY;
    
    //copy any filter applied to the video to the snapshot
    const videoStyles = window.getComputedStyle(video);
    const filterValue = videoStyles.getPropertyValue(&quot;filter&quot;);
    context.filter = filterValue !== &quot;none&quot; ? filterValue : &quot;none&quot;;

    context.drawImage(video, 0, 0, vidX, vidY);

    FCR_RETVAL = canvas.toDataURL(&quot;image/png&quot;);
  }
}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='IsPlaying' description='The media is currently playing' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='Returns true if has media and is not paused' ccode='FCR_RETVAL = false;

if (window[&apos;FCVID_ON_&apos; + FC_THIS])
{
  if (!window[&apos;FCVID_PAUSE_&apos; + FC_THIS])
  {
    FCR_RETVAL = true;
  }
}' language='C' />
					</flowline>
				</macro>
				<macro >
					<flowline name='StartRecording' description='Starts recording the media' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='decision' title='Decision' exp='HasMedia()' swap='0' >
							<flowline >
								<command class_type='native' title='JavaScript' ccode='const video = window[FC_THIS];' language='C' />
								<command class_type='native' title='JavaScript' ccode='window[&quot;FCVID_REC_&quot; + FC_THIS] = new MediaRecorder(video.captureStream());
window[&quot;FCVID_REC_&quot; + FC_THIS].start();
  
window[&quot;FCVID_REC_&quot; + FC_THIS].ondataavailable = (e) =&gt; { window[&quot;FCVID_DATA_&quot; + FC_THIS] = e.data; };' language='C' />
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='HasMedia' description='The media is currently available' statediag='0' >
						<return name='Return' type='b1' description='' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='native' title='Returns true if has media and is not paused' ccode='FCR_RETVAL = false;

if (window[&apos;FCVID_ON_&apos; + FC_THIS])
{
  FCR_RETVAL = true;
}' language='C' />
					</flowline>
				</macro>
			</macros>
			<component class_type='GdiShape' codename='Canvas' panelId='0' x='200' y='-150' z='0' xsz='125' ysz='93.75' zsz='0' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='2' poslock='8' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='46' >
				<resources />
				<properties />
				<values >
					<value target='nType' data='5' />
					<value target='iSubStyle' data='0' />
					<value target='iRounding' data='25' />
					<value target='colFill' data='16777215' />
					<value target='colFillGradient' data='16777215' />
					<value target='nGradientStyle' data='0' />
					<value target='nFillOpacity' data='1.0' />
					<value target='nStyle' data='0' />
					<value target='bFixedScale' data='0' />
					<value target='fThickness' data='0' />
					<value target='iOutlineSize' data='1' />
					<value target='colOutline' data='0' />
					<value target='colOutlineGradient' data='0' />
					<value target='nOutlineStyle' data='0' />
					<value target='nOutlineOpacity' data='1.0' />
					<value target='bTooltipEnable' data='0' />
					<value target='sTooltipText' data='' />
					<value target='sTooltipDesc' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='d8bcae4d-437d-4252-bdc7-d8132145f18e' vmin='0' vmaj='1' codename='imThumbnail' panelId='0' x='200' y='-150' z='1' xsz='100' ysz='75' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='0' scadavisible='1' interactive='1' solid='1' layer='2' poslock='0' ancTop='0' ancBottom='0' ancLeft='0' ancRight='0' ancMinX='0' ancMinY='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='iSource' data='000' />
					<value target='Image1::sFilename' data='' />
					<value target='sUrl' data='https://www.flowcode.co.uk/images/dl-flowcode9.png' />
					<value target='sAltText' data='(missing image)' />
					<value target='bEmbed' data='0' />
					<value target='Image1::nAlignmentVert' data='  3' />
					<value target='Image1::nAlignmentHoriz' data='  3' />
					<value target='Image1::nAspectLock' data='1' />
					<value target='sCustomAttributes' data='' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='7292207' img='' style='0' />
		<camera xe='0' ye='0' ze='675.369' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='458' dy='737' zoom='82.0558' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='7360576' />
		<winpos ID='7005' RectRecentFloat='405,0,1280,845' RectRecentDocked='0,0,458,737' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='781.66' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
		<winpos ID='7004' RectRecentFloat='556,304,1206,754' RectRecentDocked='0,0,304,450' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='0' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='0' />
	</panel3d>
	<panels2d count='1' >
		<panel2d_0 id='0' name='NewPanel' type='0' >
			<winpos ID='1171' RectRecentFloat='2327,-142,3191,482' RectRecentDocked='755,141,1213,878' RecentFrameAlignment='16384' RecentRowIndex='0' IsFloating='1' MRUWidth='32767' PinState='0' IsMaximized='0' IsVisible='1' />
			<background fill='288230376151053813' showgrid='1' gridstyle='1' gridsize='10' gridbrush='71776119075691740' snaptogrid='1' fitcomp='0' disp_x='300' disp_y='400' scale='100' disp_col='16777215' />
		</panel2d_0>
	</panels2d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_HtmlBodyInfo' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='614' flags='0' />
		<view type='0' name='Ev_HtmlScriptHeader' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='322' flags='0' />
		<view type='0' name='AttachToDevice' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetImage' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='IsPlaying' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='HasMedia' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Play' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Pause' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Load' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='JumpTo' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='JumpBy' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='StartRecording' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='StopRecording' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='GetRecording' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Ev_Property' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAkAMAANwCAAA' zoom='100' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
