Search in sources :

Example 21 with MediaController

use of android.widget.MediaController in project qksms by moezbhatti.

the class SlideshowActivity method initMediaController.

private void initMediaController() {
    mMediaController = new MediaController(SlideshowActivity.this, false);
    mMediaController.setMediaPlayer(new SmilPlayerController(mSmilPlayer));
    mMediaController.setAnchorView(findViewById(R.id.slide_view));
    mMediaController.setPrevNextListeners(new OnClickListener() {

        public void onClick(View v) {
            mSmilPlayer.next();
        }
    }, new OnClickListener() {

        public void onClick(View v) {
            mSmilPlayer.prev();
        }
    });
}
Also used : MediaController(android.widget.MediaController) OnClickListener(android.view.View.OnClickListener) View(android.view.View)

Example 22 with MediaController

use of android.widget.MediaController in project platform_frameworks_base by android.

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)

Example 23 with MediaController

use of android.widget.MediaController in project XobotOS by xamarin.

the class HTML5VideoFullScreen method prepareForFullScreen.

private void prepareForFullScreen() {
    // So in full screen, we reset the MediaPlayer
    mPlayer.reset();
    setMediaController(new MediaController(mProxy.getContext()));
    mPlayer.setScreenOnWhilePlaying(true);
    prepareDataAndDisplayMode(mProxy);
}
Also used : MediaController(android.widget.MediaController)

Example 24 with MediaController

use of android.widget.MediaController in project wire-android by wireapp.

the class VideoPlayerFragment method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_video_player, container, false);
    headerContainer = ViewUtils.getView(view, R.id.rl__video_player__header);
    closeButton = ViewUtils.getView(view, R.id.gtv__video_player__close);
    closeButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (getControllerFactory() == null || getControllerFactory().isTornDown()) {
                return;
            }
            getControllerFactory().getSingleImageController().hideVideo();
        }
    });
    videoView = ViewUtils.getView(view, R.id.vv__video_view);
    videoView.setVideoURI((Uri) getArguments().getParcelable(ARG_VIDEO_URI));
    mediaController = new MediaController(getContext());
    mediaController.setMediaPlayer(videoView);
    videoView.setMediaController(mediaController);
    videoView.requestFocus();
    videoView.start();
    videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {

        @Override
        public void onCompletion(MediaPlayer mp) {
        }
    });
    videoView.setOnTouchListener(onTouchListener);
    view.setOnTouchListener(onTouchListener);
    mediaController.show(0);
    return view;
}
Also used : MediaController(android.widget.MediaController) View(android.view.View) VideoView(android.widget.VideoView) MediaPlayer(android.media.MediaPlayer) Nullable(android.support.annotation.Nullable)

Example 25 with MediaController

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

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