gpt4 book ai didi

Android - 在一个圆圈中显示 ExoPlayer

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:10:40 25 4
gpt4 key购买 nike

我试图在一个圆圈内显示一个 ExoPlayerView,覆盖另一个 ExoPlayer(画中画): enter image description here

我曾尝试将第二个播放器放在圆角框架内(this answerthis one),但播放器总是会脱离父框架并绘制视频的完整矩形。

我找到了 this solution它使用 GLSurfaceView,但是此解决方案使用经典的 MediaPlayer 而不是 ExoPlayer。

最佳答案

对于应该有圆角的那个,你可以在布局XML文件中这样设置:

app:surface_type="texture_view"

找到这个解决方案 here .

使用它的缺点主要是性能和电池使用(写成here):

Should I use SurfaceView or TextureView? SurfaceView has a number of benefits over TextureView for video playback:

Significantly lower power consumption on many devices. More accurate frame timing, resulting in smoother video playback. Support for secure output when playing DRM protected content. SurfaceView should therefore be preferred over TextureView where possible. TextureView should be used only if SurfaceView does not meet your needs. One example is where smooth animations or scrolling of the video surface is required prior to Android N (see How do I get smooth animation/scrolling of video?). For this case, it’s preferable to use TextureView only when SDK_INT is less than 24 (Android N) and SurfaceView otherwise.

关于Android - 在一个圆圈中显示 ExoPlayer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44055550/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com