I have a couple .mp4
videos which play fine on Standalone when loading them from Resources Folder via Resources.Load<MovieTexture>("videoname")
.
They also play fine on Mobile when loading from StreamingAssets folder via Handheld.PlayFullScreenMovie("videoname.ext")
.
Mobile does not support MovieTexture
and Standalone does not support Handheld
.
So in Order for this to work on Standalone and Mobile, I would need to duplicate the video files which would result in having the same video files in both folders (Resources and StreamingAssets). This is redundant and I would like to avoid this.
Is there a simple solution for that? Can you somehow merge those folders or similar? Or maybe I can specify to ommit one or another folder when deploying for a certain platform?
I know you can not Resources.Load
from StreamingAssets and you can not Handheld.PlayFullScreenMovie
from Resources (one of both would solve this problem). I also know about loading videos from StreamingAssets via WWW
class, but this only supports .ogv
which in return is not supported by mobile.
Cheers,
phineliner
P.S.: I know that there are Plugins like AVPro, but I’m a student and this is a university project, so I don’t want to spend 200 bucks for a plugin
edit:
In case I have the files duplicated (distributed to the two folders), I can not build for Mobile anymore: 'MovieTexture' is not supported when building for Android.
. It’s giving me this error because I have the imported video file inside of the Resources folder. Can I somehow tell to ignore the videos of the resources folder while deploying for mobile? They aren’t used in that case either… In code I can use #if UNITY_ANDROID
to hide code containing MovieTexture
, but how can I do this in the editor itself?
I can avoid this by using WWW
and load an .ogv
video from StreamingAssets, but this would also mean that I need two files for the same video (one .mp4
and one .ogv
).