<krpano>
		
	<include url="%VIEWER%/plugins/contextmenu.xml" />
	
	<include url="chromakey_helper.xml" />
	<set var="chromakey_helper_hotspot" val="video" />
		
	<preview type="grid(cube,32,32,512,0xCCCCCC,0xFFFFFF,0x999999);" />
	
	<!-- note: the video-source has an unwanted border, this is removed with the crop setting -->
	<hotspot name="video"
	         url="%VIEWER%/plugins/videoplayer.js"
	         videourl="video.mp4"
	         chromakey="0x238E54|0.294|0.133"
	         loop="true"
	         distorted="true"
	         zoom="true"
	         scale="0.3"
	         ondown="draghotspot();"
	         onclick="togglepause();"
	         cursor="grab"
	         ondown.addevent="set(cursor,grabbing);"
	         onup.addevent="set(cursor,grab);"
	         />

	<action name="draghotspot">
		spheretoscreen(ath, atv, hotspotcenterx, hotspotcentery, calc(mouse.stagex LT stagewidth/2 ? 'l' : 'r'));
		sub(drag_adjustx, mouse.stagex, hotspotcenterx);
		sub(drag_adjusty, mouse.stagey, hotspotcentery);
		asyncloop(pressed,
			sub(dx, mouse.stagex, drag_adjustx);
			sub(dy, mouse.stagey, drag_adjusty);
			screentosphere(dx, dy, ath, atv);

		  );
	</action>
	
	<layer name="info" type="text" css="color:#000000;text-align:right;" bg="false" txtshadow="0 1 2 0xFFFFFF 1.0" align="righttop" x="2" y="2" handcursor="false" capture="false"
		html="Feature request and video from [a href='https://polyvista.de/' target='_blank' style='color:#000000;']polyvista.de[/a]"
		/>
	
</krpano>
