Android mediaplayer with surfaceholder change
i couldn't find any clue as to how to fix this problems so i hope you can
assist.
I have a service with a mediaplayer on it, the mediaplayer is loaded with
a url to stream a video from and prepares it. I have an activity that
binds to the above service, sets display for the surface view using the
surfaceholder and then starts the mediaplayer.
All is working great the first time, the problem occurs when i quit the
activity and start it again - the previous surface is destroyed and a new
one is created on the current creation of the activity. the mediaplayer
dosen't change the surfaceholder to the new one. at least its what i think
is happening since i see in watch that the mSurfaceHolder of the
mediaPlayer has in fact changed yet the screen is black and the
mediaplayer is playing (seen in logcat).
i have also tried setDisplay(null) on surfacedestroy, yet again this dont
seem to work. any ideas or suggestions? i really dont want to reset the
mediaplayer because then i will have to buffer the video again when it is
already fully loaded
Thanks!
No comments:
Post a Comment