Hello everyone,
For my krpano based project, I’m trying to switch between 2d and 3d video scenes.
According to the documentation, in order to render flat videos, the <layer /> notation is needed although to render 3d videos <image /> along with a <sphere /> is needed.
Here is a highly simplified version of my code which works:
Code
<krpano onstart="loadscene('video_2d');">
<scene name="video_2d">
<layer name="video"
url="../plugins/videoplayer.js"
videourl="video_2d.mp4"
onvideocomplete="loadscene('video_3d')" />
</scene>
<scene name="video_3d">
<plugin name="video_3d"
url="../plugins/videoplayer.js"
videourl="video_3d.mp4" />
<image>
<sphere url="plugin:video_3d" />
</image>
</scene>
</krpano>
Display More
My question is the following: how can I can refactor this code to share the same video plugin instance instead of duplicating it with the url="../plugins/videoplayer.js”.
Would it be possible to put it in a shared layer and reuse it in each scene? That way, I can make sure the performance is the best and it wouldn't have problems with autoplay on Android after the first tap.
Thank you in advance for helping!