Android: Video Player Like Dailymotion App

602 views Asked by At

I want to develop video player like dailymotion app. The main thing that i want to achieve is it's rotation behaviour and full screen button action. When user rotate device or tap on full screen button the video player goes to full screen and video play continue without any intruption.

Currently i am using video view widget for Stream video. but when user rotate device. the video stop and video view activity reload and video view intilize again and then video play.

So please suggest me solution of this problem. Thanks in advance.

2

There are 2 answers

0
muak On

You can use below flags when registering your activity in manifest file

 android:configChanges="orientation|screenSize|keyboardHidden"

and then in you activty class just override "onConfigurationsChanged()" method so that your activity won't restart when orientation changes.

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

0
Jivraj S Shekhawat On

ues ExoPlayer as base class and extend it as your own Custom Player. these issues are handled here. this is available on official android developer site

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