Search in sources :

Example 1 with VideoSurfaceView

use of com.google.android.exoplayer.VideoSurfaceView in project edx-app-android by edx.

the class PlayerDemoActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mainHandler = new Handler(getMainLooper());
    builder = getRendererBuilder();
    setContentView(R.layout.activity_player_demo);
    ViewGroup root = (ViewGroup) findViewById(R.id.root);
    root.setOnTouchListener(new OnTouchListener() {

        @Override
        public boolean onTouch(View arg0, MotionEvent arg1) {
            if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
                toggleControlsVisibility();
            }
            arg0.performClick();
            return true;
        }
    });
    mediaController = new EPlayerController(this);
    mediaController.setAnchorView(root);
    shutterView = findViewById(R.id.shutter);
    surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
    surfaceView.getHolder().addCallback(this);
}
Also used : OnTouchListener(android.view.View.OnTouchListener) ViewGroup(android.view.ViewGroup) Handler(android.os.Handler) View(android.view.View) VideoSurfaceView(com.google.android.exoplayer.VideoSurfaceView) MotionEvent(android.view.MotionEvent)

Aggregations

Handler (android.os.Handler)1 MotionEvent (android.view.MotionEvent)1 View (android.view.View)1 OnTouchListener (android.view.View.OnTouchListener)1 ViewGroup (android.view.ViewGroup)1 VideoSurfaceView (com.google.android.exoplayer.VideoSurfaceView)1