Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么清除videoview上面的图像 #97

Closed
BruceWind opened this issue May 10, 2016 · 7 comments
Closed

怎么清除videoview上面的图像 #97

BruceWind opened this issue May 10, 2016 · 7 comments

Comments

@BruceWind
Copy link

怎么清除videoview上面的图像 设置为黑屏

@Jhuster
Copy link
Contributor

Jhuster commented May 10, 2016

@weizongwei5 请问你想在什么时候清除?如果是 播放完毕后 再清除的话,暂时可以用如下方法,后面我们再完善:

mVideoView.stopPlayback(); 

Canvas canvas = mVideoView.getSurfaceView().getHolder().lockCanvas();

canvas.drawColor(Color.BLACK);

mVideoView.getSurfaceView().getHolder().unlockCanvasAndPost(canvas);

@BruceWind
Copy link
Author

谢谢

@Jhuster
Copy link
Contributor

Jhuster commented May 10, 2016

@weizongwei5 还有一种更加简单的方法,播放完毕后调用:

mVideoView.getSurfaceView().setBackgroundColor(Color.BLACK);

@BruceWind
Copy link
Author

非常非常!感谢 !

@BruceWind
Copy link
Author

设置背景色的方案 以前在ijk上面 好像设置了背景 视频播放都出不来了 就直接黑了

@Jhuster
Copy link
Contributor

Jhuster commented May 10, 2016

@weizongwei5 嗯,注意,我说的是播放完毕后可以暂时这样处理,播放前这样设置的话,需要再加一条语句就不会黑屏了:

mVideoView.getSurfaceView().setZOrderOnTop(true);

@yilylong
Copy link

如果是PLVideoTextureView 怎么设置清屏。遇到个问题 就是 在listview 里面添加PLVideoTextureView 播放 ,在点击不同item 播放的时候 因为listview的view重用机制所以PLVideoTextureView 是在重用的,出现了点击一个新item 的播放 会先闪现一下之前item 播放过的画面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants