function get_mediainfo(mediainfoIndex) {
    switch (mediainfoIndex) {        

        case 0:
            return { "mediaUrl":"/msonscreen/videos/Revistas_digitales.wmv",
                      "placeholderImage": "",
                      "chapters": [               
                                  ] };      
         default:
             throw Error.invalidOperation("No such mediainfo");
     }
}

function StartPlayer_0(parentId, index) {
    this._hostname = EePlayer.Player._getUniqueName("xamlHost");
    Silverlight.createObjectEx( {   source: 'video/player.xaml', 
                                        parentElement: $get(parentId || "divPlayer_0"), 
                                        id:this._hostname, 
                                        properties:{ width:'407px', height:'252px', version:'1.0', background:document.body.style.backgroundColor, isWindowless:'true' }, 
                                        events:{ onLoad:Function.createDelegate(this, this._handleLoad) } } );
    this._currentMediainfo = index;
}
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();     
    },    
    _onMediaEnded: function(sender, eventArgs) {

        location.href = document.getElementById('lnkHome').href;
        //window.setTimeout( Function.createDelegate(this, this._playNextVideo), 1000);
    },
    _onMediaFailed: function(sender, eventArgs) {
        alert(String.format( Ee.UI.Xaml.Media.Res.mediaFailed, this._player.get_mediaUrl() ) );
    },
    _playNextVideo: function() {
            this._player.set_mediainfo( get_mediainfo( this._currentMediainfo++ ) );    
    }        
}
