Video end javascript event

  • Hi. Checked docs but havent found answer or just missed it - is there any js event fired when video playback is finished? Or any another way to handle that - timings etc ?
    There is an "onready" callback - but it handles plugin initialization, while I need to watch content processing.

  • Hello *smile*

    If you have call JS action then try this.

    plugin events

    js bridge

    example:

    Code
    <layer name="video"       
    ...       
    onvideoready="js(kr_onvideoready())"       
    onvideoplay="js(kr_onvideoplay())"       
    onvideopaused="js(kr_onvideopaused())"       
    onvideocomplete="js(kr_onvideocomplete())       
    onerror="js(kr_onerror())"       
    />


    Code
    function kr_onvideoready() {        
    ...  }

    Best regards
    Piotr

  • Thanks for your answer, spacerywirtualne
    But i'm still cannot fire a videoplayback-related events, so im likely need your help again.

    Here is my xml config:

    The other functionality - play and changing viewpoint - works fine. But js events are still not fired, regardless if i try to set them in a hardcode way like show above, or trying to call function available as window.kr_eventHandler()
    Id just tried both js() and jscall, quoting argument and not - im just out of ideas what i miss.
    Chrome debug console is clear at any cases.

    Any suggestions what should I try to change?

  • If i change config to
    ...

    onloaded="test();"
    onvideoready="test();"
    onvideoplay="test();"
    onvideopaused="test();"
    ...
    <action name="test" type="Javascript">
    alert(1234);
    </action>

    onload successfully alerts me, while other events do not

  • Problem solved(thanks Klaus).
    I used code from example "videopano". It includes videointerface.xml where Action "onvideocomplete" is overriden.

    changing
    set(plugin[video].onvideocomplete, skin_video_updatestate(); skin_show_playpause(); skin_show(); );
    to
    set(plugin[video].onvideocomplete, skin_video_updatestate(); skin_show_playpause(); skin_show(); %MY_OWN_ACTION_NAME%(); );

    succesfully launched %MY_OWN_ACTION_NAME% on video playback end.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!