/* 2020.1.2
* 遇到问题: ①不能录像 ②HoloLens中的视频不能播放出来
* 关于播放视频的问题:
* 在文件夹寻找、转化等,全部可以成功,但是不能播放。
string filename = "v.mp4";
string filepath = videoFolderPath + "/yu/" + filename;
//string path = System.IO.Path.Combine(Application.persistentDataPath, file);
print("路径为:" + filepath);
print("系统查看app文件的路径" + Application.persistentDataPath);
if (File.Exists(filepath))
{
print("播放视频...");
VideoImage.url = "file:///" + filepath; //获取文件的地址,URL指示资源的位置以及用于访问它的协议
VideoImage.Play();
}
运行时vs报错:
* WindowsVideoMedia error 0x80070005 while reading C:\Data\Users\zhoud\Pictures/yu/v1.mp4
* Context: MFCreateSourceReaderFromURL
* Error details: Access is denied.
*
* 2020.1.2 代码计划:
* (开始做录制视频的部分,保存到 Application.persistentDataPath)
* 1.读懂Hololens-Capture-Play-Photo中的录像的代码。 √
* 2.在自己代码中完成录像功能、保存到Application.persistentDataPath路径下。√
* 3.再改转存路径即可 或者 谷歌寻找到 Application.persistentDataPath √(最终找到该路径 HoloLens的IP中)
* 2020.1.3 11:00am
* 已经完成录像功能,但是保存和读取的是 Application.persistentDataPath 下的视频
* 2020.1.3 14:30pm
* 思路: 1.改路径到yu (可以完美保存,但是查看的问题,同上!)
* 2.找Application.persistentDataPath路径 已经找到路径!!
*
*/
Application.persistentDataPath路径
录制视频方法中的路径代码:
访问视频方法中的代码: