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

  • 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

  • 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

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

    Hope it help...

    SAlut.

  • 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

  • Hi Nupsi,

    Quote

    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 *wink* ... 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:

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

    SAlut.

  • 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

  • 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

  • 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


  • 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

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

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

    best regards,
    Klaus

  • 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

  • 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

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!