A progress time bar for the videoplayer plugin
-
-
Hi Michel hank you for this work, i am looking for a load bar for an hotspot video distorder, of course when i use yours for plugin i have a problem with the x value, as you describe it
you can have a look at this link it is just a test (the bar is on the hotspot not on the first plugin)another question, do you know how to do an action at a time from a hotspot video ?
Thank you for your answer
JPC
-
Hi all,
i was working on this video player in krpano and with the briljant code of Michel.
now i find something i don't understand. I think it's a 'bug' in the code.
Well, i don't see it.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/videoplayerhttp://virtualtuur.com/krpano/videoplayer/code/video.xml
Anybody?
Tuur
-
Hi, I tried to figure out what is wrong...
No idea yet.
Did you try with a toggle pause?
You define 2 buttons, try to toggle pause on both.
You need an action to reset the video to zero, pause it, hide the pause and reveal the play button.
Seems that at the end you must press "pause" to start it over.
why you did not use the button "crop" function?
If you intend to be i(diot)OS compatible toggle "alpha" and "zorder", not "visible"!
Hope I can help, even if a fraction of how much everybody here helped me!
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/videoplayerhttp://virtualtuur.com/krpano/videoplayer/code/video.xml
Anybody?
Tuur
-
ok,
problems solved.
videoplayer with play/pause and volume slider.Officinepanottiche , what do you mean with this?
Quotewhy you did not use the button "crop" function?
If you intend to be i(diot)OS compatible toggle "alpha" and "zorder", not "visible"!Tuur
-
Sorry, I try to write more clearly...
In krpano you can use a "crop" function, that helps building buttons with different states. It is indeed VERY helpful and powerful (see the downladable examples).
Another way is to toggle the buttons changing their Zorder.iOS have some difficulties with "visible".
Hope it helps!
-
Yes i know that, sometimes i use it.
About ios, i don't have that experience.
Tuur
A
-
Hello!
I'm trying to make a sequence of videos.
When one finishes the other start automatically.
I'm using onvideocomplete to load an action that is:
There are two problems now:
1) The timebar doesn't adapt to the new video length
2) I can't make any actions to load a new video (video3)
3) Can't make the loop="false" on the new one.I can also make it with buttons:
At the end of each video a button appear to load next video.
Would it be easier to do?
Any suggestions?Tuur,
Could you please share the volume and play/pause code as a <include url""> xml?
I'm missing something here and can't put it to work.Best Regards,
Daniel Farjoun
http://www.xyz360.com.br -
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:Code
Display More<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_3Hope you like it... Comments, examples use, improvements are well come...
@ BBomber
here a code for video 360:Code
Display More<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.
Hi can you please guide me on applying the progressbar on a 360 player.
-
Dear officinepanottiche,
mikel26 has sent the following message from krpano.com Forum (https://krpano.com/forum/wbb):
Hi
Hope is all well to you.
I saw this post from krpano
http://www.corriere.it/Primo_Piano/Cu…avigabile.shtml
by any chance mind giving me information on adding the play pause seek
bar the navigation controller hd and fullscreen function ?Thank You Please do reply ASAP.
Hi, mikel26!!!
I simply followed the instruction in this 3d!
I modified the code to my needs and my interface.Fullscreen is something I took from the basic KRpano controller (as code) and applied to my design.
HD is something I coded myself in krpano, the whole thing is composed by 5videos in 2 versions, dh and sd, my load system has a "flag" when HD is on and simply changes the path of the video folder to the one desired (preloading is a bit tweaked also)
Sorry I cannot disclose the code.... -
Back into Videos on iPad again.
I finally got these working in a way I wanted it and, best of all, I understodd most parts of the code that I'm usingTo put a cherry on top I would love to add some controls to the video.
Buttons for Start/Pause/Stop and Sound are not much of an issue, but what about the timebar?
I found that the version that was generously provided here is not woking on the iPad.Any chance to get this going?
Or can anybody share a working example of video in panos with controls on the ipad?
Won't need distorted hotspots.Thank you so much
Jürgen -
well, in this part of code there is some that makes error on iPad.. on desktop is ok.. time bar and volume control..
when you find the problem, let me know!
Code
Display More<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>
-
Thats an old one, I already tried this :D
And of course I found the error, wich is pretty easy to find and to solve
But even when corrected it doesn't work on iPad, which is no surprise as it contains the same old timebar-code from the beginning. -
ah ok ,
i don't know. didn't put time in that lately..
can you give a hint for the ipad problem in the code?
and do you share the new one then..?
the code.Tuur
-
Wat doe ik niet voor het Tuurtje ...
In line 284 in the code above there are two "alpha" settings which cause the hickup. -
Use this for check the xml
-
For me it's much easier to just drag and drop the xml into the browser window.
At least Opera and Firefox will tell you right away whats wrong. -
Dank u wel Herr Schrader,
Goede tip!
That works nice in safari too!Tuur
-
With special thanks to Michel.
Can any one make this plugin work for distorted hotspot videos ? (i am really need it) -
This is the code for distorted hotspot videos :
I know something is wrong in this code and any improvement is welcomed.
for exampel,at line 108, i forced to disable "check_for_parents" function and add "set(parents_return,%1);" at line 109Code
Display More<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>
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!