When I rotate the scene , the videos on current view will play, and other videos will pause, How can I write the code ?
<events name="hotspots_visibility" keep="true" onviewchanged="adapt_hortspots_visiblity();"/>
<action name="adapt_hortspots_visiblity">
for(set(i,0), i LT hotspot.count, inc(i),getlooktodistance(d, hotspot[get(i)].ath, hotspot[get(i)].atv);
if(d LT 30,showhotspot(get(i) );,fadehotspot(get(i), 0.5, 0.5););
);
</action>
<action name="showhotspot">
if(hotspot[%1].ishighlighted != true,set(hotspot[%1].isvisible, true);tween(hotspot[%1].alpha, 1, 1););
</action>
<action name="fadehotspot">
set(hotspot[%1].isvisible, false);tween(hotspot[%1].alpha, 0.1, 0.5);
</action>
<hotspot name="video1"
style="video_hotspot_style"
pausedonstart="false"
videourl.desktop="%SWFPATH%/video/video1.mp4"
videourl.mobile="%SWFPATH%/video/video1.mp4"
visible="false"
onvideoready="set(hotspot[video1].visible, true)"
onloaded="calc_pos_from_hfov_yaw_pitch_roll(20, -118.39, -7.0409, -11.8046);"
/>
<hotspot name="video3"
style="video_hotspot_style"
pausedonstart="false"
videourl.desktop="%SWFPATH%/video/video3.mp4"
videourl.mobile="%SWFPATH%/video/video3.mp4"
visible="false"
onvideoready="set(hotspot[video3].visible, true)"
onloaded="calc_pos_from_hfov_yaw_pitch_roll(23, 128.052, -5.9328, 9.9464);"
/>