Moving from createPanoViewer to embedpano while still supporting mobile

  • I know this is probably right under my nose, but I've been messing with it long enough to go ahead and ask here.

    I have been using the following code and it works fine on the desktop and mobile:

    Code
    <div id="mediaPlayer">
          	<script>
      		var viewer = createPanoViewer({swf:"../../../assets/krpano.swf",target:"mediaPlayer"});
      		viewer.addVariable("xml", "krpano.xml");
      		viewer.embed();
    		</script>
          </div><!--END mediaPlayer-->

    Code contained within the XML points to various image resolutions - computer, mobile & tablet.

    Now I want to modify that code to use a self-contained pano created with krProtect on the desktop then have it use the XML for mobile and tablet. (The self-contained pano get's embeded in Facebook when someone clicks the 'Share on Facebook'.) What is the best approach?

    Should I create separate XML files for mobile and tablet or leave as one while removing references to the hi-res images for desktop viewing? Also, can I use soundinterface.js to stream audio to my mobile panos? I've viewed the sample code and played around with different configurations, but cannot find the right fit. Replacing

    Code
    var viewer = createPanoViewer({swf:"../../../assets/krpano.swf",target:"mediaPlayer"});

    with

    Code
    var viewer = embedpano({swf:"pano.swf",target:"mediaPlayer"});

    was my first step, but then I got lost on best way to handle the mobile portion of the code.

    PS: I'm now using 1.0.8.14. Not sure if krProtect plays nicely with the updated files.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!