Flutter video_player 插件 - 在 VideoPlayerController 初始化后更改 ClosedCaptionFile
我在 Flutter 应用程序中使用 video_player 插件,当我想添加字幕文件时,我必须为 VideoPlayerController 的初始化方法指定一个 Future。而且在控制器初始化后我找不到任何方法来更改标题。但我尝试了一种方法,我在 video_player 源代码中添加了一个名为 setClosedCaptionFile 的方法,并且它正在工作。但我想知道是否有其他(正确的)方法来更改字幕文件?
I am using video_player plugin in my Flutter app and when I want to add a caption file I have to specifice a Future to the initialize method of VideoPlayerController. And I cannot find any way to change captions after the controller is initialized. But I have tried a way, I have added a method called setClosedCaptionFile in video_player source code and it is working. But I am wondering is there any other(correct) way to change the caption file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将插件更新到最新版本,他们在上次更新 2.4.0 中添加了
setClosedCaptionFile
检查一下 这里
update the plugin to the latest version, they added
setClosedCaptionFile
in the last update 2.4.0check it here
要添加奥马尔答案,您还可以使用 VideoPlayerController 的
linedCaptionFile
属性直接使用 CaptionFile 初始化控制器:To add on omar answer you can also directly initialize the controller with the CaptionFile with the
closedCaptionFile
property of VideoPlayerController: