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.
Video end javascript event
-
-
-
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:
Code
Alles anzeigen<krpano> <action name="startup" autorun="onstart"> if(device.panovideosupport == false, error('Sorry, but panoramic videos are not supported by your current browser!'); , loadscene(videopano); ); </action> <scene name="videopano" title="krpano Panoramic Video Example"> <!-- include the videoplayer interface / skin (with VR support) --> <include url="skin/videointerface.xml" /> <!-- include the videoplayer plugin --> <plugin name="video" url.html5="/static/krpano/viewer/plugins/videoplayer.js" pausedonstart="true" loop="false" volume="1.0" onloaded="add_video_sources();" onvideoready="jscall('alert(123);')" onvideoplay="jscall(alert(123);)" onvideopaused="js('alert(123);')" onvideocomplete="js(alert(123);)" onerror="jscall('alert(123);')" /> <!-- use the videoplayer plugin as panoramic image source --> <image> <sphere url="plugin:video" /> </image> <!-- set the default view --> <view hlookat="0" vlookat="0" fovtype="DFOV" fov="130" fovmin="75" fovmax="150" distortion="0.0" /> <!-- add the video sources and play the video --> <action name="add_video_sources"> videointerface_addsource('1024x512', '%CURRENTXML%/video-1024x512.mp4|%CURRENTXML%/video-1024x512.webm|%CURRENTXML%/iphone-audio.m4a', '%CURRENTXML%/video-1024x512-poster.jpg'); videointerface_addsource('1920x960', '%CURRENTXML%/video-1920x960.mp4|%CURRENTXML%/video-1920x960.webm|%CURRENTXML%/iphone-audio.m4a', '%CURRENTXML%/video-1920x960-poster.jpg'); if(device.ios, <!-- iOS Safari has a very slow 'video-to-webgl-texture' transfer, therefore use a low-res video by default --> videointerface_play('1024x512'); , videointerface_play('1920x960'); ); </action> </scene> </krpano>
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!