* commit '3e3d973c48a5d13ac616b92e70c186c2c6eab128': 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 {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,6 +798,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);
|
||||
}
|
||||
|
||||
@@ -984,6 +985,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 {
|
||||
@@ -1028,6 +1031,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