ViewFlipper中的VideoView在播放视频时是透明的
我有一个 Activity,在 ViewFlipper 中设置了两个视图。其中一个视图是带有 GLSurfaceView 和一些其他小部件的布局,另一个视图只有带有 TextView 和 VideoView 的布局。当我单击 GLSurfaceView 中的某些内容时,ViewFlipper 会交换,以便可以播放视频。在此屏幕截图中,您可以看到普通的 GLSurfaceView 在左侧渲染地图。右侧是 ViewFlipper 翻转并且视频开始播放后的样子。
GLSurfaceView 显示的空白透明区域是视频应该所在的位置。我可以通过扬声器听到它正在播放,并且时间线正在向前移动,所以我知道它正在播放。
如果您需要,我可以发布代码,但是涉及很多内容,因此可能会变得相当复杂。
对于这里发生的事情有什么想法吗?
I've got an Activity with two views set up in a ViewFlipper. One of the views is a layout with a GLSurfaceView and a few other widgets, the other just has a layout with a TextView and a VideoView. When I click on something in the GLSurfaceView, the ViewFlipper swaps so the video can play. In this screenshot, you can see the plain GLSurfaceView rendering a map on the left. On the right is what it looks like after the ViewFlipper has flipped and the video starts playing.
The empty transparent area where the GLSurfaceView shows through is where the video is supposed to be. I can hear it playing through the speaker and the timeline is moving forward, so I know it's playing.
I can post code if you need it, but there's a lot involved so it could get rather complicated.
Any ideas as to what's going on here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在一个 Activity 中不能有两个重叠的 SurfaceView,我怀疑其中包括像 ViewFlipper 这样的情况,从技术上讲,它们不会由于可见性变化而重叠。
You cannot have two
SurfaceViews
in an activity that overlap, and I suspect that includes cases likeViewFlipper
where technically they would not overlap due to visibility changes.