ViewFlipper中的VideoView在播放视频时是透明的

发布于 2024-09-18 16:31:39 字数 459 浏览 6 评论 0原文

我有一个 Activity,在 ViewFlipper 中设置了两个视图。其中一个视图是带有 GLSurfaceView 和一些其他小部件的布局,另一个视图只有带有 TextView 和 VideoView 的布局。当我单击 GLSurfaceView 中的某些内容时,ViewFlipper 会交换,以便可以播放视频。在此屏幕截图中,您可以看到普通的 GLSurfaceView 在左侧渲染地图。右侧是 ViewFlipper 翻转并且视频开始播放后的样子。

Screenshot

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.

Screenshot

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昔日梦未散 2024-09-25 16:31:39

在一个 Activity 中不能有两个重叠的 SurfaceView,我怀疑其中包括像 ViewFlipper 这样的情况,从技术上讲,它们不会由于可见性变化而重叠。

You cannot have two SurfaceViews in an activity that overlap, and I suspect that includes cases like ViewFlipper where technically they would not overlap due to visibility changes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文