Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to continue rtsp video play while orientation change in android
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/11629556/how-to-continue-video-play-while-orientation-change-in-android">How to continue video play while orientation change in android</a> </p> </blockquote> <p>I'm just playing an rtsp video on android default player.Halfly, when i change orientation into landscape,it starts streaming from beginning.How could i do continue playing.I gave androidconfig="orientation" on manifest file.But still happens same.What else i need to do for that?</p> <p>My code:</p> <p>private String vSource="http://commonsware.com/misc/test2.3gp";</p> <pre><code>/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { // sets the Bundle super.onCreate(savedInstanceState); // sets the context setContentView(R.layout.main); myVideoView= (VideoView)findViewById(R.id.vview); myVideoView.setVideoURI(Uri.parse(vSource)); myVideoView.setMediaController(new MediaController(this)); myVideoView.requestFocus(); myVideoView.start(); } public void onSaveInstanceState(Bundle outState){ mStartTime = myVideoView.getCurrentPosition(); outState.putInt("restartTime", mStartTime); super.onSaveInstanceState(outState); } @Override public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); myInt = savedInstanceState.getInt("restartTime"); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); myVideoView.seekTo(myInt); myVideoView.start(); } </code></pre> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload