﻿/***********************************
 * Script to set the initial video
 **********************************/
 
/* Accepts either a videoID value or empty string ("")
 * gets overwritten if there is an initalVideo url 
 * parameter that exists in the data source
 */
var LoadVideoID = "";
/* Accepts the zero-based index of the chapter array.
 * If the index is found in the chapter array, the player
 * will jump to that chapter.  Passing -1 will tell the
 * player not to look for a chapter index with the initial video
 */
var ChapterID = -1;

function GetVideoLoadID() {
    silverlightControl = document.getElementById("RSASilverlight");
    try {
        //Set the initial video and chapter to load
        silverlightControl.Content.Page.LoadVideoID(LoadVideoID, ChapterID);
    } catch(Error) {
        //Invalid data, run in default mode
        silverlightControl.Content.Page.LoadVideoID("", -1);
    }
}

function onSourceDownloadProgressChanged(sender, eventArgs) {
    sender.findName("msgAmount").Text = Math.round(eventArgs.progress * 100) + "%";
}
