VideoView 在 Popupwindow 中不可见?

发布于 2024-09-26 11:48:47 字数 821 浏览 2 评论 0原文

我的目标:我试图在点击屏幕上的某个项目时播放视频,同时仍停留在该屏幕上。

所以我求助于 PopupWindow 但不知何故 VideoView 没有显示在弹出窗口中。

我可以很好地显示弹出窗口,但 VideoView 不能(事实上,它不是不可见的,而是冻结了屏幕的该部分)。如果您查看第二个和第三个屏幕,您会发现不可见区域并不完全是矩形。那是因为我正在为弹出窗口设置动画。

我在另一个 Activity 中检查了 VideoView 本身,它播放得很好。我用 Nexus One 和 Galaxy S 进行了测试,两者显示的结果相同。

在 StackOverflow 上快速搜索显示了这个问题:android 视频,听到声音但没有视频 这导致 Android 无法播放视频 .mp4 两者都不适合我。

另外,正如您在第三个屏幕上看到的,MediaController 并不完全将自身附加到视频或弹出窗口,而是附加到 Activity。

这是屏幕,

Normal screen

"弹出"> control

My target: I am trying to play a video when tapping on one of the item on the screen while still staying on that screen.

So I resort to PopupWindow but somehow VideoView doesn't show up in the popup.

I can display popup just fine but the VideoView doesn't(in fact, it's not invisible but rather freeze that section of the screen). If you look at the second and third screen, you will see that the invisible area isn't exactly rectangular. That's because I am animating the popupwindow.

I checked the VideoView itself inside another Activity and it plays nicely. I tested this with Nexus One and Galaxy S, both display the same result.

Quick search on StackOverflow shows this question : android video, hear sound but no video
which leads to
Android not playing Video .mp4
and both doesn't work for me.

Also, as you can see on the third screen, the MediaController doesn't exactly attach itself to the video or popupwindow but the Activity instead.

Here's the screens,

Normal screen
Popup

control

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文