am 184f79db: Support7Demo: fix video playback on GB
* commit '184f79db44846b492e2b8b3785b5b62df1f22479': Support7Demo: fix video playback on GB
This commit is contained in:
@@ -226,7 +226,7 @@ public class MediaPlayerWrapper implements
|
||||
});
|
||||
}
|
||||
|
||||
private void reset() {
|
||||
public void reset() {
|
||||
if (mMediaPlayer != null) {
|
||||
mMediaPlayer.stop();
|
||||
mMediaPlayer.release();
|
||||
|
||||
@@ -145,7 +145,9 @@ public abstract class OverlayDisplayWindow {
|
||||
mWindowManager.addView(mSurfaceView, params);
|
||||
mWindowVisible = true;
|
||||
|
||||
mListener.onWindowCreated(mSurfaceView.getHolder());
|
||||
SurfaceHolder holder = mSurfaceView.getHolder();
|
||||
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
|
||||
mListener.onWindowCreated(holder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -458,4 +460,4 @@ public abstract class OverlayDisplayWindow {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,6 +794,7 @@ public class SampleMediaRouterActivity extends ActionBarActivity {
|
||||
mLayout = (FrameLayout)findViewById(R.id.player);
|
||||
mSurfaceView = (SurfaceView)findViewById(R.id.surface_view);
|
||||
SurfaceHolder holder = mSurfaceView.getHolder();
|
||||
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
|
||||
holder.addCallback(mLocalPlayer);
|
||||
}
|
||||
|
||||
@@ -980,6 +981,8 @@ public class SampleMediaRouterActivity extends ActionBarActivity {
|
||||
|
||||
if (mPresentation != null || route.supportsControlCategory(
|
||||
MediaControlIntent.CATEGORY_REMOTE_PLAYBACK)) {
|
||||
mMediaPlayer.setSurface((SurfaceHolder)null);
|
||||
mMediaPlayer.reset();
|
||||
mSurfaceView.setVisibility(View.GONE);
|
||||
mLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
@@ -1024,6 +1027,7 @@ public class SampleMediaRouterActivity extends ActionBarActivity {
|
||||
// Set up the surface view.
|
||||
mPresentationSurfaceView = (SurfaceView)findViewById(R.id.surface_view);
|
||||
SurfaceHolder holder = mPresentationSurfaceView.getHolder();
|
||||
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
|
||||
holder.addCallback(mLocalPlayer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user