检索并播放本地存储在Android VR耳机上的视频文件(Oculus Quest) [英] Retrieving and playing a video file stored locally on an android VR headset (Oculus Quest)
问题描述
我正在制作一些原型,这些原型需要我播放来自统一应用程序(10gb +)的大型视频文件.这些是将在医院环境中播放的360部视频,因此,我很难像现在一样简单地将这些视频上传到服务器并进行流式传输.医院不允许此类下载,并且连接不够有效.
I am in the midst of making some prototypes that require me to play large video files from a unity application (10gb+). These are 360 videos that will be played in a hospital environment and therefore I am hard pressed to simply upload these videos to a server as I am doing now and streaming them. The Hospital does not allow downloads like these and the connection is not good enough to stream it effectively.
我对此的解决方案是手动将视频添加到头戴式耳机,然后通过按代码获取视频(如我所知)将它们从统一应用程序中简单地播放. las,我似乎无法正常工作.
My solution to this is to add the videos to the headset manually and then simply play them from the unity application by fetching them by code as I will know where they are stored. Alas, I cannot seem to get this to work.
我曾尝试将视频放入流媒体资产文件夹中,但尝试此操作时甚至无法建立统一性,因为我遇到了Java堆空间问题,我还向Android清单添加了权限,因此它应具有获取视频的权限.
I have attempted to put the videos in the streaming assets folder but unity cannot even build when trying this as I get java heap space problems I have furthermore added the permissions to the Android manifest so it should have permission to fetch the video.
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
我想知道是否有人对这种事情有经验,可以很好地阐明如何将视频文件本地放置在头戴式耳机中(很可能在com中.
I am wondering if there is anyone that has experience with this sort of thing that would kindly shed some light on how to go about placing a video file locally in the headset (most likely in the com.< companyname>.< applicationname> folder or "persistent path" ) and then playing it from script or from the videoplayer Url/Path.
非常感谢. Unity 2019.2 0b1
thanks kindly. Unity 2019.2 0b1
推荐答案
将视频置于StreamingAssets中对于某些文件大小在Android上不起作用.因此,我对Oculus Go MediaPlayer所做的就是将所有视频放入耳机的文件夹中,然后使用绝对路径加载它们. 在Unity中,您可以像这样获取android的rootpath:
Having your Videos in StreamingAssets won't work for certain file sizes on Android. So what I do with my Oculus Go MediaPlayer is to put all Videos into a folder on my Headset and then load them with an absolute path. In Unity you can fetch the android rootpath like this:
rootPath = Application.persistentDataPath.Substring(0, Application.persistentDataPath.IndexOf("Android", StringComparison.Ordinal));
然后从那里添加您自己创建的文件夹的路径,例如:
And from there on just add the path of your own created folder, for example like this:
string path = Path.Combine(Path.Combine(rootPath, "ExampleFolder/ExampleSubdirectory"), FileName);
这篇关于检索并播放本地存储在Android VR耳机上的视频文件(Oculus Quest)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!