VideoView 在 GLSurfaceView 上显示?
最近,我在做android开发,有一个问题一直困扰了我很长一段时间。我想在GLSurfaceView上显示VideoView,我的代码如下:
setContentView(glSurfaceView,new LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
videoView= View.inflate(QCARSampleActivity.this, R.layout.main, null);
addContentView(videoView, new LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
mVideoView = (VideoView) overlayView.findViewById(R.id.mVideoView);
播放视频的代码如下:
videoView.setVisibility(View.VISIBLE);
mVideoView.setVisibility(View.VISIBLE);
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.start();
当我运行它时,正常,但是只能听到声音,看不到视频,为什么?请?
recently,I'm doing android development,there have been a question that always confused me for a long time.I want to show VideoView on GLSurfaceView, my code is as following:
setContentView(glSurfaceView,new LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
videoView= View.inflate(QCARSampleActivity.this, R.layout.main, null);
addContentView(videoView, new LayoutParams( LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
mVideoView = (VideoView) overlayView.findViewById(R.id.mVideoView);
code of playing video is as following:
videoView.setVisibility(View.VISIBLE);
mVideoView.setVisibility(View.VISIBLE);
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.start();
when I run it,it works ok,but only hear sound,can't see video,why? please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Try This: