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

如何做到视频在两个viewgroup中切换,但是不闪一下 #4

Open
songwenxuan opened this issue Jul 6, 2017 · 2 comments
Open

Comments

@songwenxuan
Copy link

大神你好,应用场景是这样的,一个recyclerview中的一个item在播视频,然后我需要将这个播视频的view添加到其他的viewgruop中去,但是在removeview的时候texureview会destory然后再重新avaliable,这样会导致视频黑一下,有没有办法可以解决黑一下的问题?

@Dawish
Copy link
Owner

Dawish commented Jul 6, 2017

在remove之前可以设置播放器setVisibility(INVISIBLE)不可见,在重新avaliable后再设置播放器setVisibility(VISIBLE)可见,就算是闪烁也是看不见的,希望对你有帮助!

@songwenxuan
Copy link
Author

多谢,已经找到不闪的办法了。在textureview的avaliable的时候保存一个surfacetexure,在destory的时候判断一下保存的surfacetexture是不是null,如果不是null返回true,再一次avaliable的时候setSurfaceTexure一下保存的的surfacetexure就可以了。

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

2 participants