Download video as bytes

Hi

I’m using vuforia to make an application with augmented reality. I need to make a cloud recognition an download a video according to the detected marker.
The problems:
I can’t include a video file into a bundleasset so I put it apart and tried to downloaded with the www class method
I downloaded the video but I can’t put it in the stremingasset directory. This is the code I have now to download the video an put it in the correct place

www = WWW.LoadFromCacheOrDownload(bundleURL, version);
yield return www;
print("Is Done: " + www.isDone);
System.IO.File.WriteAllBytes(Application.streamingAssetsPath + "/video.ogg",www.bytes);

and I get this error

WWWCached data can only be accessed using the assetBundle property!
UnityEngine.WWW:get_bytes()

why www.bytes doesn’t return the bytes?
is there another way to do what I want to do?

Please help

Thank you

I solve the problem changing

www = WWW.LoadFromCacheOrDownload(bundleURL, version);

for

www = new WWW(bundleURL);

but now I got the next error

UnauthorizedAccessException: Access to the path “/var/mobile/Applications/XXXX-XXXXX-XXX/Test.app/Data/Raw/video.ogg” is denied.
at System.IO.FileStream…ctor

how can I get acces to the folder???

Thanks

prioshi - I’m in exactly the same place, including making the same mistake of using LoadFromCacheOrDownload at first before realizing this was strictly for asset bundles. Then I realized that the StreamingAssets directory is always read only (at least on iOS, I think on all platforms).

If I have everything correct, then the only solution is to get the Vuforia video plug-in to accept videos stored at Application.persistentDataPath - which I don’t think it currently does. I’ve posted about it on the Vuforia forums, but I’m pessimistic. Let me know if you’ve made more progress than I have. Thanks.

Aha, there’s an answer on the Vuforia forum, you can edit where the Videoplayback plug-in looks for the video files by hacking VideoPlayerHelper.cs: Getting Started | Vuforia Library

I changed the path of the file and I also put the file in Application.persistentDataPath now I can hear the audio but I don’t see any video. I think I’m geting closer but I don’t know what else can I do.