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.

1

Friday, November 4th 2011, 1:30pm

onvideocomplete not working properly on iphone/ipod (BUG?)

Hi again,

can anyone confirm that the onvideocomplete-tag is not working properly on the iPhone/iPod if the video was stopped using the "DONE"-Button of the iPhones videoplayer? If the video was played to the end, the onvideocomplete-tag works fine.

Thanks and best regards
Nupsi

2

Friday, November 4th 2011, 3:11pm

Hi,

yes, that's correct,
the onvideocomplete will be only called when the video has reached its end, not when it has be stopped,

best regards,
Klaus

3

Friday, November 4th 2011, 4:37pm

hmm...that´s bad *sad* Is there any way to trigger an action inside krpano if the video was interrupted by the user? Because the video-window don´t disappear if the video was stopped..

Thanks and best regards
Nupsi

4

Friday, November 4th 2011, 4:47pm

Hi,

at the moment not directly, but I will think about additionally events,

a possibility might be eventually by checking constantly if ispaused is set...

best regards,
Klaus

5

Saturday, November 5th 2011, 9:05am

The "onpaused"-event would also get activated if the user just pause the video, would´nt it? And how would such an event inside an action look like? I did try these, but without success:

if(isphone,set(events[stopcheck].iscomplete,removeplugin(video)));

if(isphone,set(events[stopcheck].set(plugin[video].iscomplete,removeplugin(video))));


if(isphone,set(events[stopcheck].plugin[video].iscomplete,removeplugin(video)));

Thanks and best regards
Nupsi

6

Sunday, November 6th 2011, 10:21am

Man....this is frustrating *unsure* I just can´t get it to work! No matter how I try to set the "ispaused-event", krpano just ignores it.
I´m pretty sure my code is wrong, but I can´t find any example using a video-event here in the forums. I guess it should work just like every other event, except that I have to tell the event to check if the correct plugin (video) is paused?!

These are working neither:
set(events[stopcheck].if(plugin[video].ispaused,removeplugin(video)));

set(events[stopcheck].plugin[video].ispaused,removeplugin(video));


Any help would be really appreciated! Sorry for being a pain in the a$$, but tomorrow is closing date....

Thanks and best regards
Nupsi

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

7

Sunday, November 6th 2011, 10:03pm

Hi Nupsi,

ispaused is not an event but a variable that can be checked at any time...
I am not sure if the following code match your needs but here it is, in the hope it can help (sorry if I am off topic).
It would remove the video after a stop() action (but only if the video has already been played partialy or totally)

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
	<plugin name="video"
			...
			onvideoready="check_ispaused();"
			/>

	<action name="check_ispaused">
		if(plugin[video].ispaused,
			delayedcall(0,check_ispaused());
			,
			check_isstopped();
			);
	</action>

	<action name="check_isstopped">
		ifnot(plugin[video].ispaused,
			delayedcall(0,check_isstopped());
			,
			if(plugin[video].time == 0, <!-- the video has been stopped -->
				removeplugin(video);
				,
				delayedcall(0,check_isstopped());
				);
			);
	</action>


Hope it help...

SAlut.

8

Sunday, November 6th 2011, 10:41pm

Very interesting and smart way to handle this problem! I'll implement your routines and let you know how it works *smile*

Thanks and best regards
Nupsi

9

Monday, November 7th 2011, 3:36pm

It´s not working either, Michel *sad* The iPhone 4 wont remove the video if it´s paused. All that happens is that the video is paused and if you click it again it continues to play. It works well on the iPod though, which makes me believe that there is something really wrong with the videoplayer-plugin. Somehow it seems like if the videoplayer-plugin ignores the "ispaused"-tag on the iphone 4 completely.

Hopefully Klaus will add an "isstopped" or "iscanceld"-event soon. Until then it seems not possible to add and remove a video with an action properly *unsure*

Anyway...thanks a LOT for your help!!!

Best regards
Nupsi

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

10

Monday, November 7th 2011, 4:35pm

Hi Nupsi,

Quoted

It´s not working either, Michel *sad* The iPhone 4 wont remove the video if it´s paused. All that happens is that the video is paused and if you click it again it continues to play.
That's normal ;-) ... the code removes the video only if a stop() action is called (in fact, it removes the video when the current time is 0 (this is what happens after a stop() call ) after calling a pause() or stop() action ... See line 18 of the previous code)...
Here a modified code to removes the video also on pause() action:

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
	<plugin name="video"
			...
			onvideoready="check_ispaused(get(name));"
			/>

	<action name="check_ispaused">
		if(	plugin[%1].loaded, <!-- check if the plugin exit before executing following code -->
			if(plugin[%1].ispaused,
				delayedcall(0,check_ispaused(%1));
				,
				check_isstoppedorpaused(%1);
				);
			);
	</action>

	<action name="check_isstoppedorpaused">
		if(	plugin[%1].loaded, <!-- check if the plugin exit before executing following code -->
			ifnot(plugin[%1].ispaused,
				delayedcall(0,check_isstoppedorpaused(%1));
				,
				<!-- the video has been stopped or paused -->
				removeplugin(%1);
				);
			);
	</action>


Hope this one works as you expect *smile* ... (I have no ipod/iphone)

SAlut.

11

Wednesday, November 16th 2011, 9:53am

Hey Michel,

sorry for the long delay, but work kept me really busy! I tried your code and way, but unfortunately the iPhone (or krpano) behaves really weird when it comes to playing videos. I did try a lot of stuff, but if you click on the "Done-Button" the video pauses and don´t stop, that´s why your stop-routine won´t work because the video don´t return to 00:00.
I also tried to put an exiter-plugin on top of the posterurl-image after the video was started, but zorder is not working because the poster-image is always on top.

The only solution I found is to use the pause-function to double check if the video was played in first place and then if it is paused and use that to remove the plugin. This disables the pause-function of the videoplayer, but at least you´re able to remove the video. I was able to sell the tour anyway, with the offer to fix this as soon as the videoplayer gets fixed, but that´s of course nothing you can do forever *unsure*

So let us hope Klaus will add an "onstop-event" to the videoplayer.js which captures the click on the "Done-Button" and triggers an action! *smile*

Thanks and best regards
Nupsi

12

Tuesday, November 22nd 2011, 4:10pm

Hi,

try the new release with the new "onvideopaused" event:
krpano 1.0.8.14

best regards,
Klaus

13

Wednesday, November 23rd 2011, 11:50am

Hey Klaus,

thanks for the Info!!! I just tested the new release and the video still remains after you clicked on "Done/Fertig" on the iPhone.

This is what happens if you click on "Done/Fertig"-Button:
- the video leaves the fullscreen-mode
- the posterurl-picture shows up again with the play-button inside
- if you click the posterurl again the video continues from the position where you did try to exit the video

So it looks like the "Done/Fertig"-Button just enables the pause-mode of the video, but in windowmode instead of fullscreen like the pause-button inside the videoplayer.
It would be really great if the onvideocomplete-event would also be triggered if the user interrupts the video with a click on the "Done/Fertig"-Button *smile*

The new release makes it a little easyer and faster, because we don´t have to run a loop which asks every millisecond if the video is paused. But there is still no way to end the video AND pause it, except watch the whole video and wait for the "onvideocomplete-event".

Thanks and best regards
Nupsi

14

Wednesday, November 23rd 2011, 1:42pm

Hi,
So it looks like the "Done/Fertig"-Button just enables the pause-mode of the video, but in windowmode instead of fullscreen like the pause-button inside the videoplayer.
this is exactly what the Safari is doing on the iPhone - just pausing the video and sending a pause event,
it's not possible to modify that native Safari behavior or detect if the pause event comes from the 'Done' button,

It would be really great if the onvideocomplete-event would also be triggered if the user interrupts the video with a click on the "Done/Fertig"-Butto
the onvideocomplete event would be only called when the video has reached its end,
why should that event also be called when the video is just paused, that would be wrong...
maybe just use the onvideopaused event (or both) to remove the video...

best regards,
Klaus

15

Wednesday, November 23rd 2011, 2:40pm


why should that event also be called when the video is just paused, that would be wrong...
maybe just use the onvideopaused event (or both) to remove the video...

That´s what I do right now^^ If the video is paused, I trigger an action to remove the plugin. But that removes the plugin and the video also if the user pauses the video inside the videoplayer. The normal behavior would be that if a user click the pause button inside the iphone-videoplayer it gets paused (of course *g*), but if a user clicks on the "End/Fertig"-Button, on the upper left of the videoplayer, the video stops and the videoplayer completely disappears. That´s what I try to achieve with krpano, but without success.

Here´s the new code for the new release I use (without the whole self-made-check-if-ispaused-actions, using just onvideopaused):
<action name="add_video_iphone">
addplugin(video);
set(plugin[video].url,plugins/videoplayer.js);
set(plugin[video].videourl,videos/video_small.mp4);
set(plugin[video].align,center);
set(plugin[video].loop,false);
set(plugin[video].posterurl,skin/vidstart.jpg);
set(plugin[video].onvideopaused,removeplugin(video));
set(plugin[video].onvideocomplete,removeplugin(video))
</action>

The videoplayer is missing a "oninterrupt"-event, which captures the "Done/Fertig"-button and triggers a command/action.

Thanks and best regards
Nupsi

16

Wednesday, November 23rd 2011, 2:53pm

Hi,

again - it's not possible to detect if the user has pressed the DONE button on the iPhone,
the Safari browser is just sending a pause-event in this case,

you could maybe do that - remove the video only on the iPhone (on the iPad or Desktop there is no DONE button):

Source code

1
set(plugin[video].onvideopaused,if(isphone, removeplugin(video) ));


best regards,
Klaus

17

Wednesday, November 23rd 2011, 4:08pm

ah...okay, now I get it! Sorry! I did overread the fact that the browser just returns a pause-event. In this case I' ll try to find another way to check if the video was just paused or canceld. Maybe with a videosize-routine...

Thanks again and best regards
Nupsi

18

Thursday, November 24th 2011, 4:06pm

I' ll try to find another way to check if the video was just paused or canceld. Maybe with a videosize-routine...
what about the "isphone" example solution from above? this should work in your case, or?

19

Thursday, November 24th 2011, 4:40pm

No, it´s not working, Klaus. Like you said, the browser just pauses the video, even when it´s set back to window-mode. The solution from Michel is waiting for the pause-event and then checks if the videos playtime was set back to zero, but the videoplayer does not set the playtime back to zero when you click on the DONE-Button.

So right now I can´t think of any way to check if the user pressed the pause- or done-button, because for krpano it´s both the same. But there is always a solution, I just need to dig a little deeper... ;) I´ll check out the data all the krpano-events/tags return and see if one of them holds the solution....

Best regards
Nupsi