|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
<!--
krpano 1.0.8
- video-hotspot example
-->
<krpano version="1.0.8" onstart="showtext('[b][i]krpano[br]video hotspot example[/i][/b]', infostyle);">
<!-- use the editor for moving,rotating,scaling hotspots -->
<plugin name="editor" url="%SWFPATH%/plugins/editor.swf" />
<plugin name="options" url="%SWFPATH%/plugins/options.swf" />
<!-- text styles for startup text and onhover text -->
<textstyle name="infostyle"
origin="center" edge="center" textalign="center" yoffset="-170" background="false" border="false"
fontsize="40" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
showtime="4.0" fadetime="1.0" fadeintime="1.0"
/>
<textstyle name="videohoverstyle"
background="false" border="false" textalign="center"
fontsize="20" textcolor="0xFFFFFF" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
fadetime="0.2" fadeintime="0.5"
/>
<!-- use only a grid preview pano to save download space ;-) -->
<preview type="grid(cube,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" details="16" />
<!-- note - the url of the video must be always relative to the main krpano swf file -->
<hotspot name="videospot"
url="%SWFPATH%/plugins/videoplayer.swf"
videourl="%SWFPATH%/examples/plugin-examples/video-hotspot/cats-short.flv"
distorted="true"
ath="0"
atv="0"
edge="center"
scale="1.0"
rx="0"
ry="0"
rz="0"
loop="true"
pausedonstart="true"
directionalsound="true"
range="110"
volume="0.7"
onhover="if(ispaused, showtext(click to play, videohoverstyle), showtext(click to pause, videohoverstyle));"
flying="0.0"
onclick="togglepause();
if(flying == 0.0, flyout() );
if(flying == 1.0, flyback() );"
/>
<!--
flyout/flyback actions
(for more stylish in/out moves play with different tweentypes and times)
-->
<action name="flyout">
<!--
save/backup the current rotation values!
NOTE - it is important that the backup_* variables are predefined!
this allows to save the variables at <hotspot> scope,
if the variables where not predefined, they were saved at global scope
and this would be a problem when more hotspots were used!
-->
copy(backup_rx,rx);
copy(backup_ry,ry);
copy(backup_rz,rz);
copy(backup_scale,scale);
<!-- tween the rotations values to 0 for a flat screen view -->
tween(rx, 0);
tween(ry, 0);
tween(rz, 0);
tween(scale, 1.5);
<!--
tween 'flying' to 1.0,
this makes the hotspot independent from the panorama rotation and scaling
-->
tween(flying, 1.0);
</action>
<action name="flyback">
<!-- tween back to the stored backup values -->
tween(rx, get(backup_rx));
tween(ry, get(backup_ry));
tween(rz, get(backup_rz));
tween(scale, get(backup_scale));
<!-- tween 'flying' back to 0.0 -->
tween(flying, 0.0);
</action>
</krpano>
|
This post has been edited 1 times, last edit by "jmugarra" (Aug 15th 2011, 12:58pm)
Seems to be just a correct thought...
Quoted
Just a thought... As I understand it, the problem is linking the flyin/flyout action and the togglepause action to the same control (click).
You could link one of them to a different user input.
I can't say, as I had not tried the Aldo's plugin Doubleclick Plugin , but it seems that you are correct in saying it apply to the viewer only (the pano itself).
Quoted
Aldo Hoeben developed a plugin that adds double click events. I haven't tried it yet, but I'm sure it'll work perfectly, and it could solve your problem.
Cheers
OK, I edit:
After a breifly testing the doubleclick plugin, it seems to work only in the whole viewer, not being able to set that event for a hotspot. Sorry...
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
<krpano version="1.0.8" onstart="showtext('[b][i]krpano[br]video hotspot example[/i][/b]', infostyle);">
<!-- use the editor for moving,rotating,scaling hotspots -->
<plugin name="editor" url="%SWFPATH%/plugins/editor.swf" />
<plugin name="options" url="%SWFPATH%/plugins/options.swf" />
<!-- text styles for startup text and onhover text -->
<textstyle name="infostyle"
origin="center" edge="center" textalign="center" yoffset="-170" background="false" border="false"
fontsize="40" textcolor="0xFFFFFF" bold="false" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
showtime="4.0" fadetime="1.0" fadeintime="1.0"
/>
<textstyle name="videohoverstyle"
background="false" border="false" textalign="center"
fontsize="20" textcolor="0xFFFFFF" effect="glow(0xFFFFFF,0.7,4,2);glow(0x000000,1,4,2);dropshadow(3,45,0x000000,2,0.6);"
fadetime="0.2" fadeintime="0.5"
/>
<!-- use only a grid preview pano to save download space ;-) -->
<preview type="grid(cube,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" details="16" />
<!-- note - the url of the video must be always relative to the main krpano swf file -->
<hotspot name="videospot"
url="%SWFPATH%/plugins/videoplayer.swf"
videourl="%SWFPATH%/examples/plugin-examples/video-hotspot/cats-short.flv"
distorted="true"
ath="0"
atv="0"
edge="center"
scale="1.0"
rx="0"
ry="0"
rz="0"
loop="true"
pausedonstart="true"
directionalsound="true"
range="110"
volume="0.7"
onhover="if(ispaused, showtext(click to play, videohoverstyle), showtext(click to pause, videohoverstyle));"
flying="0.0"
onclick="do_ondoubleclick( onclick_action() , ondoubleclick_action() )"
onclick_action="togglepause();"
ondoubleclick_action="if(flying == 0.0, flyout() ); if(flying == 1.0, flyback() );"
/>
<action name="do_ondoubleclick">
if(clicks === null, set(clicks,0) );
inc(clicks);
if(clicks == 1 , delayedcall(0.2, is_ondoubleclick(%1,%2) ) );
</action>
<action name="is_ondoubleclick">
if(clicks GE 2,
%2
,
%1
);
set(clicks,0);
</action>
<!--
flyout/flyback actions
(for more stylish in/out moves play with different tweentypes and times)
-->
<action name="flyout">
<!--
save/backup the current rotation values!
NOTE - it is important that the backup_* variables are predefined!
this allows to save the variables at <hotspot> scope,
if the variables where not predefined, they were saved at global scope
and this would be a problem when more hotspots were used!
-->
copy(backup_rx,rx);
copy(backup_ry,ry);
copy(backup_rz,rz);
copy(backup_scale,scale);
<!-- tween the rotations values to 0 for a flat screen view -->
tween(rx, 0);
tween(ry, 0);
tween(rz, 0);
tween(scale, 1.5);
<!--
tween 'flying' to 1.0,
this makes the hotspot independent from the panorama rotation and scaling
-->
tween(flying, 1.0);
</action>
<action name="flyback">
<!-- tween back to the stored backup values -->
tween(rx, get(backup_rx));
tween(ry, get(backup_ry));
tween(rz, get(backup_rz));
tween(scale, get(backup_scale));
<!-- tween 'flying' back to 0.0 -->
tween(flying, 0.0);
</action>
</krpano>
|