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

Thursday, November 8th 2018, 4:38pm

Multiple videos scenes on iOS

Hi all,
I'm trying to make a KRPano tour containing several videos (with sound) that has to run on iOS as well as other mobile and PC platforms. On iOS I have to start the application with user interaction before the video will start. Thats fine and I understand why iOS does not want its users bothered by autoplaying videos and sound. But my tour consists of several scenes and each scene needs user interaction for the video to start. Is there any (workaround) way to allow playing of the video on the start of a scene without user interaction?
Do I maybe have to change my hierarchy so the plugin lives in the root element and swap videos to prevent a new player being created? If so, how do I reference the <image> that lives in the scene?

My project setup is roughly (just the relevant parts):
<krpano>
<transition>
loadscene(%1)
</transition>
....more stuff

<scene name="scene_1">
<plugin name="video"
url.html5="%SWFPATH%/plugins/videoplayer.js"
url.flash="%SWFPATH%/plugins/videoplayer.swf"
pausedonstart="false"
autopause="true"
autoresume="true"
loop="false"
muted="true"
onloaded="add_video_sources();"
/>
<image>
<sphere url="plugin:video"/>
</image>

<action name="add_video_sources">
videointerface_addsource('2880x1440', '%CURRENTXML%/video/Intro.mp4');
videointerface_play('2880x1440');
</action>
<action name="this is called at a certain point.">
transition(scene_2);

</action>
....more stuff
</scene>

<scene name="scene_2">
<plugin name="video"
url.html5="%SWFPATH%/plugins/videoplayer.js"
url.flash="%SWFPATH%/plugins/videoplayer.swf"
pausedonstart="false"
autopause="true"
autoresume="true"
loop="false"
muted="true"
onloaded="add_video_sources();"
/>
<image>
<sphere url="plugin:video"/>
</image>

<action name="add_video_sources">
videointerface_addsource('2880x1440', '%CURRENTXML%/video/Intro.mp4');
videointerface_play('2880x1440');
</action>
<action name="this is called at a certain point.">
transition(scene_3);

</action>
</scene>

<scene name="scene_3">
<plugin name="video"
url.html5="%SWFPATH%/plugins/videoplayer.js"
url.flash="%SWFPATH%/plugins/videoplayer.swf"
pausedonstart="false"
autopause="true"
autoresume="true"
loop="false"
muted="true"
onloaded="add_video_sources();"
/>
<image>
<sphere url="plugin:video"/>
</image>

<action name="add_video_sources">
videointerface_addsource('2880x1440', '%CURRENTXML%/video/Intro.mp4');
videointerface_play('2880x1440');
</action>
<action name="this is called at a certain point.">
transition(scene_2);

</action>
</scene>
</krpano>

Tuur

Sage

Posts: 3,184

Location: Netherlands

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

  • Send private message

2

Thursday, November 8th 2018, 4:43pm

Hi,

best is to use 1 video player and just pause it change scene and video files/urls and play again.
I would certainly take it out of the scenes.

have a look here.
https://krpano.com/forum/wbb/index.php?p…77064#post77064

Hope it helps,
Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur