123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- <krpano version="1.20.9" title="Virtual Tour">
- <!-- <plugin name="pp_light" keep="true"
- url="https://dm.static.elab-plus.com/miniProgram/krpano/plugins/pp_light.js"
- enabled="true"
- exposure="0.0"
- lights="1.0"
- shadows="5.0"
- filterrange="60.0"
- masking="1.0"
- quality="7"
- order="1"
- phase="1"
- />
-
- <plugin name="pp_sharpen" keep="true"
- url="https://dm.static.elab-plus.com/miniProgram/krpano/plugins/pp_sharpen.js"
- enabled="true"
- strength="5.0"
- range="5"
- quality="5"
- luminanceonly="true"
- order="2"
- phase="1"
- /> -->
- <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>
- <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="4.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)">
- <sphere url="%$panorama_url%" />
- </image>
- <image if="webvr.isenabled OR device.mobilevr">
- <sphere url="%$panorama_url%" />
- </image>
- <!-- <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" cursor="grab"
- onclick="togglepause();" enabled="false"
- ondown.addevent="set(cursor,grabbing);" onup.addevent="set(cursor,grab);" >
- </hotspot>
- <hotspot name="image_hotspot" ath="50.082" atv="14" rotate="-45.0" zorder="1"
- distorted="true" scale="0.5" alpha="0.5"
- url="https://dm.static.elab-plus.com/miniProgram/grass.jpg" keep="true"></hotspot>
- <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); -->
- <!-- 播放视频 -->
- hotspot[video].playvideo(%1, '', false);
- set(hotspot[video].scale, get(scale));
- </action>
- <!-- 设置缩放大小 -->
- <action name="scaleChange">
- set(hotspot[video].scale, %1);
- </action>
- <!-- 获取缩放大小 -->
- <action name="getmyScale">
- def(scale, string, get(hotspot[video].scale));
- jscall(calc("window.getScaleHandle('"+ get(scale) +"')") );
- </action>
- <!-- 切换状态播放,暂停 -->
- <action name="toggleMute">
- set(hotspot[video].muted, %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="makescreenshot_init" type="Javascript" autorun="onstart"><![CDATA[
- // count the screenshots (for the filenames)
- krpano.makescreenshot_count = 1;
- // create an empty Object as makeScreenshot cache
- var makeScreenshotCache = {};
- // add a 'makescreenshot' action to krpano
- krpano.makescreenshot = function(leftX,leftY,screenshotwidth,screenshotheight)
- {
- // if there is already a screenshot layer, remove it now
- console.warn("***makescreenshot***",krpano.webGL,leftX,leftY,screenshotwidth,screenshotheight)
- var canvas = krpano.webGL.canvas;
- var pix = window.devicePixelRatio;
- // make a screenshot as canvas
- var sizeinfo = {w:screenshotwidth*pix, h:screenshotheight*pix};
- var crop = {
- x:leftX*pix,
- y:leftY*pix,
- w:screenshotwidth*pix,
- h:screenshotheight*pix
- };
- var screenshotcanvas = krpano.webGL.makeScreenshot(
- canvas.width,
- canvas.height,
- true,
- "png",
- 1.0,
- crop,
- sizeinfo,
- makeScreenshotCache);
-
- if (screenshotcanvas)
- {
- // var imgBase64 = screenshotcanvas.toDataURL();
- var imgBase64 = screenshotcanvas;
- screenshot(imgBase64);
-
- function screenshot(imgBase64){
- var savecreenshot = window.$config.api_url + 'elab-marketing-file/upload/uploadBase64';
- var data = JSON.stringify({
- base64Str: imgBase64
- })
- var request = $.ajax({
- type: "POST",
- url: savecreenshot,
- contentType: 'application/json;charset=UTF-8',
- data: data
- });
-
- request.done(function(result) {
- console.warn("***krpano-request-result****",result)
- if (result && result.success) {
- let shottingImg = result.single.filePath;
- window.show_img(shottingImg);
- }
- });
-
- request.fail(function(jqXHR, textStatus) {
- console.warn("Request failed: " + textStatus);
- });
- }
- }
- }
- ]]>
- </action>
-
- </scene>
- </krpano>
|