Network trasfered trailers!

Todays plan was to put some images up on a web server and try to pull them into my "trailers" section. All went well! message.png appeared as expected...Tommorrow I hope to pull some video content...what format is ecommended for my video files WMV and if so what version of WMV should I encode to



Answer this question

Network trasfered trailers!

  • veXed

    Make a webserver

    put message.png on it



    You add all that to the END of your current mainmenu.js, popup.js, common.js, and trailers.js

    THEN REBUILD....

    then you can add the new data to your playlist resources...

    then anytime you put this in
    "http://192.168.1.1/network/message.png" anywhere in your XML that you want you will pull from that address...(it actually gets cached on load from your playlist resources)

    Now we need to get streaming video working !!!



  • sofakng

    In order to display the image you need to put it in the filecache first. PS_URI is the image in the persistent storage, FC_URI is the image in filecache.

  • Bravo2007

    Cool - trying this out now. Thanks.


  • JJ77

    sammaz-

    In the displayImage() function, I notice you have a line:

    FileIO.copy(PS_URI, FC_URI, true, cbfn);

    What is the purpose of this line Where does this line copy the file to

    Thanks in advance.


  • boston123

    I have been throwing every format of video at it and all I have been able to do is stream 1 .png image...I get "Unable to load surface from specified file" ...happens for all video...images appear fine.


  • Dietz

    here is the snipet for network images

    //Listeners
    try
    {
    document.addListener("refreshImage", checkUpdatedImage, true);
    }
    catch(e)
    {
    //Error

    }

    //Logic from here
    function checkUpdatedImage()
    {
    //Check if the file is in persistent storage
    checkFileInPS(URI_PS);
    }

    function checkFileInPS(pFilename)
    {
    try
    {
    //Callback function definition
    var cbfn = function(pFileObj, pErrorInfo)
    {
    if (pErrorInfo == FileIO.SUCCEEDED)
    {
    //File found so check for update
    //First get the last modified date
    var PSFileDate = new Date(pFileObj.lastModifiedTime);
    var PSFileLastModified = PSFileDate.getTime();

    //Check for updates on the internet
    checkFileUpdate(INTERNET_URI,PSFileLastModified);
    }
    else
    {
    //File not found or failed so download from Internet
    downloadFile();
    }
    };
    //Try to get file info
    FileIO.getFileInfo(pFilename,cbfn);
    }
    catch(e)
    {
    //Error
    }
    }

    function checkFileUpdate(pURI,pLastModifiedDate)
    {
    try
    {
    //Get the HTTPclient object from the Network object
    var myHTTPClient = Network.createHTTPClient(pURI,Network.HTTP_HEAD,TIMEOUT);

    // Inline callback function definition
    myHTTPClient.onStateChange = function(pState)
    {
    if (pState == myHTTPClient.STATE_HEADERRECEIVED)
    {
    //Get last modified date from http headers
    var myHeaders = myHTTPClient.requestHeaders;
    var HeaderLastModified = new Date(myHeaders.getHeader("Last-Modified"));

    //Compare the dates
    if (pLastModifiedDate < HeaderLastModified.getTime())
    {
    //Since internet file is newer then download it
    downloadFile();
    }
    else
    {
    //We have the latest on PS so display the image
    displayImage();
    }
    }
    };
    //Send the request
    myHTTPClient.send();
    }
    catch(e)
    {
    //Error

    }
    }

    function downloadFile()
    {
    try
    {
    //Create request
    var myHTTPClient = Network.createHTTPClient(INTERNET_URI,Network.HTTP_GET,TIMEOUT);
    myHTTPClient.downloadFileLocation = PS_URI;

    //Callback function definition
    myHTTPClient.onStateChange = function(pState)
    {
    if (pState == myHTTPClient.STATE_COMPLETED)
    {
    //Download succeeded so try to display image
    displayImage();
    }
    };

    //Send request
    myHTTPClient.send();
    }
    catch(e)
    {
    //In case of error try to display the image
    displayImage();
    }
    }

    function displayImage()
    {
    try
    {
    //Callback function definition
    var cbfn = function(pErrorInfo)
    {
    if (pErrorInfo == FileIO.SUCCEEDED)
    {
    changeBackgroundImage(document.image1,PS_URI);
    }
    else
    {
    //Error

    }
    }
    //Try to copy file
    FileIO.copy(PS_URI, FC_URI, true, cbfn);
    }
    catch(e)
    {
    //Error

    }
    }

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


  • inzel

    Haven't hit the forums in a while but just wanted to say that some amazing networked applications are coming to retail HD-DVD soon. What I saw today blew me away. Wish there was a way for us to test this stuff without aacs...it would really help at this point.


  • Scurvy Lobster

    Would you mind posting some samples


  • CaoxiCao

    You can use WMV files with the simulator, but you need to use S-EVOBs for the actual video content. S-EVOB video can be encoded in VC-1, MPEG-4 AVC, or MPEG-2, similar to primary A/V, and audio can be DD+ and DTS-HD (as well as some optional codecs depending on player support: mp3, MPEG-4 HE AAC v2, WMAPro). There are also total transfer rate restrictions to consider, though if you're streaming the A/V you likely won't hit these.

  • Network trasfered trailers!