我使用带有MediaPlayer
的TextureView
作为ListView
中的一个元素。当用户向下/向上滚动,视频从屏幕上消失时,我想继续在某个地方播放它,比如说右下角。我使用的是相同的TextureView
,只是从列表项中提取出来并添加到主布局。MediaPlayer
也是一样的。这样TextureView
就会被销毁并重新创建。
问题是-当我将surface设置为player时,滚动在半秒内冻结。感谢您的帮助。
我的onSurfaceTextureAvailable
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width,
int height) {
Surface s = new Surface(surface);
mPlayer.setSurface(s);
}
发布于 2015-09-19 15:49:07
MediaPlayer应用程序接口在某些设备上速度较慢,您不应该根据自己的情况使用它。
你应该改用Ijkplayer (IjkPlayer)。
https://stackoverflow.com/questions/29631294
复制相似问题