Video.load /Progress meter ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • octane6228
    Forum Member
    • Feb 2004
    • 47

    Video.load /Progress meter ?

    Hi...I want to be able to stream/load a video file from a web site into a video object in AMS and display the progress meter info into the Progress Meter plugin?

    would this be video.load function ? I'm not sure.

    Any idea how this would be done....code examples would be extremely appreciated.

    Thanks alot
  • octane6228
    Forum Member
    • Feb 2004
    • 47

    #2
    Made some head wave...

    I found some code in the AMS help section and it works sorta. It downloads the file to the users temp directory but the status.dialog progress bar doesn't really update properly. The blue bar barely moves before it finishes downloading the file, how do I get the progress blue bar to go right across to the end ? Does it have something to do with the Set Meter Range?

    Any help is apppreciated.

    Thanks



    -- Callback function for HTTP.Download
    function DownloadCallback (nDownloaded, nTotal, TransferRate, SecondLeft, SecondsLeftFormat, Message)
    -- Convert total and downloaded bytes into formatted strings
    sDownloaded = String.GetFormattedSize(nDownloaded, FMTSIZE_AUTOMATIC, true);
    sTotal = String.GetFormattedSize(nTotal, FMTSIZE_AUTOMATIC, true);

    -- Output time left, formatted.
    StatusDlg.SetMessage("Currently downloading the movie . . . Time Left: " .. SecondsLeftFormat);

    -- Output formatted sizes to user through statusdlg status text
    StatusDlg.SetStatusText("Downloaded: " .. sDownloaded .. " / " .. sTotal);

    -- Set meter position (fraction downloaded * max meter range)
    StatusDlg.SetMeterPos((nDownloaded / nTotal) * 65534);
    end



    -- Show the StatusDlg
    StatusDlg.Show(0, false);

    -- Set statusdlg title and message
    StatusDlg.SetTitle("Downloading Movie . . . ");

    -- Set meter range (max range = 65534)
    StatusDlg.SetMeterRange(0, 65534);

    -- Download a file from the internet to the user's computer
    -- Uses DownloadCallback() as the callback function
    HTTP.Download("http://www.abc/video/MASTER.wmv", "C:\\temp\MASTER.wmv", MODE_BINARY, 20, 80, nil, nil, nil);

    -- Hide the StatusDlg
    StatusDlg.Hide();

    Comment

    Working...
    X