// VideoPlugin(media address)
//
// Video is turned on/off by enlargable routine 
//
var MediaAddr;	// Video Address

function VideoPlugin(src)				// src is video to play
{  
    Silverlight.createObject(
        "../XAML/Video.xml",               // Source property value.
        parentElement,                  // DOM reference to hosting DIV tag.
        "myVideoPlugin",         		// Unique plug-in ID value.
        {                               // Per-instance properties.
            width:'100%',               // Width of rectangular region of 
                                        // plug-in area in pixels.
            height:'100%',              // Height of rectangular region of 
                                        // plug-in area in pixels.
            inplaceInstallPrompt:false, // Determines whether to display 
                                        // in-place install prompt if 
                                        // invalid version detected.
            background:'#D6D6D6',       // Background color of plug-in.
            isWindowless:'true',       // true allows other divs to go over the top 
                                        // in Windowless mode.
            framerate:'24',             // MaxFrameRate property value.
            version:'1.0'               // Silverlight version to use.
        },
        {
            onError:null,               // OnError property value -- 
                                        // event handler function name.
            onLoad:null                 // OnLoad property value -- 
                                        // event handler function name.
        },
        null);                          // Context value -- event handler function name.
	MediaAddr=src;
}

function VideoCanvasLoaded(s) {
	s.findName("media").source=MediaAddr;
}

function media_stop(sender, args) {
    sender.findName("media").stop();
}

function media_pause(sender, args) {
    sender.findName("media").pause();
}
 
function media_play(sender, args) {
    sender.findName("media").play();
}
	
function media_begin(sender, args) {
    sender.findName("media").stop();
    sender.findName("media").play();
} 
