public VideoViewAssert isNotPausable() { isNotNull(); assertThat(actual.canPause()) // .overridingErrorMessage("Expected to not be pausable but was.") // .isFalse(); return this; }
public VideoViewAssert isPausable() { isNotNull(); assertThat(actual.canPause()) // .overridingErrorMessage("Expected to be pausable but was not.") // .isTrue(); return this; }
public VideoViewAssert isNotPausable() { isNotNull(); assertThat(actual.canPause()) // .overridingErrorMessage("Expected to not be pausable but was.") // .isFalse(); return this; }
public VideoViewAssert isPausable() { isNotNull(); assertThat(actual.canPause()) // .overridingErrorMessage("Expected to be pausable but was not.") // .isTrue(); return this; }
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); VideoView videoView = (VideoView) findViewById(R.id.videoView); videoPosition = videoView.getCurrentPosition(); if (videoView.canPause()) { videoView.pause(); } outState.putInt(VIDEO_POSITION_KEY, videoPosition); Log.d(LOG_TAG, "onSaveInstanceState() Current Position Saved is: " + videoPosition); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_timeline_video); Bundle extras = getIntent().getExtras(); if (extras != null) { String videoUrl = extras.getString("video"); videoPlayer = findViewById(R.id.timeline_video); videoPlayer.setVideoPath(videoUrl); videoPlayer.canPause(); mediaController = new MediaController(this); mediaController.setAnchorView(videoPlayer); videoPlayer.setMediaController(mediaController); videoPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mediaController.show(); if (Preferences.getPreference(TimelineVideoActivity.this, "pref_key_video_autoplay", false)) { videoPlayer.start(); } } }); } }
@Override protected void onStop() { debugLog("onStop mPlayingPos0 = " + mPlayingPos + " -- " + mLastLoadLength); if (mVv.isPlaying() || mVv.canPause()) { mVv.stopPlayback(); } debugLog("onStop mPlayingPos1 = " + mPlayingPos + " -- " + mLastLoadLength); mLastLoadLength = 0; super.onStop(); debugLog("onStop mPlayingPos = " + mPlayingPos + " -- " + mLastLoadLength); }