@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_POSITION, video.getCurrentPosition()); }
public VideoViewAssert hasCurrentPosition(int position) { isNotNull(); int actualPosition = actual.getCurrentPosition(); assertThat(actualPosition) // .overridingErrorMessage("Expected current position <%s> but was <%s>.", position, actualPosition) // .isEqualTo(position); return this; }
@Override protected void onStop() { video.pause(); updateActions(); lastPosition=video.getCurrentPosition(); EventBus.getDefault().unregister(this); super.onStop(); }
@Test public void shouldSeekToSpecifiedPosition() throws Exception { assertThat(view.getCurrentPosition()).isEqualTo(0); view.seekTo(10000); assertThat(view.getCurrentPosition()).isEqualTo(10000); }
current = mVideoView.getCurrentPosition(); System.out.println("duration - " + duration + " current- " + current);
@Override protected void onPause() { super.onPause(); if (mVideoPlayer.isPlaying()) { mVideoPlayer.pause(); mPlayingWhenPaused = true; } else { mPlayingWhenPaused = false; } mPositionWhenPaused = mVideoPlayer.getCurrentPosition(); UMengUtil.onPageEnd(this, "视频播放页"); if (DownloadManager.getInstance() != null) { DownloadManager.getInstance().getController().unregister(mDownloadProxy); } }
@Override public void run() { if (mPreview.getCurrentPosition() >= mSelectedEndMs) { mPreview.seekTo((int) mSelectedBeginMs); } mHandler.postDelayed(this, 100); } }, 100);
try { mPlayerPosition=videoView.getCurrentPosition(); videoView.setVideoPath(bufferFile.getAbsolutePath());
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // Save the current playback position (in milliseconds) to the // instance state bundle. outState.putInt(PLAYBACK_TIME, mVideoView.getCurrentPosition()); }
class MySubtitlePoster extends TimerTask{ private VideoView video; private TreeMap <Integer, String> messages; // populate it somewhere public MySubtitlePoster(VideoView v) { video = v; } public void run() { int videoPos = video.getCurrentPosition(); String messageToDisplay = messages.floorKey(new Integer(videoPos)); // If all this is right, now you can get the message and post it, probably using a Handler } }
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putInt(STATE_POSITION, video.getCurrentPosition()); }
@Override protected void onPause() { super.onPause(); stopPosition = videoView.getCurrentPosition(); //stopPosition is an int videoView.pause(); }
@Override protected void onPause() { super.onPause(); stopPosition = videoView.getCurrentPosition(); //stopPosition is an int videoView.pause(); }
@Override public void run() { if (seekBar != null) { seekBar.setProgress(videoView.getCurrentPosition()); } if (videoView.isPlaying()) { seekBar.postDelayed(onEverySecond, 1000); } } };
private void videoProgressUpdate() { long currentPosition = mVideoView.getCurrentPosition(); Log.d(TAG, "----onProgressUpdate-cp---->>>>>>>" + currentPosition); if (currentPosition >= (rightProgress)) { mVideoView.seekTo((int) leftProgress); positionIcon.clearAnimation(); if (animator != null && animator.isRunning()) { animator.cancel(); } anim(); } }
@Override protected void onStop() { video.pause(); if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.O) { updateActions(); } lastPosition=video.getCurrentPosition(); EventBus.getDefault().unregister(this); super.onStop(); }
public void onClickPause(View view) { if (videoView.isPlaying()) { position = videoView.getCurrentPosition(); videoView.pause(); } }
public void stop() { mVideoCurrentPosition = mVideoView.getCurrentPosition(); mVideoView.pause(); mVideoProgressUpdateHandler.stop(); }
private void onApplicationConnected(CastSession castSession) { mCastSession = castSession; boolean isVideoPlaying = videoView.isPlaying(); if (isVideoPlaying) videoView.pause(); loadRemoteMedia(videoView.getCurrentPosition(), isVideoPlaying); finish(); }
public void onClickStart(View view) { String url = "http://www.livroiphone.com.br/carros/esportivos/ferrari_ff.mp4"; if (videoView.getCurrentPosition() == 0) { videoView.setVideoURI(Uri.parse(url)); videoView.setMediaController(new MediaController(this)); videoView.start(); } else { videoView.seekTo(position); videoView.start(); } }