<krpano version="1.20.9" title="Virtual Tour">

	<action name="mytest">
	  screentosphere(mouse.x, mouse.y, toh, tov);
	  jscall(calc('console.log("'+toh+'")'));
	  jscall(calc('console.log("'+tov+'")'));
	</action>
	
	<events
		onclick="mytest();"
	/>
	
	<!-- startup action - load the first scene -->
	<action name="startup" autorun="onstart">
		if(startscene === null OR !scene[get(startscene)], copy(startscene,scene[0].name); );
		loadscene(get(startscene), null, MERGE);
		if(startactions !== null, startactions() );
	</action>
	<events onloadcomplete="sceneload"></events>
	<action name="sceneload">
	    jscall('window.sceneload()');
	</action>
	<!-- <events onenterfullscreen=""          切换到全屏显示执行
	        onexitfullscreen=""           从全屏切换回普通视图时执行
	        onxmlcomplete=""              XML文件加载完成时执行
	        onpreviewcomplete=""          预览图加载完成时执行
	        onloadcomplete=""             全景切片图片加载完毕时执行
	        onnewpano=""                  当启动新的全景场景时执行
	        onremovepano=""               当前场景被关闭时执行（加载新场景前）
	        onnewscene=""                 新场景加载完成时执行
	        onloaderror=""                加载错误时执行，执行被设置后，屏幕将不显示默认的错误信息
	        οnkeydοwn=""                  当某个键盘被按下时执行
	        οnkeyup=""                    当某个键盘松开时执行
	        οnclick=""                    当鼠标点击全景场景时执行
	        οnmοusedοwn=""                当鼠标按下时执行
	        οnmοuseup=""                  当鼠标松开时执行
	        onmousewheel=""               当鼠标滚轮滚动时执行
	        onidle=""                     当无用户操作在设定秒数后执行
	        onviewchange=""               当场景转变时执行（渲染开始时）
	        onviewchanged=""              当场景转变时执行（渲染完成时）
	        οnresize=""                   当浏览器大小改变时执行
	        /> -->
	<!-- <events onloadcomplete="visible_hotspotGroupA"></events> -->
	<scene name="mainScene" onstart=""
		havevrimage.mobilevr="false" 
		havevrimage.no-mobilevr="true" lat="" lng="" heading="">

		<control bouncinglimits="calc:image.cube ? true : false" />

		<view hlookat="50.082" vlookat="12.404" fovtype="MFOV" fov="90.000" maxpixelzoom="2.0" fovmin="70" fovmax="120" limitview="auto" />

		<!-- <preview url="https://elab-marketing-web.oss-cn-shanghai.aliyuncs.com/fairyMountain/layout/hospital/panos/ceshi.tiles/preview.jpg" /> -->

		<image if="!(webvr.isenabled OR device.mobilevr)">
			<!-- <cube url="https://elab-marketing-web.oss-cn-shanghai.aliyuncs.com/fairyMountain/layout/hospital/panos/ceshi.tiles/%s/l%l/%v/l%l_%s_%v_%h.jpg" multires="512,1024,2048" /> -->
			<!-- <sphere url="https://elab-marketing-web.oss-accelerate.aliyuncs.com/aiBeauty/1702533120761.png" /> -->
			<sphere url="%$panorama_url%" />
		</image>

		<image if="webvr.isenabled OR device.mobilevr">
			<!-- <cube url="https://elab-marketing-web.oss-cn-shanghai.aliyuncs.com/fairyMountain/layout/hospital/panos/ceshi.tiles/vr/pano_%s.jpg" /> -->
			<!-- <sphere url="https://elab-marketing-web.oss-accelerate.aliyuncs.com/aiBeauty/1702533120761.png" /> -->
			<sphere url="%$panorama_url%" />
		</image>
		<!--火车站-->
		<!-- <hotspot name="spot2" url="skin/plugin.png" distorted="true" keep="false" ath="145.763" atv="22" visible="true"></hotspot>
		<plugin  parent="hotspot[spot2]" name="hottiyan_2" type="container"  width="40" bgalpha="0.0" bgcapture="true" >
			<layer  name="title2_hottiyan" style="text" align="bottom" x="0" y="75" width="100%" html="火车站" css="text-align:center; color:#5D7B53; font-family:Arial; font-weight:400; font-size:17px;border: 0px solid #fff;border-radius:10px;padding: 10px 5px; box-sizing: border-box;background: rgba(255, 255, 255, 0.2);border-radius: 10px;backdrop-filter: blur(50px);">
			</layer>
			<layer  name="title2_line1_hottiyan" style="text" align="top center" x="0" y="-80" height="80px" css="background-color:#fff;width:1px;height:80px"  />
			<layer  name="title2_line2_hottiyan" style="text" align="top center" x="0" y="0" css="background-color:#fff;width:6px;height:6px;border-radius:50%;"  />
		</plugin> -->
		<!-- <preview url="test3333.png"/> 			onloaded.addevent="sceneload();"-->
		
		<hotspot name="video"
			ath="50.082" 
			atv="14"
			url="https://dm.static.elab-plus.com/videoplayer.js"
			videourl=""
			width="180"
			height="320"
			chromakey="0x238E54|0.294|0.133"
			preload="true"
			pausedonstart="false"
			loop="true"
			distorted="true"
			muted="true"
			zoom="true"
			autopause="true"
			autoresume="true"
			scale="1"
			onvideoready="videoreadyFunc"
			onvideoplay="videoplayHandle"
			ondown="draghotspot();"
			onclick="togglepause();"
			cursor="grab"
			ondown.addevent="set(cursor,grabbing);"
			onup.addevent="set(cursor,grab);"
			zorder="2"
			enabled="true"
		>
		</hotspot>
		<!-- 电子人的阴影 -->
		<hotspot name="image_hotspot" ath="50.082" atv="14" rotate="0" zorder="1"
			distorted="true" scale="1" alpha="0.5" visible="false" width="180" height="320"
			url="https://dm.static.elab-plus.com/miniProgram/shadow11.png" keep="true"></hotspot>
		<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);
				set(hotspot[image_hotspot].ath, get(ath));
				set(hotspot[image_hotspot].atv, get(atv));
			);
		</action>
		<!-- 宠物视频 -->
		<hotspot name="petVideo"
			ath="80.0" 
			atv="14"
			url="https://dm.static.elab-plus.com/videoplayer.js"
			videourl=""
			width="180"
			height="180"
			chromakey="0x238E54|0.294|0.133"
			preload="true"
			pausedonstart="false"
			loop="true"
			distorted="true"
			muted="true"
			zoom="true"
			autopause="true"
			autoresume="true"
			scale="1"
			ondown="dragpetspot();"
			cursor="grab"
			ondown.addevent="set(cursor,grabbing);"
			onup.addevent="set(cursor,grab);"
			zorder="2"
		>
		</hotspot>
		<action name="dragpetspot">
			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>
		<!-- 红包 -->
		<!-- <hotspot name="redBox" ath="50.082" atv="14" rotate="-45.0" zorder="1"
			distorted="true"  ondown="dragRedSpot();"
			url="https://dm.static.elab-plus.com/miniProgram/redbox.gif">
		</hotspot> -->
		<hotspot name="redBox"
			ath="60" 
			atv="14"
			url="https://dm.static.elab-plus.com/videoplayer.js"
			videourl=""
			chromakey="0x30B524|0.294|0.133"
			preload="true"
			pausedonstart="false"
			loop="true"
			distorted="true"
			muted="true"
			zoom="true"
			autopause="true"
			autoresume="true"
			scale="1"
			ondown="dragRedSpot();"
			cursor="grab"
			ondown.addevent="set(cursor,grabbing);"
			onup.addevent="set(cursor,grab);"
			zorder="2"
		>
		</hotspot>
		<action name="dragRedSpot">
			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>
		<action name="showRedBox">
			def(scale, string, get(hotspot[redBox].scale));
			set(hotspot[redBox].visible, 'true');
			hotspot[redBox].playvideo(%1, '', false);
			set(hotspot[redBox].scale, get(scale));
		</action>
		<action name="hideRedBox">
			hotspot[redBox].stop();
			set(hotspot[redBox].visible, get(false));
		</action>
		<action name="mobilescale" autorun="preinit" devices="mobile">
		    mul(stagescale,0.5);
		</action>
		<action name="playSceneName">
			def(scale, string, get(hotspot[video].scale));
		    <!-- 打印日志 -->
		    <!-- showlog(true, top); -->
		    <!-- mobilescale(); -->
		    <!-- 播放视频 -->
			set(hotspot[video].visible, 'true');
			set(hotspot[image_hotspot].visible, 'true');
		    hotspot[video].playvideo(%1, '', false);
			set(hotspot[video].scale, get(scale));
		</action>
		<action name="stopPeopleVideo">
			<!-- 播放视频 -->
			<!-- hotspot[video].playvideo('', '', false); -->
			hotspot[video].stop();
			set(hotspot[video].visible, get(false));
			set(hotspot[image_hotspot].visible, get(false));
		</action>
		<action name="playPetVideo">
			def(scale, string, get(hotspot[petVideo].scale));
			<!-- 播放视频 -->
			set(hotspot[petVideo].visible, 'true');
			hotspot[petVideo].playvideo(%1, '', false);
			set(hotspot[petVideo].scale, get(scale));
		</action>
		<!-- 隐藏数字宠物 -->
		<action name="stopPetVideo">
			<!-- 停止视频 -->
			<!-- hotspot[petVideo].playvideo('', '', false); -->
			hotspot[petVideo].stop();
			set(hotspot[petVideo].visible, get(false));
		</action>
		
		<!-- 设置缩放大小 -->
		<action name="scalePeopleChange">
			set(hotspot[video].scale, %1);
		</action>
		<!-- 设置缩放大小 -->
		<action name="scalePetChange">
			set(hotspot[petVideo].scale, %1);
		</action>
		<!-- 切换状态播放，暂停 -->
		<action name="toggleMute">
			set(hotspot[video].muted, %1);
			set(hotspot[petVideo].muted, %1);
			<!-- set(plugin[soundinterface].mute, %1); -->
			mutesound(bgsnd,%1);
		</action>
		<!-- 视频初始化完成 -->
		<action name="videoreadyFunc">
		    jscall('window.videoready()');
			<!-- set(hotspot[video].scale, 0.3); -->
		</action>
		<!-- 视频播放 -->
		<action name="videoplayHandle">
		    jscall('window.onvideoplay()');
			<!-- set(hotspot[video].scale, 0.3); -->
		</action>
		<action name="playBgMusic">
		    <!-- 播放背景音乐 -->
		    playsound(bgsnd, %1, true);
			mutesound(bgsnd,%2);
		</action>
		<!-- 关闭所有的声音 -->
		<action name="closeVoice">
		    destroysound(bgsnd);
		</action>
		<!-- 播放音乐设置，引入插件 -->
		<plugin name="soundinterface" 
		    url="https://dm.static.elab-plus.com/soundinterface.swf"
		    alturl="https://dm.static.elab-plus.com/soundinterface.js" 
		    preload="true"
		    keep="true"
		    loop="false"
			muted="true"
		    ></plugin>
		<!-- 引导图加载完成后 -->
		<!-- <action name="suspendedPlay">
		    set(hotspot[video].isVideoreadyType, true);
		</action> -->
	</scene>


</krpano>
