panoramic.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <krpano name="globalObject">
  2. <plugin name="video"
  3. url.html5="https://dm.static.elab-plus.com/videoplayer.js"
  4. videourl=""
  5. muted="true"
  6. preload="true"
  7. pausedonstart="false"
  8. onvideoready="videoreadyFunc"
  9. onvideopaused="videopausedFunc"
  10. url.flash="https://dm.static.elab-plus.com/videoplayer.swf"
  11. loop="true"
  12. isPlayBg="false"
  13. voicesList=""
  14. playName = ""
  15. isPay = "false"
  16. isVideoreadyType="false"
  17. isTip = "false"
  18. />
  19. <image>
  20. <sphere url="plugin:video" />
  21. </image>
  22. <!-- 热点地址 -->
  23. <hotspot
  24. name="hotspot-yard"
  25. type="image"
  26. edge="lefttop"
  27. url="https://dm.static.elab-plus.com/hqc-img/forward.png"
  28. alturl="https://dm.static.elab-plus.com/hqc-img/forward.png"
  29. distorted="true"
  30. ath="0"
  31. atv="0"
  32. width="74"
  33. height="91"
  34. visible="false"
  35. onclick="switchScenesType"
  36. />
  37. <settings width="100" height="50" />
  38. <view hlookat="0" vlookat="0" fov="120" fovmin="90.0" fovmax="130.0" fovtype="DFOV"/>
  39. <action name="switchScenesType">
  40. jscall('window.switchScenesType()');
  41. </action>
  42. <action name="mobilescale" autorun="preinit" devices="mobile">
  43. mul(stagescale,0.5);
  44. </action>
  45. <action name="playSceneName">
  46. <!-- 打印日志 -->
  47. <!-- showlog(true, top); -->
  48. mobilescale();
  49. <!-- 播放视频 -->
  50. plugin[video].playvideo(%1, %2, false);
  51. def(b, string, get(plugin[video].isPlayBg));
  52. if(b == false, playBgMusic(%3));
  53. if(b == suspend, delayedcall(0.5 , playBgMusic(%3, true)););
  54. <!-- 是否显示热点 -->
  55. if(
  56. %4 == true,
  57. set(hotspot[hotspot-yard].visible, true);
  58. ,
  59. set(hotspot[hotspot-yard].visible, false);
  60. )
  61. </action>
  62. <action name="playBgMusic">
  63. <!-- 播放背景音乐 -->
  64. ifnot(%2 == true, playsound(bgsnd, %1, 0););
  65. if(%2 == true, pausesoundtoggle(bgsnd););
  66. set(plugin[video].isPlayBg, true);
  67. </action>
  68. <!-- 播放音乐设置,引入插件 -->
  69. <plugin name="soundinterface"
  70. url="https://dm.static.elab-plus.com/soundinterface.swf"
  71. alturl="https://dm.static.elab-plus.com/soundinterface.js"
  72. preload="true"
  73. keep="true"
  74. loop="false"
  75. ></plugin>
  76. <!-- 音乐播放完 -->
  77. <action name="musicPlayComplete">
  78. <!-- 删掉保存的状态 -->
  79. <!-- 播放的数组 -->
  80. def(voicesList, string, get(plugin[video].voicesList));
  81. <!-- 刚播放完的名称 -->
  82. def(voicesName, string, get(plugin[video].playName));
  83. txtreplace(voicesList, get(voicesName), '');
  84. set(plugin[video].playName, '');
  85. set(plugin[video].isPay, false);
  86. set(plugin[video].voicesList, voicesList);
  87. jscall('window.musicPlayComplete()');
  88. </action>
  89. <!-- 播放声音 -->
  90. <action name="playsoundMusic">
  91. def(voicesList, string, get(plugin[video].voicesList));
  92. def(voicesName, string, %1);
  93. def(voicesUrl, string, %2);
  94. def(isStartPay, string, %3);
  95. <!-- 当前播放的名称 -->
  96. set(plugin[video].playName, get(voicesName));
  97. <!-- 当之前没有播放过,则播放声音 -1就是没有播放过-->
  98. indexoftxt(index, get(voicesList), get(voicesName));
  99. <!-- isStartPay true 播放音乐 false 暂停音乐 index == -1 播放音乐 其他的则切换音乐状态 -->
  100. if(
  101. isStartPay == true,
  102. startPayMusic(get(voicesName), get(voicesUrl), get(voicesList));
  103. ,
  104. if(
  105. isStartPay == false,
  106. pausesoundMusic(get(voicesName));
  107. ,
  108. if(
  109. index == -1,
  110. startPayMusic(get(voicesName), get(voicesUrl), get(voicesList));
  111. ,
  112. toggleMusic(get(voicesName));
  113. )
  114. )
  115. );
  116. </action>
  117. <!-- 重新开始播放 -->
  118. <action name="startPayMusic" args="voicesName, voicesUrl, voicesList">
  119. <!-- 将播放的字符 添加到总字符中 -->
  120. txtadd(voicesConcat, get(voicesList), get(voicesName));
  121. <!-- 设置播放的字符集合 -->
  122. set(plugin[video].voicesList, get(voicesConcat));
  123. <!-- 是否在播放 -->
  124. set(plugin[video].isPay, true);
  125. <!-- 播放声音 -->
  126. def(b, string, get(plugin[video].isPlayBg));
  127. if(
  128. b == suspend,
  129. delayedcall(0.5,playsound(get(voicesName), get(voicesUrl), 1, musicPlayComplete););
  130. ,
  131. playsound(get(voicesName), get(voicesUrl), 1, musicPlayComplete);
  132. );
  133. </action>
  134. <!-- 切换状态播放,暂停 -->
  135. <action name="toggleMusic" args="voicesName">
  136. def(isPay, string, get(plugin[video].isPay));
  137. if(
  138. isPay == false,
  139. set(plugin[video].isPay, true);
  140. resumesoundMusic(get(voicesName))
  141. ,
  142. set(plugin[video].isPay, false);
  143. pausesoundMusic(get(voicesName));
  144. );
  145. </action>
  146. <!-- 暂停声音 -->
  147. <action name="pausesoundMusic">
  148. pausesound(%1);
  149. </action>
  150. <!-- 恢复声音 -->
  151. <action name="resumesoundMusic">
  152. resumesound(%1);
  153. </action>
  154. <!-- 关闭所有的声音 -->
  155. <action name="closeVoice">
  156. pausesoundtoggle(bgsnd);
  157. </action>
  158. <!-- 视频初始化完成 -->
  159. <action name="videoreadyFunc">
  160. jscall('window.videoready()');
  161. </action>
  162. <!-- 引导图加载完成后 -->
  163. <action name="suspendedPlay">
  164. set(plugin[video].isVideoreadyType, true);
  165. </action>
  166. <!-- 视频暂停 -->
  167. <!-- 解决ios手机 切换页面返回不自动播放的原因 devices="ios"-->
  168. <action name="videopausedFunc" devices="ios">
  169. def(isTip, string, get(plugin[video].isTip));
  170. trace(plugin[video].isTip);
  171. pausesound(bgsnd);
  172. set(plugin[video].isPay, false);
  173. def(voicesName, string, get(plugin[video].playName));
  174. ifnot(voicesName == '' ,pausesoundMusic(get(voicesName)););
  175. if(isTip == true,
  176. set(plugin[video].isTip, false);
  177. ,
  178. jscall('window.videopausedFunc()');
  179. );
  180. </action>
  181. <!-- 滚动到中心位置 -->
  182. <events onclick="clickFunc"></events>
  183. <action name="clickFunc">
  184. <!-- screentosphere(mouse.x, mouse.y, h, v);
  185. trace(h,',',v); -->
  186. def(isVideoreadyType, string, get(plugin[video].isVideoreadyType));
  187. if(isVideoreadyType == true,
  188. <!-- 获取当前播放的声音名称 -->
  189. def(voicesName, string, get(plugin[video].playName));
  190. <!-- 切换播放的状态 -->
  191. <!-- plugin[video].togglepause(); -->
  192. def(isPlayBg, string, get(plugin[video].isPlayBg));
  193. if(isPlayBg == true,
  194. <!-- 暂停声音 -->
  195. <!-- 暂停视频 -->
  196. plugin[video].pause();
  197. <!-- 是因为点击导致视频暂停 -->
  198. set(plugin[video].isTip, true);
  199. pausesound(bgsnd);
  200. set(plugin[video].isPlayBg, false);
  201. jscall(calc("window.switchPlayImg('"+ false +"')") );
  202. <!-- 当有播放声音的名称,则切换播放的状态 -->
  203. ifnot(voicesName == '' ,
  204. <!-- 暂停声音 -->
  205. set(plugin[video].isPay, false);
  206. pausesoundMusic(get(voicesName));
  207. jscall(calc("window.payVoiceStatus('"+ false +"')") ););
  208. ,
  209. <!-- 播放声音 -->
  210. <!-- 播放视频 -->
  211. plugin[video].play();
  212. resumesound(bgsnd);
  213. set(plugin[video].isPlayBg, true);
  214. jscall(calc("window.switchPlayImg('"+ true +"')") );
  215. <!-- 当有播放声音的名称,则切换播放的状态 -->
  216. ifnot(voicesName == '' ,
  217. <!-- 播放声音 -->
  218. set(plugin[video].isPay, true);
  219. resumesoundMusic(get(voicesName));
  220. jscall(calc("window.payVoiceStatus('"+ true +"')") ););
  221. );
  222. );
  223. </action>
  224. </krpano>