bool MediaPlayer.IOnInfoListener.OnInfo(MediaPlayer mp, MediaInfo what, int extra)
        {
            System.Diagnostics.Debug.WriteLine(what);
            switch (what)
            {
            case MediaInfo.BufferingStart:
                Controller.CurrentState = MediaElementState.Buffering;
                mp.BufferingUpdate     += Mp_BufferingUpdate;
                break;

            case MediaInfo.BufferingEnd:
                mp.BufferingUpdate     -= Mp_BufferingUpdate;
                Controller.CurrentState = MediaElementState.Paused;
                break;

            case MediaInfo.VideoRenderingStart:
                _view.SetBackground(null);
                Controller.CurrentState = MediaElementState.Playing;
                break;
            }

            _mediaPlayer = mp;

            return(true);
        }
Exemplo n.º 2
0
        bool MediaPlayer.IOnInfoListener.OnInfo(MediaPlayer mp, MediaInfo what, int extra)
        {
            if (_view == null)
            {
                return(false);
            }

            switch (what)
            {
            case MediaInfo.BufferingStart:
                Controller.CurrentState = MediaElementState.Buffering;
                mp.BufferingUpdate     += Mp_BufferingUpdate;
                break;

            case MediaInfo.BufferingEnd:
                mp.BufferingUpdate     -= Mp_BufferingUpdate;
                Controller.CurrentState = MediaElementState.Paused;
                break;

            case MediaInfo.VideoRenderingStart:
                _view.SetBackground(null);
                Controller.CurrentState = MediaElementState.Playing;
                break;
            }

            _mediaPlayer = mp;

            return(true);
        }