Virtual tour how-to guide for the web

If your virtual tour is meant to be published in a web page, then it must be pointed out that two separate environments are involved in its usage: the client and the server.

The client or "user agent" is the device responsible of interpreting the virtual tour and displaying it to the end user. Usually the client is a "browser" program (like, for example, Internet Explorer, Mozilla Firefox, Opera, Apple Safari, Google Chrome, etc) which runs in the end user's computer.

The server is the device responsible of storing the virtual tour and delivering it to the client when the latter requests it through the appropriate channel and protocol. Usually the server is a "web server" program (for example, Apache, Microsoft Internet Information Server, etc) which runs as a service in a remote computer that can be reached through the Internet and understands the HTTP protocol; sometimes also the client's local filesystem may be the server, in which case the communication between client and server doesn't need network access, thus allowing virtual tour copies to be distributed to end users on any storage medium.

 

Client requirements:

In order to view the virtual tour properly, several requirements must be satisfied in the computer where it is going to be displayed (the end user's computer):

1) Having an up-to-date browser available, such as Internet Explorer or Mozilla Firefox in a recent release.

2) The browser must have support for the Javascript language, and it must be enabled. Usually all browsers have such support built-in, but it might have been disabled by the end user in the browser's settings, or it might get blocked by security software like antiviruses, antispies', privacy filters, etc.

3) The browser must have support for Adobe Flash Player, version 9.0.28 or better. Such support can be obtained for free from http://www.adobe.com/go/getflashplayer and is required by lots of applications like, for example, online games, digital photo albums, YouTube videos, etc. This support is installed separately for every browser, so if there are several browsers in the computer, the Flash Player extension ("add-on" or "plugin") must be downloaded and installed for each one of them. If the virtual tour doesn't display properly, the first item in the checklist would be to make sure that the Flash Player browser extension has been updated to the most recent version available.

 

At ibizavirtualtours.com we have a diagnostics page which may be useful for checking that the client meets the requirements. To check, just visit the address http://ibizavirtualtours.com/9/2/diag.html from the end user's computer.

 

Server requirements:

In the server's filesystem an initially empty folder shall be reserved to store the virtual tour in it. If you have several virtual tours, keep in mind that they should not be stored in the same folder to prevent overwriting files of one of them with files of another one. Then the main requirement would be to store the files and folders, which are the components of the virtual tour, in accordance with a certain structure whose details follow. Let's suppose that the virtual tour has been named "TOURNAME".

Contents of the virtual tour folder:

- Files:

    • swfobject.js
    • twviewer.swf
    • config_TOURNAME.bin
    • images_TOURNAME.zip
    • resources_TOURNAME.zip

- Subfolders:

    • map
    • resources
    • scene
    • sounds

All the files and subfolders of the finished virtual tour as we deliver it are packed in a compressed file of type .ZIP, whose contents are already organized according to the aforementioned structure. Thus it suffices to uncompress that .ZIP file in the empty folder that you have prepared.

Afterwards your web designer and/or your webmaster will have some work to do creating a web page for the virtual tour to be inserted into. If needed, they may examine the sample .HTML file that we deliver with the tour.

 

Instructions for the web designer

What follows are detailed instructions intended for your web site's designer about creating a web page into which to insert the virtual tour:

1) Move the required files and folders to an empty folder which we'll call "the virtual tour's folder". These required files and folders are the ones which have been mentioned above in the "Server requirements" section. The only files that may be moved somewhere else are twviewer.swf and swfobject.js, in which case the web page's source code will have to be adapted accordingly.

2) In an appropriate spot in the web page's HTML code (normally in the section delimited by <HEAD> ... </HEAD>) insert the following code:

    <script type="text/javascript" src="swfobject.js"></script>

The script swfobject.js is free open source whose purpose is to make easier the managing and embedding of Adobe Flash objects in web pages. The present instructions are in close accordance with those in the swfobject v. 1.5 documentation that may be found at http://blog.deconcept.com/swfobject/.

If the file swfobject.js isn't stored in the same folder as the web page, at this step you should adapt the src attribute of the <script> element to the proper location.

3) In the spot in the HTML code where you intend to have the virtual tour displayed, insert:

    <div id="flashcontent">
        To view the virtual tour properly, Flash Player 9.0.28 or later version is needed.
        Please download the latest version of
        <a href="http://www.adobe.com/go/getflashplayer" target="_blank">Flash Player
        </a> and install it on your computer.
    </div>
    <script type="text/javascript">
        var so = new SWFObject("twviewer.swf", "sotester", "960", "640", "9.0.28", "#FFFFFF");
        so.addParam("allowNetworking", "all");
        so.addParam("allowScriptAccess", "always");
        so.addParam("allowFullScreen", "true");
        so.addParam("scale", "noscale");
        so.addVariable("base", "");
        so.addVariable("lwImg", "");
        so.addVariable("lwBgColor", "255,255,255,255");
        so.addVariable("lwBarBgColor", "255,0,0,0");
        so.addVariable("lwBarColor", "255,0,255,0");
        so.addVariable("lwBarBounds", "0,0,960,640");
        so.addVariable("lwlocation", "0");
        so.addVariable("lwShowLoadingPercent", "true");
        so.addVariable("lwTextColor", "255,255,255,255");
        so.addVariable("iniFile", "config_TOURNAME.bin");
        so.addVariable("progressType", "1");
        so.addVariable("swfFile", "resources/TOURNAMEMIN_IbizaVirtualTours_logo_animado.swf");
        so.addVariable("href", location.href);
        so.write("flashcontent");
    </script>

Where TOURNAME is a placeholder for the virtual tour's name. For example, if the virtual tour's name were "Beautiful_Beach", then the corresponding line would be:

    so.addVariable("iniFile", "config_Beautiful_Beach.bin");

and TOURNAMEMIN is the tour's name in lower case letters, so in the same example:

    so.addVariable("swfFile", "resources/beautiful_beach_IbizaVirtualTours_logo_animado.swf");

If the file twviewer.swf isn't stored in the same folder as the web page, at this step all references to twviewer.swf must be preceded with the corresponding relative path.

Important note: The Javascript code that has just been described is compatible only with the swfobject.js script which we deliver with the virtual tour (swfobject v. 1.5). More recent swfobject versions exist out there which can be downloaded from the Internet and using those with our virtual tours is perfectly feasible, but the Javascript code in the virtual tour's web page must then be rewritten for compatibility. For example, the following code is compatible with swfobject v. 2.x:

    <div id="flashcontent">
        To view the virtual tour properly, Flash Player 9.0.28 or later version is needed.
        Please download the latest version of
        <a href="http://www.adobe.com/go/getflashplayer" target="_blank">Flash Player
        </a> and install it on your computer.
    </div>
    <script type="text/javascript">
        var flashvars = {
            base: "",
            iniFile: "config_TOURNAME.bin",
            swfFile: "resources/TOURNAMEMIN_IbizaVirtualTours_logo_animado.swf",
            progressType: "1",
            lwBgColor: "255,255,255,255",
            lwImg: "",
            lwBarBgColor: "255,0,0,0",
            lwBarColor: "255,0,255,0",
            lwBarBounds: "0,0,960,640",
            lwlocation: "0",
            lwShowLoadingPercent: "true",
            lwTextColor: "255,255,255,255",
            href: location.href
        };
        var params = {
            allowNetworking: "all",
            allowScriptAccess: "always",
            allowFullScreen: "true",
            scale: "noscale",
            bgcolor: "#FFFFFF"
        };
        var attributes = {
            id: "VirtualTour",
            name: "VirtualTour"
        };
        swfobject.embedSWF("twviewer.swf", "flashcontent", "960", "640", "9.0.28", null, flashvars, params, attributes);
    </script>

Our tours are usually designed to fit in a box of 960x640 pixels in the web page (hence the values 960 and 640 that appear in the code above). Along with the tour we deliver some sample .HTML files which can be used either to view the tour directly from the client's filesystem or, by looking into the (very easy) source code, to understand how to insert it into any web page.

 

Customization

Everything that occurs during the virtual tour's playback is regulated by the encrypted file config_TOURNAME.bin, which only the Adobe Flash app twviewer.swf can interpret. It is impossible to edit the config_TOURNAME.bin file directly, the only working way to modify it is to generate it again from the modified source project, and for that it is required that you get in touch with us again, as all rights over the virtual tour sources are reserved by our company. All high-res photographs which are kept in the scene folder are encrypted also, so they can't be modified or even replaced with other ones.

Nevertheless it is still possible to customize a couple of things without much effort:

1) SWFObject parameters:

With the swfobject.js library version 1.5, in the line
        var so = new SWFObject("VIEWER_URL", "sotester", "960", "640", "9.0.28", "#FFFFFF");
or with version 2.x of that library, in the line
        swfobject.embedSWF("VIEWER_URL", "flashcontent", "960", "640", "9.0.28", null, flashvars, params, attributes);
the following parameter may be customized:

"VIEWER_URL": relative URL of the tour viewer's file (twviewer.swf) with respect to the current web page. Usually its value will be "twviewer.swf", unless you have moved the file to some other folder, in which case the value shall be adapted accordingly and also the base variable (see below) shall be set to the relative path of the virtual tour's folder with respect to the new location of the file twviewer.swf.

2) Variables accepted by the virtual tour viewer twviewer.swf:

These variables are passed to twviewer.swf by means of the so.addVariable("VARIABLE", "VALUE") statements with swfobject 1.5 or as properties of the flashwars object with swfobject 2.x, as can be seen in the examples in part 3 of the "Instructions for the web designer" section.

base: relative URL of the virtual tour's folder with respect to the URL of twviewer.swf. Combining this variable appropriately with the VIEWER_URL parameter mentioned above, you can have the twviewer.swf file in a folder other than the virtual tour's, and so you could keep a single copy of that file which would be shared among all the virtual tours that you might have in your web site.

All the variables described next apply to the splash screen which is displayed until the files necessary to start viewing the virtual tour get downloaded.

lwImg: URL of an image file (of type .jpg, .gif, ...) or flash movie (.swf) to be used as background for the splash screen.

lwBgColor: Splash screen background color(*).

lwBarBounds: Position and size of the loading progress indicator, expressed as "POS_X,POS_Y,WIDTH,HEIGHT", in pixels. The indicator may be a standard bar (built in the software) or an Adobe Flash movie.

progressType: Type of the loading progress indicator. Allowed values are:
        "0": The indicator is a standard progress bar.
        "1": The indicator is an Adobe Flash movie, further specified by swfFile.

swfFile: URL of the loading progress indicator movie. May be left blank when progressType is set to "1" if no indicator at all is desired.

The next four variables only apply when progressType is set to "0":

lwBarBgColor: Standard progress bar background color(*).

lwBarColor: Standard progress bar front color(*).

lwShowLoadingPercent: Determines if, with the standard progress bar, a text showing the currently accomplished load percentage should be displayed or not. The text displayed would be something like "Loading 100%" (or the corresponding percentage). The word Loading is hard-coded in the software and can't be changed. The possible values are:
        "false": No text will be displayed.
        "true": The text will get displayed.

lwTextColor: With the standard progress bar, the loading percentage text's font color(*)

(*) Colors in these variables are expressed in decimal, comma-separated format, transparency+RGB, with values ranging from 0 to 255. For example, "255,0,0,0" is opaque black, "127,255,255,255" is half-transparent white.

 

(Information updated on 29/08/2010)

Home   |   Contact
360º virtual tour development   |   www.IbizaVirtualTours.com

Please call for details
Tel 971 80 40 76