Hi,
I was asked if it's possible to use iframes as distorted hotspots in krpano.
Here the answer directly for everyone:
Yes, when using the 1.19 version and the new Javascript actions from there, then this would be possible (but HTML5-only of course).
There is currently not 'direct' support for including html elements (but that's already planed), so this will require a 'temporary' hotspot image (can be any small image, e.g. a small 8x8 black or transparent image) to get the hotspot itself created.
Here an example:
https://krpano.com/krpano.html?xm….xml&html5=only
and here the xml code of that example:
<hotspot name="iframe"
url="black.png"
ath="0" atv="0"
distorted="true"
onloaded="add_iframe('https://www.youtube.com/embed/p4j18C0CEEg', 640, 360);"
/>
<action name="add_iframe" type="Javascript">
var iframe = document.createElement("iframe");
iframe.style.position = "absolute";
iframe.style.left = 0;
iframe.style.top = 0;
iframe.style.width = "100%";
iframe.style.height = "100%";
iframe.style.border = 0;
iframe.src = args[1];
caller.registercontentsize(args[2], args[3]);
caller.sprite.appendChild(iframe);
</action>
Display More
This could be also used to add any other html content. Only two things to respect - the size need to be set and this will work only in HTML5.
Best regards,
Klaus