function get_mediainfo(mediainfoIndex) {
    switch (mediainfoIndex) {        

        case 0:
            return  { "mediaUrl": "",
                      "placeholderImage": "buffering.jpg",
                      "chapters": [               
                                  ] };      
		                          
        default:
             throw Error.invalidOperation("No such mediainfo");
     }
}

function StartWithParent(parentId, appId) {
    new StartPlayer_0(parentId);
}

function StartPlayer_0(parentId) {
    this._hostname = EePlayer.Player._getUniqueName("xamlHost");
    Silverlight.createHostedObjectEx( {   source: 'Page.xaml', 
                                        parentElement: $get(parentId ||"SilverlightControlHost"), 
                                        id:this._hostname, 
                                        properties:{ 
											 width:'100%', 
											 height:'100%', 
											 version:'1.0', 
											 background:document.body.style.backgroundColor, 
											 isWindowless:'false' }, 
                                        events:{ onLoad:Function.createDelegate(this, this._handleLoad) },
                                       initParams:"streaming:/31390/LaloReel_vid/LaloReel.wmv,streaming:/31390/MoGfxReel_vid/MoGfxReel.wmv,streaming:/31390/AACE_vid/AACE.wmv,streaming:/31390/LifeScan_vid/LifeScan.wmv,streaming:/31390/UM2_vid/UM2.wmv,streaming:/31390/XHH_vid/XHH.wmv,streaming:/31390/Pathway_vid/Pathway.wmv,streaming:/31390/Husky_vid/Husky.wmv,streaming:/31390/Kelty_vid/Kelty.wmv" } );
    this._currentMediainfo = 0;      
}
StartPlayer_0.prototype= {
    _handleLoad: function() {
        this._player = $create(   ExtendedPlayer.Player, 
                                  { // properties
                                    autoPlay    : true, 
                                    volume      : 1.0,
                                    muted       : false
                                  }, 
                                  { // event handlers
                                    //mediaEnded: Function.createDelegate(this, this._onMediaEnded),
                                    //mediaFailed: Function.createDelegate(this, this._onMediaFailed)
                                  },
                                  null, $get(this._hostname)  ); 
        //this._playNextVideo();     
        this.ChangeVideo();
    },    
    ChangeVideo: function(){            

        //var plugin = sender.getHost();
	    //var params = plugin.InitParams.split(",");

        this._player.set_mediainfo( get_mediainfo( this._currentMediainfo++ ) );    
    }        
}
