如何在 Android 上的 GLSurfaceView 上播放视频?

发布于 2024-10-01 10:36:27 字数 141 浏览 0 评论 0原文

我从 ApiDeoms 添加了一个 SurfaceView 到 Cube 演示中。 并尝试使用 MediaPlayer 来播放它。 但它因低级播放器错误而失败,该错误在不同设备上有所不同。 是否可以在 GLSurfaceView 上播放视频,或者这完全取决于硬件支持?

I added a SurfaceView into the Cube demo from the ApiDeoms.
And tried to use a MediaPlayer to play with it.
But it failed with low-level player error which is different on different devices.
Is it possible to play videos on a GLSurfaceView or it's all about hardware support?

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

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

发布评论

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

评论(2

无可置疑 2024-10-08 10:36:27

说“如果在设备上失败,则该设备不支持它”。考虑到您向处于演示级别的人提供建议,并且可能不知道这些留言板中充斥着那些“回答”问题而不知道他们在说什么的人,这是相当不负责任的。

这个问题的简短回答

您可能会遇到数百种不同的错误,但是对于“是否可以在 GLSurfaceView 上播放视频”

就是“是的”。如果您的设备兼容 OpenGL(如果它是近十年生产的,那么这是一个安全的选择),那么您可以用它以某种形式显示视频。如果您想要更丰富的答案,那么您将必须提供更多信息,至少准确说明错误是什么,最好是一些 logcat 输出。

To say "If it failed on a device, the device does not support it." is pretty irresponsible considering you're giving advice to people who are at the demo level and might not know how infested these message boards are with people who "answer" questions without having a clue what they are talking about.

There are hundreds of different errors that you could be experiencing, however the short answer to the question:

"Is it possible to play videos on a GLSurfaceView"

would simply be "yes it is". If your device is OpenGL compliant (pretty much if it was built this decade then that's a safe bet), then you can display video in some form or another with it. If you want a more informative answer however you're going to have to provide quite a bit more information, at the very least exactly what the errors are and ideally some logcat output.

子栖 2024-10-08 10:36:27

我发现这取决于本机解码器支持。
如果在设备上失败,则该设备不支持它。

I found out that depends on native decoder support.
If it failed on a device, the device does not support it.

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