You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

panowerk

Beginner

Posts: 12

Location: Freiburg, Germany

Occupation: Designer, photographer

  • Send private message

21

Wednesday, February 8th 2012, 9:50pm

Flickering text

I managed to fix the flickering text issue. If anyone else has the same issue it has to do with fading the text in and out. Not sure why it only happens at the edge of a video player, but it does.

Set the text style to

Source code

1
fadeintime="0" fadetime="0"
and the problem is gone.

JPC

Beginner

Posts: 40

Location: Paris

Occupation: Photographies and media

  • Send private message

22

Saturday, March 3rd 2012, 9:22pm

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

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

23

Friday, June 15th 2012, 4:21pm

problem with video progressbar

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/videoplayer

http://virtualtuur.com/krpano/videoplayer/code/video.xml

Anybody?

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Posts: 130

Location: Venezia

Occupation: interactive pictures

  • Send private message

24

Friday, June 15th 2012, 5:58pm

RE: problem with video progressbar

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/videoplayer

http://virtualtuur.com/krpano/videoplayer/code/video.xml

Anybody?

Tuur *thumbsup*

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

25

Friday, June 15th 2012, 7:24pm

ok,
problems solved.
videoplayer with play/pause and volume slider.

Officinepanottiche , what do you mean with this?

Quoted

why you did not use the button "crop" function?
If you intend to be i(diot)OS compatible toggle "alpha" and "zorder", not "visible"!


Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

Posts: 130

Location: Venezia

Occupation: interactive pictures

  • Send private message

26

Friday, June 22nd 2012, 5:19pm

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!

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

27

Friday, June 22nd 2012, 7:00pm

Yes i know that, sometimes i use it.

About ios, i don't have that experience.

Tuur *thumbsup*

A
http://www.virtualtuur.com
Skype:studiotuur

28

Thursday, July 12th 2012, 8:19pm

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:

Source code

1
2
3
<action name="video2">
playvideo(sequence01.f4v);
</action>

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
www.xyz360.com.br

29

Wednesday, July 18th 2012, 10:25am

RE: A progress time bar for the videoplayer plugin

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 *wacko* ), 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:

Source code

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:

Source code

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.
Hi can you please guide me on applying the progressbar on a 360 player.

Posts: 130

Location: Venezia

Occupation: interactive pictures

  • Send private message

30

Tuesday, July 31st 2012, 5:52pm

Dear officinepanottiche,



mikel26 has sent the following message from krpano.com Forum (http://krpano.com/forum/wbb):

Hi

Hope is all well to you.

I saw this post from krpano

http://www.corriere.it/Primo_Piano/Cultu…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....

jschrader

Intermediate

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

31

Thursday, November 8th 2012, 11:11am

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 using :-)

To 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

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

32

Friday, November 9th 2012, 3:28pm

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!

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
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>
http://www.virtualtuur.com
Skype:studiotuur

jschrader

Intermediate

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

33

Friday, November 9th 2012, 5:12pm

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 *tongue*
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.

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

34

Friday, November 9th 2012, 5:15pm

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 *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

jschrader

Intermediate

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

35

Friday, November 9th 2012, 5:28pm

Wat doe ik niet voor het Tuurtje ...
In line 284 in the code above there are two "alpha" settings which cause the hickup.

jschrader

Intermediate

Posts: 237

Location: Bavaria, Germany

Occupation: Photographer, Producer

  • Send private message

37

Saturday, November 10th 2012, 11:44am

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.

Tuur

Sage

Posts: 3,208

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

38

Monday, December 17th 2012, 1:55am

Dank u wel Herr Schrader,
Goede tip!
That works nice in safari too!

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

reza_shnia

Trainee

Posts: 98

Occupation: krpano freelancer || creating ideas & coding them || krpano developer

  • Send private message

39

Tuesday, December 18th 2012, 11:13am

distorted hotspot videos

With special thanks to Michel.
Can any one make this plugin work for distorted hotspot videos ? *confused* (i am really need it)

reza_shnia

Trainee

Posts: 98

Occupation: krpano freelancer || creating ideas & coding them || krpano developer

  • Send private message

40

Thursday, December 20th 2012, 8:44am

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 109

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
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>

Similar threads