Hi!
just want to share simple action code to embed iframe html with any src to your tour:
Code
<action name="iframe_embed">
removelayer(%1);
addlayer(%1);
set(layer[%1].parent, %2);
set(layer[%1].align, lefttop);
set(layer[%1].width, 100%);
set(layer[%1].height, 100%);
if(device.html5,
txtadd(iframecode, '[iframe id="krpano_iframe_',%1,'" width="100%" height="100%" src="',%3,'" frameborder="0" allow-same-origin allowfullscreen][/iframe]');
copy(layer[%1].html, iframecode);
set(layer[%1].padding, 0);
set(layer[%1].url, 'textfield.swf');
set(layer[%1].interactivecontent, true);
set(layer[%1].onloaded, iframe_resize(%1); );
,
showlog();
trace(error,'Iframe is not working in flash mode!');
);
</action>
<action name="iframe_resize" type="Javascript" devices="html5"><![CDATA[
document.querySelector("#krpano_iframe_"+args[1]).parentNode.style.height="100%";
]]></action>
Display More
Usage:
iframe_embed(IFRAME_LAYER_NAME, TARGET_LAYER_NAME, IFRAME_SRC_URL );
action will add regular krpano layer with name IFRAME_LAYER_NAME as a child to parent layer TARGET_LAYER_NAME
Working in HTML5 only (no flash) the size of iframe will be same as a parent layer, it's possible to set size in %
iframe element has 100% width and height attributes so you can change parent layer size normally
Enjoy
Andrey