vitamio视频播放器



视频功能:

1、视频播放的控制台,进度条,播放、暂停按钮、播放时长,返回按钮,播放影片的名称

2、调节音量

3、调节亮度

  4、拖动屏幕来进行视频的快进跟快退

5、视频在横竖屏切换的时候的显示(注:动态改变vidwoView的高度能解决切换的时候自适应的问题)

开发的资料:

1、首先要有vitamio的library,这里是我修改过的一个 :http://download.csdn.net/detail/u012808234/8959989

2、然后就是一个vitamio的api文档,网上直接搜就好了;

 
然后就是真正的开发了

                    首先新建一个项目 : Vitamio_Demo, 然后就是把vitamio的library导入。
            (1)在第一次进入的时候一定要对vitamio进行初始化及检查,
  1. new AsyncTask<Object, Object, Object>() {  
  2.             @Override  
  3.             protected Object doInBackground(Object... params) {  
  4.   
  5.                 Vitamio.initialize(getApplicationContext());  
  6.                 if (Vitamio.isInitialized(getApplicationContext()))  
  7.                     return null;  
  8.   
  9.                 //反射解压  
  10.                 try {  
  11.                     Class c = Class.forName("io.vov.vitamio.Vitamio");  
  12.                     Method extractLibs = c.getDeclaredMethod("extractLibs"new Class[] { android.content.Context.classint.class });  
  13.                     extractLibs.setAccessible(true);  
  14.                     extractLibs.invoke(c, new Object[] { getApplicationContext(), R.raw.libarm });  
  15.                       
  16. //                  Field vitamioLibraryPath = c.getDeclaredField("vitamioLibraryPath");  
  17. //  
  18. //                   AndroidContextUtils.getDataDir(ctx) + "libs/"  
  19.                       
  20.                 } catch (NoSuchMethodException e) {  
  21.                     Log.e("extractLibs", e.toString());  
  22.                     e.printStackTrace();  
  23.                 } catch (IllegalArgumentException e) {  
  24.                     e.printStackTrace();  
  25.                 } catch (IllegalAccessException e) {  
  26.                     e.printStackTrace();  
  27.                 } catch (InvocationTargetException e) {  
  28.                     e.printStackTrace();  
  29.                 } catch (ClassNotFoundException e) {  
  30.                     e.printStackTrace();  
  31.                 }  
  32.                 return null;  
  33.             }  
  34.         }.execute();  
new AsyncTask<Object, Object, Object>() {
			@Override
			protected Object doInBackground(Object... params) {

				Vitamio.initialize(getApplicationContext());
				if (Vitamio.isInitialized(getApplicationContext()))
					return null;

				//反射解压
				try {
					Class c = Class.forName("io.vov.vitamio.Vitamio");
					Method extractLibs = c.getDeclaredMethod("extractLibs", new Class[] { android.content.Context.class, int.class });
					extractLibs.setAccessible(true);
					extractLibs.invoke(c, new Object[] { getApplicationContext(), R.raw.libarm });
					
//					Field vitamioLibraryPath = c.getDeclaredField("vitamioLibraryPath");
//
//					 AndroidContextUtils.getDataDir(ctx) + "libs/"
					
				} catch (NoSuchMethodException e) {
					Log.e("extractLibs", e.toString());
					e.printStackTrace();
				} catch (IllegalArgumentException e) {
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					e.printStackTrace();
				} catch (InvocationTargetException e) {
					e.printStackTrace();
				} catch (ClassNotFoundException e) {
					e.printStackTrace();
				}
				return null;
			}
		}.execute();

                      (2)  实现一堆接口: OnClickListener, OnCompletionListener, OnInfoListener,
OnPreparedListener, OnErrorListener, OnBufferingUpdateListener, OnSeekCompleteListener 

  1. private void stopPlayer() {  
  2.         if (mVideoView != null)  
  3.             mVideoView.pause();  
  4.     }  
  5.   
  6.     private void startPlayer() {  
  7.         if (mVideoView != null)  
  8.             mVideoView.start();  
  9.     }  
  10.   
  11.     private boolean isPlaying() {  
  12.         return mVideoView != null && mVideoView.isPlaying();  
  13.     }  
  14.   
  15.     /** 是否�?��自动恢复播放,用于自动暂停,恢复播放 */  
  16.     private boolean needResume;  
  17.   
  18.     @Override  
  19.     public boolean onInfo(MediaPlayer arg0, int arg1, int arg2) {  
  20.         switch (arg1) {  
  21.         case MediaPlayer.MEDIA_INFO_BUFFERING_START:  
  22.             // �?��缓存,暂停播�?  
  23.             if (isPlaying()) {  
  24.                 stopPlayer();  
  25.                 needResume = true;  
  26.             }  
  27.             mLoadingView.setVisibility(View.VISIBLE);  
  28.             break;  
  29.         case MediaPlayer.MEDIA_INFO_BUFFERING_END:  
  30.             // 缓存完成,继续播�?  
  31.             if (needResume) {  
  32.                 startPlayer();  
  33.             }  
  34.             mLoadingView.setVisibility(View.GONE);  
  35.             break;  
  36.         case MediaPlayer.MEDIA_INFO_DOWNLOAD_RATE_CHANGED:  
  37.             // 显示 下载速度  
  38.             break;  
  39.         }  
  40.         return true;  
  41.     }  
  42.   
  43.     /**  
private void stopPlayer() {
		if (mVideoView != null)
			mVideoView.pause();
	}

	private void startPlayer() {
		if (mVideoView != null)
			mVideoView.start();
	}

	private boolean isPlaying() {
		return mVideoView != null && mVideoView.isPlaying();
	}

	/** 是否�?��自动恢复播放,用于自动暂停,恢复播放 */
	private boolean needResume;

	@Override
	public boolean onInfo(MediaPlayer arg0, int arg1, int arg2) {
		switch (arg1) {
		case MediaPlayer.MEDIA_INFO_BUFFERING_START:
			// �?��缓存,暂停播�?
			if (isPlaying()) {
				stopPlayer();
				needResume = true;
			}
			mLoadingView.setVisibility(View.VISIBLE);
			break;
		case MediaPlayer.MEDIA_INFO_BUFFERING_END:
			// 缓存完成,继续播�?
			if (needResume) {
				startPlayer();
			}
			mLoadingView.setVisibility(View.GONE);
			break;
		case MediaPlayer.MEDIA_INFO_DOWNLOAD_RATE_CHANGED:
			// 显示 下载速度
			break;
		}
		return true;
	}

	/**
  1.  * 播放完成  
  2.  */  
  3. @Override  
  4. public void onCompletion(MediaPlayer arg0) {  
  5. }  
  6.   
  7. /** 
  8.  * //在视频预处理完成后调用。在视频预处理完成后被调用。此时视频的宽度、高度、宽高比信息已经获取到,此时可调用seekTo让视频从指定位置开始播放。 
  9.  */  
  10. @Override  
  11. public void onPrepared(MediaPlayer arg0) {  
  12. }  
  13.   
  14. /** 
  15.  * 在异步操作调用过程中发生错误时调用。例如视频打开失败。 
  16.  */  
  17. @Override  
  18. public boolean onError(MediaPlayer arg0, int arg1, int arg2) {  
  19.     mLoadingView.setVisibility(View.GONE);  
  20.     mTv_NoPlay.setVisibility(View.VISIBLE);  
  21.     return false;  
  22. }  
  23.   
  24. /** 
  25.  * 在网络视频流缓冲变化时调用。 
  26.  *  
  27.  * @param arg0 
  28.  * @param arg1 
  29.  */  
  30. @Override  
  31. public void onBufferingUpdate(MediaPlayer arg0, int arg1) {  
  32.     mTv_NoPlay.setVisibility(View.GONE);  
  33.     mLoadingView.setVisibility(View.VISIBLE);  
  34. }  
  35.   
  36. /** 
  37.  * 在seek操作完成后调用。 
  38.  */  
  39. @Override  
  40. public void onSeekComplete(MediaPlayer arg0) {  
  41. }  
  42.   
  43. private MediaController.PlayControl mPlayControll = new PlayControl() {  
  44.   
  45.     @Override  
  46.     public void downLoad() {  
  47.   
  48.     }  
  49.   
  50.     @Override  
  51.     public void collect() {  
  52.     }  
  53.   
  54. };  
  55.   
  56. lt;span style="white-space:pre"> </span>//点击开始暂停的回调  
  57. private onPauseListener mPauseListener = new onPauseListener() {  
  58.   
  59.     @Override  
  60.     public void onPause() {  
  61.         Log.d("pause""pause");  
  62.     }  
  63.   
  64.     @Override  
  65.     public void onPlay() {  
  66.         Log.e("onPlay""play");  
  67.     }  
  68. };  
  69.   
  70. @Override  
  71. public void onClick(View arg0) {  
  72.     // TODO Auto-generated method stub  
  73.       
  74. }  
	 * 播放完成
	 */
	@Override
	public void onCompletion(MediaPlayer arg0) {
	}

	/**
	 * //在视频预处理完成后调用。在视频预处理完成后被调用。此时视频的宽度、高度、宽高比信息已经获取到,此时可调用seekTo让视频从指定位置开始播放。
	 */
	@Override
	public void onPrepared(MediaPlayer arg0) {
	}

	/**
	 * 在异步操作调用过程中发生错误时调用。例如视频打开失败。
	 */
	@Override
	public boolean onError(MediaPlayer arg0, int arg1, int arg2) {
		mLoadingView.setVisibility(View.GONE);
		mTv_NoPlay.setVisibility(View.VISIBLE);
		return false;
	}

	/**
	 * 在网络视频流缓冲变化时调用。
	 * 
	 * @param arg0
	 * @param arg1
	 */
	@Override
	public void onBufferingUpdate(MediaPlayer arg0, int arg1) {
		mTv_NoPlay.setVisibility(View.GONE);
		mLoadingView.setVisibility(View.VISIBLE);
	}

	/**
	 * 在seek操作完成后调用。
	 */
	@Override
	public void onSeekComplete(MediaPlayer arg0) {
	}

	private MediaController.PlayControl mPlayControll = new PlayControl() {

		@Override
		public void downLoad() {

		}

		@Override
		public void collect() {
		}

	};

<span style="white-space:pre">	</span>//点击开始暂停的回调
	private onPauseListener mPauseListener = new onPauseListener() {

		@Override
		public void onPause() {
			Log.d("pause", "pause");
		}

		@Override
		public void onPlay() {
			Log.e("onPlay", "play");
		}
	};

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		
	}


然后就是实现他们的方法

    (3)  然后初始化videoView, 进度条,等等的控件。

          

  1. if (mPath.startsWith("http:"))  
  2.         mVideoView.setVideoURI(Uri.parse(mPath));  
  3.     else  
  4.         mVideoView.setVideoPath(mPath);  
  5.     // 设置显示名称  
  6.     mMediaController = new MediaController(MainActivity.this, mVideoView);  
  7.     mMediaController.setmPlayControl(mPlayControll);  
  8.     mMediaController.setOnPauseListener(mPauseListener);  
  9.     mVideoView.setMediaController(mMediaController);  
  10.     mMediaController.setFileName("哈哈哈");  
  11.       
  12.     int mCurrentOrientation = getResources().getConfiguration().orientation;  
  13.     if (mCurrentOrientation == Configuration.ORIENTATION_PORTRAIT) {  
  14.         Utils.full(false, MainActivity.this);  
  15.         mRl_PlayView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 400));  
  16.         if (mVideoView != null){  
  17.                     mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_STRETCH, 0);  
  18.             }  
  19.     } else if (mCurrentOrientation == Configuration.ORIENTATION_LANDSCAPE) {  
  20.         Utils.full(true, MainActivity.this);  
  21.         mRl_PlayView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));  
  22.         if (mVideoView != null)  
  23.             mVideoView.setVideoLayout(mLayout, 0);  
  24.     }  
  25.     mVideoView.requestFocus();  
  26.       
		if (mPath.startsWith("http:"))
				mVideoView.setVideoURI(Uri.parse(mPath));
			else
				mVideoView.setVideoPath(mPath);
			// 设置显示名称
			mMediaController = new MediaController(MainActivity.this, mVideoView);
			mMediaController.setmPlayControl(mPlayControll);
			mMediaController.setOnPauseListener(mPauseListener);
			mVideoView.setMediaController(mMediaController);
			mMediaController.setFileName("哈哈哈");
			
			int mCurrentOrientation = getResources().getConfiguration().orientation;
			if (mCurrentOrientation == Configuration.ORIENTATION_PORTRAIT) {
				Utils.full(false, MainActivity.this);
				mRl_PlayView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 400));
				if (mVideoView != null){
//					mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_STRETCH, 0);
					}
			} else if (mCurrentOrientation == Configuration.ORIENTATION_LANDSCAPE) {
				Utils.full(true, MainActivity.this);
				mRl_PlayView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
				if (mVideoView != null)
					mVideoView.setVideoLayout(mLayout, 0);
			}
			mVideoView.requestFocus();
			

(4)然后就是进行音量调节,快进,快退亮度的调节,使用手势监听就能实现这一点

  1. <span style="white-space:pre">    </span>mGestureDetector = new GestureDetector(new MyGestureListener());  
<span style="white-space:pre">	</span>mGestureDetector = new GestureDetector(new MyGestureListener());
然后就是在onTouch  跟onScroll 里边进行处理;

现在我是把屏幕分成平均的俩分,如果是在左边滑动,而且没有在快进回事快退的时候就是调整亮度,反之就是调整音量。

在调整进度的时候是不能调整亮度的,我加了这判断,而且视频只有在快进已经快退完成以后才进行视频的seekTo()。

  1. /** 滑动 */  
  2.         @Override  
  3.         public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {  
  4.             mMediaController.hide();  
  5.             float mOldX = e1.getX(), mOldY = e1.getY();  
  6.             int y = (int) e2.getRawY();  
  7.             int x = (int) e2.getRawX();  
  8.             Display disp = getWindowManager().getDefaultDisplay();  
  9.             int windowWidth = disp.getWidth();  
  10.             int windowHeight = disp.getHeight();  
  11.   
  12.             if (Math.abs(x- mOldX) >20 && !isUp_downScroll) { //执行快进快退  
  13.                 isFast_Forword = true;  
  14.                     mFast_forward = x - mOldX;  
  15.                     fast_ForWord(mFast_forward);  
  16.             }else if (mOldX > windowWidth * 1.0 / 2 && Math.abs(mOldY - y) > 3 && !isFast_Forword)// 右边滑动  
  17.                 onVolumeSlide((mOldY - y) / windowHeight);  
  18.             else if (mOldX < windowWidth / 2.0 && Math.abs(mOldY - y) > 3 && !isFast_Forword)// 左边滑动  
  19.                 onBrightnessSlide((mOldY - y) / windowHeight);  
  20.             return super.onScroll(e1, e2, distanceX, distanceY);  
  21.         }  
/** 滑动 */
		@Override
		public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
			mMediaController.hide();
			float mOldX = e1.getX(), mOldY = e1.getY();
			int y = (int) e2.getRawY();
			int x = (int) e2.getRawX();
			Display disp = getWindowManager().getDefaultDisplay();
			int windowWidth = disp.getWidth();
			int windowHeight = disp.getHeight();

			if (Math.abs(x- mOldX) >20 && !isUp_downScroll) { //执行快进快退
				isFast_Forword = true;
					mFast_forward = x - mOldX;
					fast_ForWord(mFast_forward);
			}else if (mOldX > windowWidth * 1.0 / 2 && Math.abs(mOldY - y) > 3 && !isFast_Forword)// 右边滑动
				onVolumeSlide((mOldY - y) / windowHeight);
			else if (mOldX < windowWidth / 2.0 && Math.abs(mOldY - y) > 3 && !isFast_Forword)// 左边滑动
				onBrightnessSlide((mOldY - y) / windowHeight);
			return super.onScroll(e1, e2, distanceX, distanceY);
		}


             调整音量:

  1. /** 
  2.  * 滑动改变声音大小 
  3.  *  
  4.  * @param percent 
  5.  */  
  6. private void onVolumeSlide(float percent) {  
  7.     isUp_downScroll = true;  
  8.     if (mVolume == -1) {  
  9.         mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);  
  10.         if (mVolume < 0)  
  11.             mVolume = 0;  
  12.   
  13.         // 显示  
  14.         mOperationBg.setImageResource(R.drawable.video_volumn_bg);  
  15.         mVolumeBrightnessLayout.setVisibility(View.VISIBLE);  
  16.     }  
  17.   
  18.     int index = (int) (percent * mMaxVolume) + mVolume;  
  19.     if (index > mMaxVolume)  
  20.         index = mMaxVolume;  
  21.     else if (index < 0)  
  22.         index = 0;  
  23.   
  24.     // 变更声音  
  25.     mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, index, 0);  
  26.   
  27.     // 变更进度条  
  28.     ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();  
  29.     lp.width = findViewById(R.id.operation_full).getLayoutParams().width * index / mMaxVolume;  
  30.     mOperationPercent.setLayoutParams(lp);  
  31. }  
	/**
	 * 滑动改变声音大小
	 * 
	 * @param percent
	 */
	private void onVolumeSlide(float percent) {
		isUp_downScroll = true;
		if (mVolume == -1) {
			mVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
			if (mVolume < 0)
				mVolume = 0;

			// 显示
			mOperationBg.setImageResource(R.drawable.video_volumn_bg);
			mVolumeBrightnessLayout.setVisibility(View.VISIBLE);
		}

		int index = (int) (percent * mMaxVolume) + mVolume;
		if (index > mMaxVolume)
			index = mMaxVolume;
		else if (index < 0)
			index = 0;

		// 变更声音
		mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, index, 0);

		// 变更进度条
		ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();
		lp.width = findViewById(R.id.operation_full).getLayoutParams().width * index / mMaxVolume;
		mOperationPercent.setLayoutParams(lp);
	}


调整亮度:

  1. /** 
  2.      * 滑动改变亮度 
  3.      *  
  4.      * @param percent 
  5.      */  
  6.     private void onBrightnessSlide(float percent) {  
  7.         isUp_downScroll = true;  
  8.         if (mBrightness < 0) {  
  9.             mBrightness = getWindow().getAttributes().screenBrightness;  
  10.             if (mBrightness <= 0.00f)  
  11.                 mBrightness = 0.50f;  
  12.             if (mBrightness < 0.01f)  
  13.                 mBrightness = 0.01f;  
  14.   
  15.             // 显示  
  16.             mOperationBg.setImageResource(R.drawable.video_brightness_bg);  
  17.             mVolumeBrightnessLayout.setVisibility(View.VISIBLE);  
  18.         }  
  19.         WindowManager.LayoutParams lpa = getWindow().getAttributes();  
  20.         lpa.screenBrightness = mBrightness + percent;  
  21.         if (lpa.screenBrightness > 1.0f)  
  22.             lpa.screenBrightness = 1.0f;  
  23.         else if (lpa.screenBrightness < 0.01f)  
  24.             lpa.screenBrightness = 0.01f;  
  25.         getWindow().setAttributes(lpa);  
  26.   
  27.         ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();  
  28.         lp.width = (int) (findViewById(R.id.operation_full).getLayoutParams().width * lpa.screenBrightness);  
  29.         mOperationPercent.setLayoutParams(lp);  
  30.     }  
/**
	 * 滑动改变亮度
	 * 
	 * @param percent
	 */
	private void onBrightnessSlide(float percent) {
		isUp_downScroll = true;
		if (mBrightness < 0) {
			mBrightness = getWindow().getAttributes().screenBrightness;
			if (mBrightness <= 0.00f)
				mBrightness = 0.50f;
			if (mBrightness < 0.01f)
				mBrightness = 0.01f;

			// 显示
			mOperationBg.setImageResource(R.drawable.video_brightness_bg);
			mVolumeBrightnessLayout.setVisibility(View.VISIBLE);
		}
		WindowManager.LayoutParams lpa = getWindow().getAttributes();
		lpa.screenBrightness = mBrightness + percent;
		if (lpa.screenBrightness > 1.0f)
			lpa.screenBrightness = 1.0f;
		else if (lpa.screenBrightness < 0.01f)
			lpa.screenBrightness = 0.01f;
		getWindow().setAttributes(lpa);

		ViewGroup.LayoutParams lp = mOperationPercent.getLayoutParams();
		lp.width = (int) (findViewById(R.id.operation_full).getLayoutParams().width * lpa.screenBrightness);
		mOperationPercent.setLayoutParams(lp);
	}
在手势进行快进快退的时候让时间进行改变:

  1. private void fast_ForWord(float dis){  
  2.         long currentProgress ;  
  3.         long duration  = mVideoView.getDuration();  
  4.         if (mVideoView.getCurrentPosition() + 500*(long)dis < 0)   
  5.             currentProgress = 0;  
  6.         else  
  7.             currentProgress = mVideoView.getCurrentPosition() + 500*(long)dis;  
  8.         mTv_progress.setText(Utils.generateTime(currentProgress) + "/" + Utils.generateTime(duration));  
  9.         if (dis > 0)   
  10.             mIv_Progress_bg.setImageResource(R.drawable.btn_fast_forword);  
  11.         else  
  12.             mIv_Progress_bg.setImageResource(R.drawable.btn_back_forword);  
  13.         mFl_Progress.setVisibility(View.VISIBLE);  
  14.     }  
private void fast_ForWord(float dis){
		long currentProgress ;
		long duration  = mVideoView.getDuration();
		if (mVideoView.getCurrentPosition() + 500*(long)dis < 0) 
			currentProgress = 0;
		else
			currentProgress = mVideoView.getCurrentPosition() + 500*(long)dis;
		mTv_progress.setText(Utils.generateTime(currentProgress) + "/" + Utils.generateTime(duration));
		if (dis > 0) 
			mIv_Progress_bg.setImageResource(R.drawable.btn_fast_forword);
		else
			mIv_Progress_bg.setImageResource(R.drawable.btn_back_forword);
		mFl_Progress.setVisibility(View.VISIBLE);
	}


改变进度是在onTouch 的action _up 的时候执行的:

  1. @Override  
  2. public boolean onTouchEvent(MotionEvent event) {  
  3.     if (mGestureDetector.onTouchEvent(event))  
  4.         return true;  
  5.   
  6.     // 处理手势结束  
  7.     switch (event.getAction() & MotionEvent.ACTION_MASK) {  
  8.     case MotionEvent.ACTION_UP:  
  9.         endGesture();  
  10.         break;  
  11.     }  
  12.   
  13.     return super.onTouchEvent(event);  
  14. }  
  15.   
  16. /** 手势结束 */  
  17. private void endGesture() {  
  18.     mVolume = -1;  
  19.     mBrightness = -1f;  
  20.     if (isFast_Forword) {  
  21.         onSeekProgress(mFast_forward);  
  22.     }  
  23.     // 隐藏  
  24.     mDismissHandler.removeMessages(0);  
  25.     mDismissHandler.sendEmptyMessageDelayed(0800);  
  26. }  
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		if (mGestureDetector.onTouchEvent(event))
			return true;

		// 处理手势结束
		switch (event.getAction() & MotionEvent.ACTION_MASK) {
		case MotionEvent.ACTION_UP:
			endGesture();
			break;
		}

		return super.onTouchEvent(event);
	}

	/** 手势结束 */
	private void endGesture() {
		mVolume = -1;
		mBrightness = -1f;
		if (isFast_Forword) {
			onSeekProgress(mFast_forward);
		}
		// 隐藏
		mDismissHandler.removeMessages(0);
		mDismissHandler.sendEmptyMessageDelayed(0, 800);
	}
  
  1. <span style="white-space:pre">    </span>onSeekProgress(long)是调整进度的:<pre name="code" class="java">    private void onSeekProgress(float dis){  
  2.         Log.e("position ==", mVideoView.getCurrentPosition() + 500*(long)dis+"/"+mVideoView.getDuration());  
  3.         mVideoView.seekTo(mVideoView.getCurrentPosition() + 500*(long)dis);  
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值