0

any sugestion to make a VideoPlayer (for a HLS stream) who retain the buffer status on rotating the device? I was making a service always in background and handling the surface attach when rotating the device, but doesn't work. I loose the video (the audio still working) and get the error : E/MediaPlayer(28347): error (1, -2147483648) The videoView is in a fragment with setRetainInstance(true); enabled

Any idea? it's this idea possible?

Rodrigo Amaro Reveco
  • 4,932
  • 5
  • 22
  • 33

1 Answers1

1

The Aplication get newly created on rotate check methods like onStop onResume which get called in case of rotate.

Take care that you don't launch the service twice

Activity restart on rotation Android

Community
  • 1
  • 1
  • the problem isn't the service, the problem is changing the SurfaceHolder for the video on the fly. I can't deattach de surface when it's destroyed and set again when the service is connected and the surface is created. I tried pausing the video before call setDisplay(null) and play it again when y set the display (or surface). – Rodrigo Amaro Reveco Mar 01 '13 at 12:23