Android: video player like Dailymotion app

I want to create a video player, for example, an application for dailymotion. The main thing I want to achieve is the rotation behavior and the action of the button in full screen mode. When the user rotates the device or presses the full-screen button, the video player enters full-screen mode, and video playback continues without any glitches.

I am currently using a video stream widget for streaming video. but when the user rotates the device. restarting the video and viewing the video activity and watching the video are activated again, and then the videos are played.

Therefore, please suggest me to solve this problem. Thanks in advance.

+5
source share
2 answers

When registering your activity in the manifest file, you can use the flags below

android:configChanges="orientation|screenSize|keyboardHidden" 

and then in your activty class, just override the onConfigurationsChanged () method so that your activity does not restart when the orientation changes.

One thing you can try is to save the current position of the video in "onConfigurationChanged ()" so that after rotation, when the VideoView has reinitialized itself, you can continue to play the video from that position.

0
source

ues ExoPlayer as a base class and extends it as its own custom player. these issues are addressed here. This is available on the official Android developer site.

http://developer.android.com/guide/topics/media/exoplayer.html

0
source

All Articles