Exoplayer: How to play video full screen in landscape even though set screen potrait mode

Created on 15 Oct 2018  路  1Comment  路  Source: google/ExoPlayer

hi dear developer, I am looking way for play video in landscape mode like (youtube) when click expand to view in full screen even though current page is set up in portrait mode (set in manifest). Below here sample code that i get :

`((ViewGroup) mExoPlayerView.getParent()).removeView(mExoPlayerView);

    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    rowView = inflater.inflate(R.layout.bg_black_video, null);
    mFullScreenDialog.addContentView(rowView,
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    mFullScreenDialog.addContentView(mExoPlayerView,
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

    mFullScreenIcon.setImageDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.ic_fullscreen_skrink));
    mExoPlayerFullscreen = true;
    getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);`

For your information, I don't want to use dialog rather than to use root view. Please help me out to solve this problem.

question

Most helpful comment

The correct way to do this is to rotate the activity into landscape when the user presses the button. This is what YouTube does. You can find some information on how to do it here. Further questions about using that functionality should be sent to StackOverflow, since this is not ExoPlayer specific.

>All comments

The correct way to do this is to rotate the activity into landscape when the user presses the button. This is what YouTube does. You can find some information on how to do it here. Further questions about using that functionality should be sent to StackOverflow, since this is not ExoPlayer specific.

Was this page helpful?
0 / 5 - 0 ratings