Code example for MediaPlayer

Methods: getVideoHeightgetVideoWidth

0
    } 
 
    MediaPlayer.OnVideoSizeChangedListener mSizeChangedListener =
        new MediaPlayer.OnVideoSizeChangedListener() { 
            public void onVideoSizeChanged(MediaPlayer mp, int width, int height) { 
                mVideoWidth = mp.getVideoWidth(); 
                mVideoHeight = mp.getVideoHeight(); 
                if (mVideoWidth != 0 && mVideoHeight != 0) { 
                    getHolder().setFixedSize(mVideoWidth, mVideoHeight); 
                } 
                if (mOnVideoSizeChangedListener != null) 
                    mOnVideoSizeChangedListener.onVideoSizeChanged(mp, width, height); 
            } 
    }; 
 
	MediaPlayer.OnInfoListener mInfoListener = new MediaPlayer.OnInfoListener() {
		public boolean onInfo(MediaPlayer mp, int what, int extra) { 
			if (what == MediaPlayer.MEDIA_INFO_NOT_SEEKABLE) 
			{ 
				mCanSeekBack = false; 
				mCanSeekForward = false;