Hello all, I am trying to create a pano that detects whether the user has flash or ipad and then pulls up the appropriate navigation buttons (simple png buttons for ipad, interactive swf for flash). I have used some sample code I have found in this forum but it is not working. I have stared at it all weekend and still no luck. Hopefully it is something simple, but here are the approaches I have tried:
Approach 1 - If/Then Statement
<krpano version="1.0.8" onstart="if(ishtml5 , do_ishtml5() ); ">
<action name="do_ishtml5"><style name="button" url="mbb11-buttons.png" keep="true" />
<plugin name="rotate" align="lefttbottom" x="10" y="10" style="button" crop="135|0|70|65" ondowncrop="135|65|70|65" onup="switch(autorotate.enabled);" devices="ipad"/> <plugin name="prev scene" align="rightbottom" x="95" y="10" style="button" crop="65|0|70|65" ondowncrop="65|65|70|65" onclick="prevscene();" devices="ipad"/> <plugin name="next scene" align="rightbottom" x="10" y="10" style="button" crop="0|0|70|65" ondowncrop="0|65|70|65" onclick="nextscene();" devices="ipad"/>
</action>Rest of code for non-html5....
Approach 2 - Viewer detection on html file
var viewer = createPanoViewer({swf:"krpano.swf", id:"krpanoSWFObject", target:"krpanoDIV"});
//viewer.useHTML5("whenpossible"); // incomment to use the HTML5 krpanoJS viewer always when possible (Safari5)
if( viewer.isDevice("iPhone|iPod|Android") ) viewer.addVariable("xml", "mbb-ipad.xml"); else viewer.addVariable("xml", "mbb11-tipoff.xml");
viewer.embed();
// var swf = createswf("krpano.swf"); //swf.addVariable("xml","mbb11-tipoff.xml"); //swf.embed("krpanoDIV");
For approach 1, it pulls up fine in flash version, and ipad pano is viewable, but the navigation buttons do not show up. For approach 2 I get an "Object expected" error with a reference to the line that beings "var viewer=...."
Did I miss a semicolon or comma somewhere or is this more involved? Thanks to all who make this a great forum.
- Louis G