在 android 原生上调用 mediaPlayer.stop() 时 flutter_vlc_player 滞后

发布于 2025-01-20 02:13:44 字数 352 浏览 3 评论 0原文

我正在使用 flutter_vlc_player 在 Android 和 ios 上播放视频。

当我处置播放器控制器时,它会导致几帧卡顿。 当我调试本机 Android 代码时,我发现 void dispose() 中的 mediaPlayer.stop() 花费了大约 40 毫秒才能完成,导致卡顿。我在 PageView 中使用了播放器,并将控制器放置在页面转换的中间,因此卡顿很明显。

有没有解决方案或解决方法可以使用户界面看起来流畅?

I'm using flutter_vlc_player for video playback on Android and ios.

When I dispose the player controller, it cause jank for a few frames.
When I debug the native android code, I see that mediaPlayer.stop() in void dispose() took about 40ms to complete, causing the jank. I used the player inside PageView and dispose the controller in the middle of page transition, so the jank is noticeable.

Is there a solution or workaround to make the ui look smooth?

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

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

发布评论

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