我知道可以在 ExoPlayer 中使用TextureView。但我找不到任何有关如何以正确的方式实现此功能的示例。你能帮我解决这个问题吗?
The PlayerView
有一个 xml 属性surface_type
让您选择是否要使用SurfaceView
or a TextureView
.
(Note: SimpleExoPlayerView
已更名为PlayerView
在最近的版本中,因为它仅取决于Player
界面,不再在 SimpleExoPlayerView 上。)
您可以选择texture_view、surface_view(默认)或无。看PlayerView JavaDoc 的主要部分 https://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/ui/PlayerView.html了解详情。
<com.google.android.exoplayer2.ui.PlayerView android:id="@+id/player_view"
app:surface_type="texture_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)