Flutter video_player无法播放保存到应用程序目录中的视频 [英] Flutter video_player not playing video saved to application directory

查看:80
本文介绍了Flutter video_player无法播放保存到应用程序目录中的视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新: 我已经确认文件在那里并且可以正常工作,只是不使用video_player.它只是从不初始化,当我从xcode调试时,它不会抛出错误. 我正在使用image_picker插件,并对其进行了修改以选择视频.最初选择视频并在video_player中播放时,所有功能都可以正常工作.现在所有功能都可以在iOS上使用.但是我base64编码视频,并通过JSON发送到服务器.如果我在服务器上解码并通过http播放视频,则一切正常,但是客户端希望将视频同步到设备以供离线观看.当我从服务器获取JSON并将其解码并保存到应用程序目录"时,一切正常,但是video_player将不会播放视频,甚至不会初始化视频.我缺少与iOS相关的东西才能使它正常工作吗?任何帮助将不胜感激.

UPDATE: I have confirmed the file is there and works, just not using the video_player. It just never initializes and when I debug from xcode, it does not throw and errors. I am using the image_picker plugin and have modified it to pick videos as well. All works fine on initial selection of video and playing int he video_player. All work on iOS right now. However I base64 encode the video and send to server via JSON. If I decode on server and play the video via http all works fine, however client wants then videos to be synced to device for offline viewing. When I take the JSON from the server and decode and save to the Applications Directory all works fine, however video_player will not play the video, it will not even initialize the video. Is there something I am missing as it relates to iOS to get this to work? Any help would be greatly appreciated.

推荐答案

我的_controller.value.intialize为false或来自缓存的本地视频,但对于网络视频为true,并且在iOS上可以正常工作

my _controller.value.intialize is false or local video from cache but for network video is true and working fine on iOS

使用具有XFile类型的最新版本并分配自动路径,我们不必管理和加入..太糟糕了,文档中没有提到

edit: use the recent version with the XFile type and it assign path automatically we don't have to manage and join .. too bad it isn't mentioned in the docs

这篇关于Flutter video_player无法播放保存到应用程序目录中的视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆