@Override public void onClick(View v) { switch (v.getId()) { case R.id.play: if (!videoView.isPlaying()) { videoView.start(); // 开始播放 } break; case R.id.pause: if (videoView.isPlaying()) { videoView.pause(); // 暂停播放 } break; case R.id.replay: if (videoView.isPlaying()) { videoView.resume(); // 重新播放 } break; } }
public VideoViewAssert isNotPlaying() { isNotNull(); assertThat(actual.isPlaying()) // .overridingErrorMessage("Expected to not be playing but was.") // .isFalse(); return this; } }
public VideoViewAssert isPlaying() { isNotNull(); assertThat(actual.isPlaying()) // .overridingErrorMessage("Expected to be playing but was not.") // .isTrue(); return this; }
private PictureInPictureParams updateActions() { ArrayList<RemoteAction> actions=new ArrayList<>(); if (video.isPlaying()) { actions.add(buildRemoteAction(REQUEST_PAUSE, R.drawable.ic_pause_white_24dp, R.string.pause, R.string.pause_desc)); } else { actions.add(buildRemoteAction(REQUEST_PLAY, R.drawable.ic_play_arrow_white_24dp, R.string.play, R.string.play_desc)); } return(new PictureInPictureParams.Builder() .setAspectRatio(aspectRatio) .setActions(actions) .build()); }
@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.isPlaying()) { pausePlayback(); } int index = x / mFrameWidth; mPreview.seekTo((int) (index * mShowFrameIntervalMs)); } });
public void onClickPlayback(View view) { if (mPreview.isPlaying()) { pausePlayback(); } else { startPlayback(); } }
@Override protected void onPause() { super.onPause(); if (videoView.isPlaying()) { videoView.stopPlayback(); } } }
public void pause(View view) throws InterruptedException { //正在播放 暂停 Log.e("lzf_video","暂停"); if (videoView!=null&&videoView.isPlaying()){ videoView.pause(); } } public String setTime(long time){
@Override public void onReceive(Context context, Intent intent) { if (mVideoView.isPlaying()) { mVideoView.pause(); } } }
@Override protected void onPause() { super.onPause(); if (videoView.isPlaying()) { videoView.stopPlayback(); } } }
@Override public void handleMessage(Message msg) { HgLVideoTrimmer view = mView.get(); if (view == null || view.mVideoView == null) { return; } view.notifyProgressUpdate(true); if (view.mVideoView.isPlaying()) { sendEmptyMessageDelayed(0, 10); } } }
@Override protected void onPause() { super.onPause(); if (mVideoView != null && mVideoView.isPlaying()) { videoPause(); } }
public VideoViewAssert isNotPlaying() { isNotNull(); assertThat(actual.isPlaying()) // .overridingErrorMessage("Expected to not be playing but was.") // .isFalse(); return this; } }
public VideoViewAssert isPlaying() { isNotNull(); assertThat(actual.isPlaying()) // .overridingErrorMessage("Expected to be playing but was not.") // .isTrue(); return this; }
@Override public void onDestroyView() { mExecutando = mVideoView.isPlaying(); mPosicao = mVideoView.getCurrentPosition(); if (mPosicao == mVideoView.getDuration()) { mPosicao = 0; } super.onDestroyView(); } @Override
@Override public void run() { if (seekBar != null) { seekBar.setProgress(videoView.getCurrentPosition()); } if (videoView.isPlaying()) { seekBar.postDelayed(onEverySecond, 1000); } } };
@Override protected void onPause() { super.onPause(); if(mVideoView.isPlaying()) { onClickVideo(); } }
@Override public void onPause() { super.onPause(); if (mVideoView.isPlaying()) { if (!requestVisibleBehind(true)) { // Try to play behind launcher, but if it fails, stop playback. stopPlayback(); } } else { requestVisibleBehind(false); } }