如何在Swiftui中显示字幕?

发布于 2025-01-23 23:39:15 字数 390 浏览 2 评论 0 原文

我想在avplayer中显示字幕,但是在我的代码中,一切都在起作用(视频& audio),但是字幕没有显示

我尝试了此答案:

70938118/17927980“> https://stackoverflow.com/a/70938118/17927980

但是我的播放器无法显示字幕,我该如何解决?

是否只能使用Avplayer或否显示字幕?

I want to display subtitle in AVPlayer, but on my code everything is working(video & audio) but subtitle not showing

I tried this answers:

https://stackoverflow.com/a/70938118/17927980

https://stackoverflow.com/a/56251439/17927980

But my player can't display subtitle , how can i fix that?

Is it possible to display subtitle only with AVPlayer or no?

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

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

发布评论

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

评论(1

櫻之舞 2025-01-30 23:39:15

您从正确的URL中获得字幕吗?
然后,您需要将URL包含在WebVTT字幕中。

自从我上次与Avplayer一起流式传输内容以来已经很长时间了,但是Apple提供了一个出色的示例页面。

https://developer.apple.apple.apple.com/streaming/

you get your subtitles from an url correct?
Then you need to include the URL to your webVTT subtitles.

It's been a long time since i last take a look at streaming things with AVPLayer, but apple provides an excellent example page for streaming.

https://developer.apple.com/streaming/

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