mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-24 23:44:20 +01:00
clean up the mediaplayer at surface destroy, so its recreated
This commit is contained in:
parent
b1fcd36a0b
commit
301f14acdb
@ -218,11 +218,6 @@ public class VideoFragment extends ViewPagerFragment
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
initMediaPlayer();
|
||||
}
|
||||
|
||||
private void initMediaPlayer() {
|
||||
if (mMediaPlayer != null)
|
||||
return;
|
||||
@ -284,6 +279,11 @@ public class VideoFragment extends ViewPagerFragment
|
||||
mTimerHandler.removeCallbacksAndMessages(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceCreated(SurfaceHolder holder) {
|
||||
initMediaPlayer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
|
||||
|
||||
@ -291,7 +291,10 @@ public class VideoFragment extends ViewPagerFragment
|
||||
|
||||
@Override
|
||||
public void surfaceDestroyed(SurfaceHolder holder) {
|
||||
|
||||
if (mMediaPlayer != null) {
|
||||
mMediaPlayer.release();
|
||||
mMediaPlayer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user