Search in sources :

Example 16 with MediaController

use of android.widget.MediaController in project android-oss by kickstarter.

the class VideoActivity method onCreate.

@Override
public void onCreate(@Nullable final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.video_player_layout);
    ButterKnife.bind(this);
    viewModel.outputs.preparePlayerWithUrl().compose(Transformers.takeWhen(lifecycle().filter(ActivityEvent.RESUME::equals))).compose(bindToLifecycle()).subscribe(this::preparePlayer);
    mediaController = new MediaController(this);
    mediaController.setAnchorView(rootView);
    RxView.clicks(rootView).compose(bindToLifecycle()).observeOn(AndroidSchedulers.mainThread()).subscribe(__ -> toggleControlsVisibility());
}
Also used : MediaController(android.widget.MediaController)

Example 17 with MediaController

use of android.widget.MediaController in project photo-picker-plus-android by chute.

the class VideoPlayerActivity method initVideo.

private void initVideo(String url) {
    videoView = (VideoView) findViewById(R.id.videoView);
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    Uri uri = Uri.parse(url);
    videoView.setMediaController(mediaController);
    videoView.setVideoURI(uri);
    videoView.requestFocus();
    videoView.start();
}
Also used : MediaController(android.widget.MediaController) Uri(android.net.Uri)

Example 18 with MediaController

use of android.widget.MediaController in project cw-omnibus by commonsguy.

the class VideoDemo method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    getWindow().setFormat(PixelFormat.TRANSLUCENT);
    setContentView(R.layout.main);
    File clip = new File(Environment.getExternalStorageDirectory(), "test.mp4");
    if (clip.exists()) {
        video = (VideoView) findViewById(R.id.video);
        video.setVideoPath(clip.getAbsolutePath());
        ctlr = new MediaController(this);
        ctlr.setMediaPlayer(video);
        video.setMediaController(ctlr);
        video.requestFocus();
        video.start();
    }
}
Also used : MediaController(android.widget.MediaController) File(java.io.File)

Example 19 with MediaController

use of android.widget.MediaController in project Signal-Android by WhisperSystems.

the class VideoPlayer method initializeVideoViewControls.

private void initializeVideoViewControls(@NonNull VideoView videoView) {
    MediaController mediaController = new MediaController(getContext());
    mediaController.setAnchorView(videoView);
    mediaController.setMediaPlayer(videoView);
    videoView.setMediaController(mediaController);
}
Also used : MediaController(android.widget.MediaController)

Example 20 with MediaController

use of android.widget.MediaController in project android_frameworks_base by ParanoidAndroid.

the class VideoDumpActivity method createView.

private View createView() {
    mVideoView = new VideoDumpView(this);
    mVideoView.setMediaController(new MediaController(context));
    LinearLayout mainLayout = new LinearLayout(this);
    mainLayout.addView(mVideoView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
    return mainLayout;
}
Also used : MediaController(android.widget.MediaController) LinearLayout(android.widget.LinearLayout)

Aggregations

MediaController (android.widget.MediaController)35 MediaPlayer (android.media.MediaPlayer)10 View (android.view.View)7 LinearLayout (android.widget.LinearLayout)6 VideoView (android.widget.VideoView)5 OnPreparedListener (android.media.MediaPlayer.OnPreparedListener)3 OnClickListener (android.view.View.OnClickListener)3 File (java.io.File)3 Intent (android.content.Intent)2 ActionBar (android.support.v7.app.ActionBar)2 KeyEvent (android.view.KeyEvent)2 Button (android.widget.Button)2 OCFile (com.owncloud.android.datamodel.OCFile)2 AccountNotFoundException (com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException)2 SharedPreferences (android.content.SharedPreferences)1 Uri (android.net.Uri)1 Nullable (android.support.annotation.Nullable)1 MotionEvent (android.view.MotionEvent)1 InputMethodManager (android.view.inputmethod.InputMethodManager)1 ProgressBar (android.widget.ProgressBar)1