hd_newB

Hello,

I'm using hdisim v.6.0 on Windows XP and I try to have a working example of HTTP download to persistent storage.
So far download to filecache is working fine.

Here is the .js I'm using:

var src = "http://my_server.com/logo.png";
var FC_URI = "file:///common/required/logo.png";
var timeout = 30;
var downloadSize = 5000;
var httpClient;

// Listener
application.addEventListener("Event",EventHandler,true);

function EventHandler(objEvent)
{
//confirm user has network connection
if (Player.capabilities.network.connected == true)
{
try
{
httpClient = Network.createHTTPClient(src, Network.HTTP_GET, timeout);
httpClient.downloadFileLocation = FC_URI;

//set a callback to track progress of download
httpClient.onStateChange = OnDownloadStateChange;
httpClient.send();
}
catch(ex)
{
// print sthg
}
}
}

function OnDownloadStateChange(state)
{
switch (state)
{
case httpClient.STATE_RESPONSEPROGRESS:

if (downloadSize)
{
var percentComplete = Math.floor(100 * httpClient.dataDownloaded / downloadSize);
}
break;

case httpClient.STATE_COMPLETED:
httpClient = null; //destroy client to avoid closure issue
displayImage();
break;

case httpClient.STATE_ERROR:
httpClient = null; //destroy client to avoid closure issue
break;

case httpClient.STATE_ABORT:
httpClient = null; //destroy client to avoid closure issue
break;
}
}

function displayImage()
{
try
{
changeBackgroundImage(document.Button,FC_URI);
}
catch(e)
{
//Error

}
}

function changeBackgroundImage(pElement,pImageURI)
{
pElement.style.backgroundImage = "url('" + pImageURI + "')";
}


The first try statement is throwing an error: not enough space.
The file I try to transfer is a couple of kB.
It is working fine if I use filecache instead of persistent storage.

I also tried to get persistent storage using getPersistentStorageDevices. device #0 is present but I cannot get any information, which would mean there is no info.txt file. The point is I don't really know what is the actual location of \HDDVD root directory on my windows system. I tried to run hdisim with -req "C:/" or "C:/HDDVD" with an info.txt file there, but still nothing.

Any clue would be really appreciated!

Thanks in advance




Re: HD DVD Interactivity Authoring HTTP download to persistent storage

Amy Dullard - MSFT

if you want to save to p-storage, use one of the following uris:

common directory: "file:///common/logo.png"
provider directory: "file:///required/logo.png"
content directory: "file:///required/" + PersistentStorageManager.contentId + "logo.png"






Re: HD DVD Interactivity Authoring HTTP download to persistent storage

hd_newB

Hello Amy,

Thanks for your answer.
I've also tried those directories (commono, required, required+contentID) but still the same result. Sad

Alex





Re: HD DVD Interactivity Authoring HTTP download to persistent storage

Amy Dullard - MSFT

I think the problem occurs when you try to set the background image. You can't set the background image to p-storage uri if that uri isn't included in the manifest and playlist resource list. If you want to reference an image just downloaded, you need to also copy it into filecache and reference that filecache uri






Re: HD DVD Interactivity Authoring HTTP download to persistent storage

hd_newB

Hi Amy,

First of all, thanks a lot for your support.
Your point makes sense indeed, but even if I remove the change background part, the problem remains as nothing at all is uploaded. My guess was that HDisim is not correctly configured to point to a persistent storage (BTW, how do we specify it ) or we cannot write onto it (is there a special manipulation to do for that, like sharing a folder or such things ).

Thanks again,
Alex





Re: HD DVD Interactivity Authoring HTTP download to persistent storage

Amy Dullard - MSFT

Hi Alex - I tried out your sample and was able to get it to work when I didn't try to set the background image. So, there might be something else going on.

Information on configuring the simulator can be found in the CHM file in:

C:\Program Files\HD DVD Interactivity Jumpstart\Documentation

(depending on where you installed the simulator)

Look under command-line option

-req path Sets the path for required storage.





Re: HD DVD Interactivity Authoring HTTP download to persistent storage

David Masover

This commandline flag is completely ignored on my system.

Instead, HDiSim uses the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\iHD\RequiredPath

I can't find that documented anywhere, so I thought I'd put it here. For whatever reason, that got set to the location of my very first Hello World program, and I can find no solution short of actually changing that registry key to make it use another location.