﻿/************************************** Splendid *************************************
 * Created By:		Steve Doggett
 * Creation Date:	26th September 2007
 * Edited ----------------------------------------------------------------------------
 *      By:               On:
 * Description -----------------------------------------------------------------------
 *      This file creates and initialises a Silverlight audio/video player objects
 *
 *      Functions:
 *          createSilverlightAudioPlayer( container )
 *          createSilverlightVideoPlayer( container )
 *      
 *      Events Handlers:
 *          Are defined in BasePlayerEventHandlers.js
 *      
 **************************************************************************************/

/*************************************** Globals **************************************/
var playOnLoad = true;
    
/************************************** Functions *************************************/

/****
 * Create the silverlight audio player object
 ****/
function createSilverlightAudioPlayer( container )
{
    var obj = Silverlight.createObject(
        "xaml/AudioPlayer.xaml",            // Source property value.
        document.getElementById(container), // DOM reference to hosting DIV tag.
        "silverlightControl",               // Unique control id value.
        {                                   // Control properties.
            width:'100%',                   // Width of rectangular region of control in pixels.
            height:'100%',                  // Height of rectangular region of control in pixels.
            inplaceInstallPrompt:false,     // Determines whether to display in-place install prompt if invalid version detected.
            background:'#00000000',         // Background color of control.
            isWindowless:'true',            // Determines whether to display control in Windowless mode.
            framerate:'24',                 // MaxFrameRate property value.
            version:'1.0.0'                 // Control version to use.
        },
        {
            onError: null,
            onLoad: null
        },
        null                                // Context value -- event handler function name.
    );     
}

/****
 * Create the silverlight video player object
 ****/
function createSilverlightVideoPlayer( container )
{
    var obj = Silverlight.createObject(
        "xaml/VideoPlayer.xaml",            // Source property value.
        document.getElementById(container), // DOM reference to hosting DIV tag.
        "silverlightControl",               // Unique control id value.
        {                                   // Control properties.
            width:'100%',                   // Width of rectangular region of control in pixels.
            height:'100%',                  // Height of rectangular region of control in pixels.
            inplaceInstallPrompt:false,     // Determines whether to display in-place install prompt if invalid version detected.
            background:'#00000000',         // Background color of control.
            isWindowless:'true',            // Determines whether to display control in Windowless mode.
            framerate:'24',                 // MaxFrameRate property value.
            version:'1.0.0'                 // Control version to use.
        },
        {
            onError: null,
            onLoad: null
        },
        null                                // Context value -- event handler function name.
    ); 
       
}


