Skip to content

Commit

Permalink
Merge pull request #9 from m-kubis/surface_destroyed_handling
Browse files Browse the repository at this point in the history
Fix for a re-initialization issue on surface destruction.
  • Loading branch information
mklimek committed Jun 6, 2016
2 parents 9effc9f + 795e08f commit 316b4e3
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int h

@Override
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) {
LOG.trace("onSurfaceTextureDestroyed");
removeVideo();
return false;
}

Expand Down Expand Up @@ -125,8 +127,7 @@ public void onResume() {

@Override
public void onPause() {
placeholderView.setVisibility(View.VISIBLE);
release();
removeVideo();
}

private void release() {
Expand All @@ -139,6 +140,11 @@ private void release() {
startInPrepare = false;
}

private void removeVideo(){
placeholderView.setVisibility(View.VISIBLE);
release();
}

@Override
public void setFrameVideoViewListener(FrameVideoViewListener listener) {
this.listener = listener;
Expand Down

0 comments on commit 316b4e3

Please sign in to comment.