


function get_mediainfo(mediainfoIndex) {
    switch (mediainfoIndex) {        

        case 0:
            return  { "mediaUrl": "e-mail-enable-sharepoint-list.wmv",
                      "placeholderImage": "",
                      "chapters": [    
                                        { "title": "[Unknown Value]",   "time": 5.1211519,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.00.05.1211519.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 18.9173654,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.00.18.9173654.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 29.5098213,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.00.29.5098213.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 41.559394,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.00.41.5593940.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 64.0871241,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.01.04.0871241.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 73.8719722,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.01.13.8719722.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 85.3159735,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.01.25.3159735.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 108.8040914,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.01.48.8040914.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 149.4397386,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.02.29.4397386.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 158.1775726,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.02.38.1775726.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 206.0036897,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.03.26.0036897.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 228.7026049,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.03.48.7026049.jpg"} ,    
                                        { "title": "[Unknown Value]",   "time": 261.44637,     "imageUrl": "e-mail-enable-sharepoint-list_MarkerThumb 00.04.21.4463700.jpg"}                
                                  ] };                                                                
                          
        default:
             throw Error.invalidOperation("No such mediainfo");
     }
}

function StartWithParent(parentId, appId) {
    new StartPlayer_0(parentId);
}

function StartPlayer_0(parentId) {
    this._hostname = EmePlayer.Player._getUniqueName("xamlHost");
    Silverlight.createObjectEx( {   source: 'player.xaml', 
                                        parentElement: $get(parentId ||"divPlayer_0"), 
                                        id:this._hostname, 
                                        properties:{ width:'100%', height:'100%', version:'1.0', background:'transparent', isWindowless:'true' }, 
                                        events:{ onLoad:Function.createDelegate(this, this._handleLoad) } } );
    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)
                                  },
                                  null, $get(this._hostname)  ); 
        this._playNextVideo();     
    },    
    _onMediaEnded: function(sender, eventArgs) {
        window.setTimeout( Function.createDelegate(this, this._playNextVideo), 1000);
    },    
    _playNextVideo: function() {
        var cVideos = 1;
        if (this._currentMediainfo<cVideos)
            this._player.set_mediainfo( get_mediainfo( this._currentMediainfo++ ) );    
    }        
}

