I try to show the show video (.mp4) with exoplayer in RecyclerView and ViewPager. I show the video controller with custom layout. so far so good.
Now try to fullscreen the video like other video player how use before but can't find a good way in the exoplayer doc.
can anyone help me?
Exoplayer doesn't provide the fullscreen so here is the workaround that worked for me. Here I have restricted the Screen to rotate and manually changing the orientation programmatically change the width and height of the player_view and has set the visibility of the toolbar gone. Used Data Binding and Kotlin.
Follows a code block for XML
Changes in Android Manifest
Check the orientation and rotate it via the following code
Methods Signature are following
Now Just Override onConfigurationChanged method in your fragment/activity, since here I have used Fragment. So here I have changed the width/height of the parent container in which ExoplayerView is placed.
Lastly, XML for the player_controller
Let me know if this works.
This might be too late but this might help other developers.
Exoplayer doesn't provide the fullscreen functionality by-default. So we need a workaround for this. We can implement this fullscreen functionality using a dialog. We just need to remove and add the Playerview from our activity to the dialog.
Here we initialized the dialog.
Here we initialized the fullscreen button of out exoplayer.
playerview is the Playerview that you will initialize for
and in java,