|
|
Quellcode |
1 |
fadeintime="0" fadetime="0" |
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com
What happens is that when you reached the end of the video and click somewhere half way and then use the pause or play button, it starts over again. every time...
so the resume function makes it's start from beginning everytime after reaching the end for the first time.
Here is a link:
http://virtualtuur.com/krpano/videoplayer
http://virtualtuur.com/krpano/videoplayer/code/video.xml
Anybody?
Tuur![]()
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
Zitat
why you did not use the button "crop" function?
If you intend to be i(diot)OS compatible toggle "alpha" and "zorder", not "visible"!
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com|
|
Quellcode |
1 2 3 |
<action name="video2"> playvideo(sequence01.f4v); </action> |
Hi can you please guide me on applying the progressbar on a 360 player.Hi all,
After a lot of scratching the head (I was using the changeorigin(align,edge) before I realized it was not a good way to do), I have finally reached (it seems
) a working code to create a progress time bar for the videoplayer plugin...
To make it working, you have to include the videoplayer_timebar.xml file and call the do_time_bar() for example from the onvideoready event of the videoplayer plugin:
![]()
Quellcode
1 2 3 4 5 6 7 8 9 10 11 <krpano version="1.0.8" onstart=""> <include url="videoplayer_timebar.xml" /> <plugin name="video" ... onvideoready="do_time_bar(video,video);" ... /> </krpano>
There is some explanation inside the videoplayer_timebar.xml file.
Here some examples online: ex_1 - ex_2 - ex_3
Hope you like it... Comments, examples use, improvements are well come...
@ BBomber
here a code for video 360:
![]()
Quellcode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 <krpano version="1.0.8"> <include url="videoplayer_timebar.xml" /> <!-- load and control the video with the videoplayer plugin --> <plugin name="video" url="%SWFPATH%/plugins/videoplayer.swf" videourl="video360.flv" onvideoready="do_time_bar(video,null,bottom,null,70%,6,0,20,false,10);" /> <!-- define the pano image and get the pano video from the videoplayer plugin --> <image> <sphere url="plugin:video" /> </image> </krpano>
SAlut.
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
|
|
Quellcode |
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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
<action name="do_time_bar">
<!-- do_time_bar( video plugin name , parent , align , edge , width , height , x , y , keep , zorder );
-
- a good place to call the action is inside the onvideoready event of the videoplayer plugin...
-
- example: onvideoready="do_time_bar( video_plugin_name , video_plugin_name );"
- this example should be enough for an time bar as child of an videoplayer plugin at its bottom...
- the missing parameters will be set by the action with default values....
-
- example: onvideoready="do_time_bar(video,null,bottom,null,70%,6,0,20,false,10);"
- this example should create an time bar inside the AREA, aligned at the bottom, without edge,
- with a width of 70% of the area width, an height of 6, x at 0, y at 20, keep as false and
- an zorder of 10....
- it could be used as a detached time bar for a videoplayer plugin,
- or for an 360 videoplayer usage....
-
- example: onvideoready="do_time_bar(video,stage,bottom,null,70%,6,0,20,false,10);"
- same as above but on STAGE instead of AREA...
-
- to remove the timebar I have added an erase_time_bar() action...
-
- I just realize that I missed the case of a video player as hotspot :(...
- I will implement this in a future release ;)...
-->
addplugin(time_bar);
set(plugin[time_bar].url, %SWFPATH%/../skin/white.jpg );
set(plugin[time_bar].plugin_video_is, %1 );
ifnot(%2 == null , set(plugin[time_bar].parent, %2 ); );
if(%3 == null , set(plugin[time_bar].align, bottom ); , set(plugin[time_bar].align, %3 ); );
if(%4 == null , copy(plugin[time_bar].edge, plugin[time_bar].align ); , set(plugin[time_bar].edge, %4 ); );
if(%5 == null , copy(plugin[time_bar].width, plugin[%1].width ); , set(plugin[time_bar].width, %5 ); );
if(%6 == null , set(plugin[time_bar].height, 5 ); , set(plugin[time_bar].height, %6 ); );
if(%7 == null , set(plugin[time_bar].x, 0 ); , set(plugin[time_bar].x, %7 ); );
if(%8 == null , set(plugin[time_bar].y, -12 ); , set(plugin[time_bar].y, %8 ); );
if(%9 == null , set(plugin[time_bar].keep, false ); , set(plugin[time_bar].keep, %9 ); );
if(%10 == null , add(z_order,get(plugin[%1].zorder),1); copy(plugin[time_bar].zorder, z_order ); , set(plugin[time_bar].zorder, %10 ); );
set(plugin[time_bar].alpha, 1 );
set(plugin[time_bar].onhover, get_time(); );
set(plugin[time_bar].ondown, getseek(); );
set(plugin[time_bar].accuracy,1);
addplugin(loadedbytes_);
set(plugin[loadedbytes_].url, %SWFPATH%/../plugins/textfield.swf );
set(plugin[loadedbytes_].parent, time_bar );
set(plugin[loadedbytes_].capture, false );
set(plugin[loadedbytes_].children, false );
set(plugin[loadedbytes_].selectable, false );
set(plugin[loadedbytes_].alpha, 0.5 );
set(plugin[loadedbytes_].align, leftbottom );
copy(plugin[loadedbytes_].height, plugin[time_bar].height );
add(z_order,get(plugin[time_bar].zorder),1);
copy(plugin[loadedbytes_].zorder, z_order );
set(plugin[loadedbytes_].background, true );
set(plugin[loadedbytes_].backgroundcolor, 0x66FFFF );
addplugin(time_);
set(plugin[time_].url, %SWFPATH%/../plugins/textfield.swf );
set(plugin[time_].parent, time_bar );
set(plugin[time_].capture, false );
set(plugin[time_].children, false );
set(plugin[time_].selectable, false );
set(plugin[time_].align, leftbottom );
copy(plugin[time_].height, plugin[time_bar].height );
add(z_order,get(plugin[time_bar].zorder),2);
copy(plugin[time_].zorder, z_order );
set(plugin[time_].background, true );
set(plugin[time_].backgroundcolor, 0x336699 );
addplugin(time_seek);
set(plugin[time_seek].url, %SWFPATH%/../skin/gris.jpg );
set(plugin[time_seek].parent, time_bar );
set(plugin[time_seek].align, left );
set(plugin[time_seek].width, 10 );
add(temp,get(plugin[time_bar].height),2);
copy(plugin[time_seek].height, temp );
add(z_order,get(plugin[time_bar].zorder),3);
copy(plugin[time_seek].zorder, z_order );
set(plugin[time_seek].onhover, showtext([textformat leftmargin='4' rightmargin='4']Seek[/textformat]); );
set(plugin[time_seek].ondown, set(onhover,); startdragingslider(); );
set(plugin[time_seek].onup, set(onhover,showtext([textformat leftmargin='4' rightmargin='4']Seek[/textformat])); stopdragingslider(); getseek(); );
set(plugin[time_bar].onloaded, refresh_time_bar(%1));
</action>
<action name="refresh_time_bar">
if(plugin[time_bar].loaded,
div(temp,plugin[time_bar].pixelwidth,plugin[%1].totaltime);
mul(temp,temp,plugin[%1].time);
if(temp GE plugin[time_bar].pixelwidth,copy(temp,plugin[time_bar].pixelwidth));
if(temp LT 1,set(temp,1));
set(plugin[time_].width,get(temp));
sub(temp1,plugin[time_bar].pixelwidth,plugin[time_seek].pixelwidth);
if(temp GE temp1,set(temp,get(temp1)));
ifnot(seek_dragging,set(plugin[time_seek].x,get(temp)));
div(temp,plugin[time_bar].pixelwidth,plugin[%1].totalbytes);
mul(temp,temp,plugin[%1].loadedbytes);
if(temp GE plugin[time_bar].pixelwidth,copy(temp,plugin[time_bar].pixelwidth));
if(temp LT 1,set(temp,1));
set(plugin[loadedbytes_].width,get(temp));;
delayedcall(0.1,refresh_time_bar(%1));
);
</action>
<action name="get_mouse_offset">
set(inside_area,true);
set(parents_X,0);
check_for_parents(%1);
<!-- mouse_x_offset -->
if(inside_area,
get_parents_X(get(parents_return),area.pixelwidth);
sub(mouse_x_offset, mouse.x, parents_X);
,
get_parents_X(get(parents_return),stagewidth);
sub(mouse_x_offset, mouse.stagex, parents_X);
);
div(temp,plugin[%2].totaltime,plugin[time_bar].pixelwidth);
mul(temp,temp,mouse_x_offset);
roundval(temp,1);
if(temp LT 1,set(temp,0));
</action>
<action name="check_for_parents">
set(parents_return,%1);
if(plugin[%1].edge === null, copy(plugin[%1].edge, plugin[%1].align););
ifnot(plugin[%1].parent === null ,
if(plugin[%1].parent == stage, set(inside_area,false););
if(plugin[%1].parent == bglayer, set(inside_area,false));
if(plugin[%1].parent == '',set(plugin[%1].parent,null));
ifnot(plugin[%1].parent == null,
ifnot(plugin[%1].parent == stage,
ifnot(plugin[%1].parent == bglayer,
<!-- the plugin[time_bar] has a parent -->
copy(parent_is,plugin[%1].parent);
get_parents_X(%1,get(plugin[%parent_is].pixelwidth),get(plugin[%1].parent));
);
);
);
);
</action>
<action name="get_parents_X">
if(plugin[%1].align === null , offset_case0(%1,%2) );
if(plugin[%1].align == lefttop , offset_case1(%1,%2) );
if(plugin[%1].align == left , offset_case1(%1,%2) );
if(plugin[%1].align == leftbottom , offset_case1(%1,%2) );
if(plugin[%1].align == top , offset_case2(%1,%2) );
if(plugin[%1].align == center , offset_case2(%1,%2) );
if(plugin[%1].align == bottom , offset_case2(%1,%2) );
if(plugin[%1].align == righttop , offset_case3(%1,%2) );
if(plugin[%1].align == right , offset_case3(%1,%2) );
if(plugin[%1].align == rightbottom , offset_case3(%1,%2) );
if(%3 != null , check_for_parents(%3) );
</action>
<action name="offset_case0">
//trace('*** nothing to do as there is no alignement in this case and x is not taken in account !!!');
</action>
<action name="offset_case1">
copy(align_offset,plugin[%1].x);
edge_correction(%1);
</action>
<action name="offset_case2">
div(half_pixelwidth, %2, 2);
add(align_offset, half_pixelwidth, plugin[%1].x);
edge_correction(%1);
</action>
<action name="offset_case3">
sub(align_offset, %2, plugin[%1].x);
edge_correction(%1);
</action>
<action name="edge_correction">
if(plugin[%1].edge == righttop , sub(align_offset, plugin[%1].pixelwidth); );
if(plugin[%1].edge == right , sub(align_offset, plugin[%1].pixelwidth); );
if(plugin[%1].edge == rightbottom , sub(align_offset, plugin[%1].pixelwidth); );
if(plugin[%1].edge == top , div(half_plugin_pixelwidth, plugin[%1].pixelwidth, 2); sub(align_offset, half_plugin_pixelwidth); );
if(plugin[%1].edge == center , div(half_plugin_pixelwidth, plugin[%1].pixelwidth, 2); sub(align_offset, half_plugin_pixelwidth); );
if(plugin[%1].edge == bottom , div(half_plugin_pixelwidth, plugin[%1].pixelwidth, 2); sub(align_offset, half_plugin_pixelwidth); );
add(parents_X,align_offset);
</action>
<action name="getseek">
get_mouse_offset( time_bar , get(plugin[time_bar].plugin_video_is ));
txtadd(call_cmd,'plugin[',get(plugin[time_bar].plugin_video_is),'].seek(get(temp))');
call_cmd();
</action>
<action name="get_time">
get_mouse_offset( time_bar , get(plugin[time_bar].plugin_video_is ));
copy(temps,temp);
roundval(temps);
if(temps GE 60,
div(min,temps,60); copy(temp_min,min); roundval(min);
if(min GT temp_min, sub(min,1););
mod(cur_hlookat,temps,60);
if(min LT 10,
txtadd(minuts,0,get(min));
,
copy(minuts,min);
);
,
set(minuts,'00');
);
mul(temp,minuts,60);
sub(seconds,temps,temp);
if(seconds LT 10, txtadd(seconds,0,get(seconds)));
txtadd(temps,get(minuts),:,get(seconds));
txtadd(temps,[textformat leftmargin='4' rightmargin='4'],get(minuts),:,get(seconds),[/textformat]);
txtadd(call_cmd,"showtext( ",get(temps)," )");
call_cmd();
</action>
<action name="startdragingslider">
get_mouse_offset( time_bar , get(plugin[time_bar].plugin_video_is ));
set(seek_dragging,true);
dragslider(time_bar);
</action>
<action name="stopdragingslider">
set(seek_dragging, false);
</action>
<action name="dragslider">
if(seek_dragging,
div(temp,plugin[time_seek].pixelwidth,2);
sub(xpos, mouse_x_offset, temp);
sub(xmax, plugin[%1].pixelwidth, plugin[time_seek].pixelwidth);
if(xpos LT 0, set(xpos,0));
if(xpos GT xmax, copy(xpos,xmax));
copy(plugin[time_seek].x, xpos);
delayedcall(0.01, dragslider(%1) );
);
</action>
<action name="erase_time_bar">
removeplugin(time_bar);
removeplugin(loadedbytes_);
removeplugin(time_);
removeplugin(time_seek);
</action>
<!-- VOLUME SLIDER -->
<!-- Change only paramaters of this style to change position and size of sound buttons -->
<!-- DO NOT use relative(%) size and/or position --> <!-- align="right" NOT ACCEPTED -->
<style name="button" url="../skin/boutons_son.png" zorder="1" alpha="0.5" align="left" x="100" y="10" width="25" height="prop" />
<action name="playsound1">
set(VM,1);
</action>
<action name="setbuttonandslider">
set(plugin[slider_bg].align,get(style[button].align));
set(plugin[slider_bg].zorder,get(style[button].zorder));
add(Bx,get(style[button].x),get(style[button].width)); add(Sx,Bx,5); set(plugin[slider_bg].x,get(Sx)); set(plugin[slider_bg].y,get(style[button].y)); mul(Sw,get(style[button].width),5); set(plugin[slider_bg].width,get(Sw)); set(plugin[slider_bg].height,get(style[button].height));
mul(Gx,get(plugin[slider_bg].width),0.89); set(plugin[slider_grip].x,get(Gx));
</action>
<plugin name="slider_bg" url="../skin/volume_bar.png" parent="video_background" zorder="90" alpha="0.5" keep="true" align="bottom" edge="" width="150" height="5" x="-110" y="12" visible="true" handcursor="false" alpha="1" onhover="" onover="" onout="" />
<plugin name="slider_grip" url="../skin/grip.png" zorder="10" keep="true" align="lefttop" scale="2" edge="lefttop" parent="slider_bg" width="3%" height="110%" x="95%" y="-3" ondown="startdragingslider2();" onup="stopdragingslider2();" />
<textstyle name="invisiblestyle" font="Arial" fontsize="1" border="false" background="false" textcolor="0x000000" effect="" />
<action name="startdragingslider2">
set(plugin[slider_grip].onhover,showtext(-,invisiblestyle));
set(plugin[slider_grip].backup_align, get(plugin[slider_grip].align));
set(plugin[slider_grip].backup_edge, get(plugin[slider_grip].edge));
plugin[slider_grip].changeorigin(lefttop,lefttop);
sub(mouse_x_offset, plugin[slider_grip].x, mouse.x);
sub(mouse_y_offset, plugin[slider_grip].y, mouse.y);
set(image_dragging,true);
dragslider2();
</action>
<action name="stopdragingslider2">
set(image_dragging, false); set(plugin[slider_grip].onhover,);
</action>
<action name="dragslider2">
if(image_dragging,
add(xpos, mouse.x, mouse_x_offset);
mul(xmax, plugin[slider_bg].width,0.95);
if(xpos LT 0, set(xpos,0));
if(xpos GT xmax, copy(xpos,xmax));
copy(plugin[slider_grip].x, xpos);
div(VM, xpos, xmax);
setvolume(get(VM));
delayedcall(0.01, dragslider2() );
,
plugin[slider_grip].changeorigin(get(plugin[slider_grip].backup_align), get(plugin[slider_grip].backup_edge));
);
</action>
<action name="setvolume">
set(plugin[video1].volume,%1)
</action>
|
: https://pame.virtualtuur.com
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Beruf: krpano freelancer || creating ideas & coding them || krpano developer
(i am really need it) Benutzerinformationen überspringen
Beruf: krpano freelancer || creating ideas & coding them || krpano developer
|
|
Quellcode |
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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
<action name="do_time_bar">
<!-- do_time_bar( video plugin name , parent , align , edge , width , height , x , y , keep , zorder );
-
- a good place to call the action is inside the onvideoready event of the videoplayer plugin...
-
- example: onvideoready="do_time_bar( video_plugin_name , video_plugin_name );"
- this example should be enough for an time bar as child of an videoplayer plugin at its bottom...
- the missing parameters will be set by the action with default values....
-
- example: onvideoready="do_time_bar(video,null,bottom,null,70%,6,0,20,false,10);"
- this example should create an time bar inside the AREA, aligned at the bottom, without edge,
- with a width of 70% of the area width, an height of 6, x at 0, y at 20, keep as false and
- an zorder of 10....
- it could be used as a detached time bar for a videoplayer plugin,
- or for an 360 videoplayer usage....
-
- example: onvideoready="do_time_bar(video,stage,bottom,null,70%,6,0,20,false,10);"
- same as above but on STAGE instead of AREA...
-
- to remove the timebar I have added an erase_time_bar() action...
-
- I just realize that I missed the case of a video player as hotspot :(...
- I will implement this in a future release ;)...
-->
addplugin(time_bar);
set(plugin[time_bar].url, skin/video/white.jpg );
set(plugin[time_bar].plugin_video_is, %1 );
ifnot(%2 == null , set(plugin[time_bar].parent, %2 ); );
if(%3 == null , set(plugin[time_bar].align, bottom ); , set(plugin[time_bar].align, %3 ); );
if(%4 == null , copy(plugin[time_bar].edge, plugin[time_bar].align ); , set(plugin[time_bar].edge, %4 ); );
if(%5 == null , copy(plugin[time_bar].width, hotspot[%1].width ); , set(plugin[time_bar].width, %5 ); );
if(%6 == null , set(plugin[time_bar].height, 10 ); , set(plugin[time_bar].height, %6 ); );
if(%7 == null , set(plugin[time_bar].x, 0 ); , set(plugin[time_bar].x, %7 ); );
if(%8 == null , set(plugin[time_bar].y, -12 ); , set(plugin[time_bar].y, %8 ); );
if(%9 == null , set(plugin[time_bar].keep, false ); , set(plugin[time_bar].keep, %9 ); );
if(%10 == null , add(z_order,get(hotspot[%1].zorder),1); copy(plugin[time_bar].zorder, z_order ); , set(plugin[time_bar].zorder, %10 ); );
set(plugin[time_bar].alpha, 1 );
set(plugin[time_bar].onhover, get_time(); );
set(plugin[time_bar].ondown, getseek(); );
set(plugin[time_bar].accuracy,1);
addplugin(loadedbytes_);
set(plugin[loadedbytes_].url, %SWFPATH%/plugins/textfield.swf );
set(plugin[loadedbytes_].parent, time_bar );
set(plugin[loadedbytes_].capture, false );
set(plugin[loadedbytes_].children, false );
set(plugin[loadedbytes_].selectable, false );
set(plugin[loadedbytes_].alpha, 0.5 );
set(plugin[loadedbytes_].align, leftbottom );
copy(plugin[loadedbytes_].height, plugin[time_bar].height );
add(z_order,get(plugin[time_bar].zorder),1);
copy(plugin[loadedbytes_].zorder, z_order );
set(plugin[loadedbytes_].background, true );
set(plugin[loadedbytes_].backgroundcolor, 0xFFFFFF );
addplugin(time_);
set(plugin[time_].url, %SWFPATH%/plugins/textfield.swf );
set(plugin[time_].parent, time_bar );
set(plugin[time_].capture, false );
set(plugin[time_].children, false );
set(plugin[time_].selectable, false );
set(plugin[time_].align, leftbottom );
copy(plugin[time_].height, plugin[time_bar].height );
add(z_order,get(plugin[time_bar].zorder),2);
copy(plugin[time_].zorder, z_order );
set(plugin[time_].background, true );
set(plugin[time_].backgroundcolor, 0x00a1ed );
addplugin(time_seek);
set(plugin[time_seek].url, skin/video/gris.jpg );
set(plugin[time_seek].parent, time_bar );
set(plugin[time_seek].align, left );
set(plugin[time_seek].width, 10 );
add(temp,get(plugin[time_bar].height),2);
copy(plugin[time_seek].height, temp );
add(z_order,get(plugin[time_bar].zorder),3);
copy(plugin[time_seek].zorder, z_order );
set(plugin[time_seek].onhover, showtext([textformat leftmargin='4' rightmargin='4']Seek[/textformat]); );
set(plugin[time_seek].ondown, set(onhover,); startdragingslider(); );
set(plugin[time_seek].onup, set(onhover,showtext([textformat leftmargin='4' rightmargin='4']Seek[/textformat])); stopdragingslider(); getseek(); );
set(plugin[time_bar].onloaded, refresh_time_bar(%1));
</action>
<action name="refresh_time_bar">
if(plugin[time_bar].loaded,
div(temp,plugin[time_bar].pixelwidth,hotspot[%1].totaltime);
mul(temp,temp,hotspot[%1].time);
if(temp GE plugin[time_bar].pixelwidth,copy(temp,plugin[time_bar].pixelwidth));
if(temp LT 1,set(temp,1));
set(plugin[time_].width,get(temp));
sub(temp1,plugin[time_bar].pixelwidth,plugin[time_seek].pixelwidth);
if(temp GE temp1,set(temp,get(temp1)));
ifnot(seek_dragging,set(plugin[time_seek].x,get(temp)));
div(temp,plugin[time_bar].pixelwidth,hotspot[%1].totalbytes);
mul(temp,temp,hotspot[%1].loadedbytes);
if(temp GE plugin[time_bar].pixelwidth,copy(temp,plugin[time_bar].pixelwidth));
if(temp LT 1,set(temp,1));
set(plugin[loadedbytes_].width,get(temp));;
delayedcall(0.1,refresh_time_bar(%1));
);
</action>
<action name="get_mouse_offset">
set(inside_area,true);
set(parents_X,0);
//check_for_parents(%1);
set(parents_return,%1);
<!-- mouse_x_offset -->
if(inside_area,
get_parents_X(get(parents_return),area.pixelwidth);
sub(mouse_x_offset, mouse.x, parents_X);
,
get_parents_X(get(parents_return),stagewidth);
sub(mouse_x_offset, mouse.stagex, parents_X);
);
div(temp,hotspot[%2].totaltime,plugin[time_bar].pixelwidth);
mul(temp,temp,mouse_x_offset);
roundval(temp,1);
if(temp LT 1,set(temp,0));
</action>
<action name="check_for_parents">
set(parents_return,%1);
if(plugin[%1].edge === null, copy(plugin[%1].edge, plugin[%1].align););
ifnot(plugin[%1].parent === null ,
if(plugin[%1].parent == stage, set(inside_area,false););
if(plugin[%1].parent == bglayer, set(inside_area,false));
if(plugin[%1].parent == '',set(plugin[%1].parent,null));
ifnot(plugin[%1].parent == null,
ifnot(plugin[%1].parent == stage,
ifnot(plugin[%1].parent == bglayer,
<!-- the plugin[time_bar] has a parent -->
copy(parent_is,plugin[%1].parent);
get_parents_X(%1,get(plugin[%parent_is].pixelwidth),get(plugin[%1].parent));
);
);
);
);
</action>
<action name="get_parents_X">
if(plugin[%1].align === null , offset_case0(%1,%2) );
if(plugin[%1].align == lefttop , offset_case1(%1,%2) );
if(plugin[%1].align == left , offset_case1(%1,%2) );
if(plugin[%1].align == leftbottom , offset_case1(%1,%2) );
if(plugin[%1].align == top , offset_case2(%1,%2) );
if(plugin[%1].align == center , offset_case2(%1,%2) );
if(plugin[%1].align == bottom , offset_case2(%1,%2) );
if(plugin[%1].align == righttop , offset_case3(%1,%2) );
if(plugin[%1].align == right , offset_case3(%1,%2) );
if(plugin[%1].align == rightbottom , offset_case3(%1,%2) );
if(%3 != null , check_for_parents(%3) );
</action>
<action name="offset_case0">
//trace('*** nothing to do as there is no alignement in this case and x is not taken in account !!!');
</action>
<action name="offset_case1">
copy(align_offset,plugin[%1].x);
edge_correction(%1);
</action>
<action name="offset_case2">
div(half_pixelwidth, %2, 2);
add(align_offset, half_pixelwidth, plugin[%1].x);
edge_correction(%1);
</action>
<action name="offset_case3">
sub(align_offset, %2, plugin[%1].x);
edge_correction(%1);
</action>
<action name="edge_correction">
if(plugin[%1].edge == righttop , sub(align_offset, plugin[%1].pixelwidth); );
if(plugin[%1].edge == right , sub(align_offset, plugin[%1].pixelwidth); );
if(plugin[%1].edge == rightbottom , sub(align_offset, plugin[%1].pixelwidth); );
if(plugin[%1].edge == top , div(half_plugin_pixelwidth, plugin[%1].pixelwidth, 2); sub(align_offset, half_plugin_pixelwidth); );
if(plugin[%1].edge == center , div(half_plugin_pixelwidth, plugin[%1].pixelwidth, 2); sub(align_offset, half_plugin_pixelwidth); );
if(plugin[%1].edge == bottom , div(half_plugin_pixelwidth, plugin[%1].pixelwidth, 2); sub(align_offset, half_plugin_pixelwidth); );
add(parents_X,align_offset);
</action>
<action name="getseek">
get_mouse_offset( time_bar , get(plugin[time_bar].plugin_video_is ));
txtadd(call_cmd,'hotspot[',get(plugin[time_bar].plugin_video_is),'].seek(get(temp))');
call_cmd();
</action>
<action name="get_time">
get_mouse_offset( time_bar , get(plugin[time_bar].plugin_video_is ));
copy(temps,temp);
roundval(temps);
if(temps GE 60,
div(min,temps,60); copy(temp_min,min); roundval(min);
if(min GT temp_min, sub(min,1););
mod(cur_hlookat,temps,60);
if(min LT 10,
txtadd(minuts,0,get(min));
,
copy(minuts,min);
);
,
set(minuts,'00');
);
mul(temp,minuts,60);
sub(seconds,temps,temp);
if(seconds LT 10, txtadd(seconds,0,get(seconds)));
txtadd(temps,get(minuts),:,get(seconds));
txtadd(temps,[textformat leftmargin='4' rightmargin='4'],get(minuts),:,get(seconds),[/textformat]);
txtadd(call_cmd,"showtext( ",get(temps)," )");
call_cmd();
</action>
<action name="startdragingslider">
get_mouse_offset( time_bar , get(plugin[time_bar].plugin_video_is ));
set(seek_dragging,true);
dragslider(time_bar);
</action>
<action name="OnHoverSlider">
get_mouse_offset( time_bar , get(plugin[time_bar].plugin_video_is ));
</action>
<action name="stopdragingslider">
set(seek_dragging, false);
</action>
<action name="dragslider">
if(seek_dragging,
div(temp,plugin[time_seek].pixelwidth,2);
sub(xpos, mouse_x_offset, temp);
sub(xmax, plugin[%1].pixelwidth, plugin[time_seek].pixelwidth);
if(xpos LT 0, set(xpos,0));
if(xpos GT xmax, copy(xpos,xmax));
copy(plugin[time_seek].x, xpos);
delayedcall(0.01, dragslider(%1) );
);
</action>
<action name="erase_time_bar">
removeplugin(time_bar);
removeplugin(loadedbytes_);
removeplugin(time_);
removeplugin(time_seek);
</action>
|