SiteKiosk Android: access the local file system via the "sk://" protocol

SiteKiosk Android has been out now for a (short) while and we've already gathered important feedback. We've learned that customers want to go beyond what is possible in a normal browser, which makes perfect sense given the fact that SiteKiosk for Windows already provides such possibilities to a great extend.

Accessing arbitrary local files is not allowed in a normal browser with pages coming from a server. This makes sense because security would otherwise be compromised. But sometimes you need to access large image or video files from a page and downloading these files from a server and relying on the browser to cache for example mega or even giga bytes of data doesn't seem very feasible.

So with the release of SiteKiosk Android 1.1 we proudly present: the "sk" protocol. Using "sk://" as a prefix for your URLs allows you to address files in a particular location on your Android device. When connecting the device as a USB drive, this particular location is a folder named "SiteKiosk" directly inside the root folder of the drive. The HTML pages you load in SiteKiosk don't have direct access to this folder but instead to a subfolder named "data".

So suppose you want to show a local image named "test.jpg" in one of your pages in SiteKiosk. Here is the HTML snippet for the image you could use in order to achieve this:

<img src="sk:///data/test.jpg"></img>

Notice the three (!) slashes after the "sk:", the last one stands for the sk root folder and is mandatory (meaning it doesn't work if you forget to write it). The image "test.jpg" must be located in "SiteKiosk/data" (relative to the root of your Android USB drive). Important: you have to create both folders "SiteKiosk" as well as its subfolder "data", so don't be confused if you don't find them after installing SiteKiosk (we may add the creation of these folders to the installation process in a future version).

You can use these "sk" URLs with the 'src' attribute of image, script and link tags at the moment (further support might be available in one of the next versions). Make sure the "Enable SiteKiosk scripting" option is enabled for your page, if you restrict the surf area.

If you have any problems using this feature or have other suggestions, comments, etc., please write a comment or contact us via our web page.

Using SiteCaster offline

Please note that this article refers to a legacy product. We recommend to use the SiteCaster Kiosk CMS instead.

One may think that everthing is connected to the internet nowadays: PCs, Tablets, Smartphones and even refrigerators. But there are still terminals that have no internet or other network connection. SiteKiosk can be used on these machines without a problem. You can show your users local HTML pages that don't require an internet connection. With SiteCaster things are a bit different. Creating campaigns, scheduling and publishing them normally requires a SiteRemote account and a license for each machine. This is without a question the preferred way to bring your content to your terminals.

But some scenarios are a bit too simple to justify the use of such a content management and distribution system. Here I will describe how you can use SiteCaster to play your content, without requiring SiteRemote. 

I am assuming here that you use SiteKiosk 8.1 and want to show a video in the SiteCaster area (either in split screen or fullscreen mode) . The first thing you have to do is switch SiteCaster to offlline mode so that it doesn't wait for a broadcast to be distributed but instead play a local broadcast. In order to do that you need to locate the SiteCaster configuration file named "SiteCaster.config". In Windows 7 and Windows Vista you can find it here: C:\ProgramData\PROVISIO\SiteCaster\. In Windows XP you have to look in this location: C:\Documents and Settings\<your account name>\Application Data\PROVISIO\SiteCaster. Notice that from now on I will mention every path as it appears under Windows 7 with default settings. The paths could be different, if for example your system drive is not c: or when using Windows XP. 

Open the file in Notepad (or your preferred text editor) and make sure the following line appears inside the section SiteCasterPlayerConfigurationData:

<UseOfflineBroadcasts>true</UseOfflineBroadcasts>

The important thing is that the value inside the tag is "true", after a fresh install of SiteKiosk it is set to "false" .

Save the file and the next time SiteCaster starts, it will look in a special location for offlline broadcast data. This location is "C:\Users\Public\Documents\SiteCaster\OfflineBroadcastData" (again for Windows 7 and Vista). You have to create the folders in this path if they are not already present. After you've done this, create another folder, inside OfflineBroadcastData, named ".SiteCasterBroadcasts". This is a bit tricky in Windows Explorer, because it normally doesn't let you create a folder with a name beginning with a dot. But naming it ".SiteCasterBroadcasts.", with an additional dot at the end (that will be automatically removed), will do the trick. Ask your local Microsoft consultant for an explanation why this is necessary ;)

In this folder you have to save the XML file that is attached to this post. It describes the structure of the broadcast that should be played when in offline mode. After you've saved it in this folder, open the XML file in a text editor. You need to find and change the file path for the video that should play:

<MediaFile>
...
<Path>/nature.wmv</Path>
...
</MediaFile>

Replace "nature.wmv" with the file name of your video. This file should then be placed (or copied) into the folder "C:\Users\Public\Documents\SiteCaster\OfflineBroadcastData". There is more to do, you have to set the duration of the video. Find the first occurence of this section:

<EndCondition>
...
<OffsetInSeconds>0</OffsetInSeconds>
...
</EndCondition>

 

 Change the "0" to the duration of your video in seconds, for example "120", if the duration is 2 minutes.

Two more changes and you should be ready to go. Find these two sections and change in each one the width and height to the dimensions of your video:

 

<Section>
	...
	<Width>800</Width>
	<Height>600</Height>
</Section>

  
<Layout>
	...
	<Width>800</Width>
	<Height>600</Height>
</Layout>

 

Save the XML file and you should be done. In the configuration tool you have to enable SiteCaster, either as a split screen setting or fullscreen. The next time you start SiteKiosk, the video should appear in the SiteCaster area.

You can do more than just play a video over and over again. If you want to show a picture, there is just one thing you have to change in comparison to the video and that is <ItemKind>Video</ItemKind> to <ItemKind>Picture</ItemKind> (just search for it, it should only appear once). You can even play files sequentially and on differents channels, but this requires a deeper understanding of the XML format used here.

In case you want to do something more complex, it might be a better idea to use the  SiteCaster online editor in SiteRemote, publish the broadcast created there to a client machine of your choice and grab all the files from there. All necessary files are normally located in the folder right beneath C:\Users\Public\Documents\SiteRemote\Sync\. The name of this folder is either "{1D3F97EE-F5E6-4E81-ABF8-F7754638833E}", if SiteCaster has already been playing the broadcast, or it is the name of the broadcast plus a short postfix starting with "_", for example "SiteCasterOfflineBroadcast_123". Anyway there should be only one folder there normally, so the decision should be easy ;) You should copy the content of this folder (not the folder itself!) to "C:\Users\Public\Documents\SiteCaster\OfflineBroadcastData". Remember to edit the file SiteCaster.config to set the SiteCaster offline mode as described above.

SiteCasterSingleVideoOfflineBroadcast.xml (5.72 kb)