Unity播放视频(pc,android,ios)
在unity可以播放动画,播放音频,当然也可以播放视频啦~~~目前主要支持mov, .mpg, .mpeg, .mp4, .avi, .asf格式
首先,我们需要安装QuickTime播放器
然后,在unity3D中加载视频
看下面脚本用来渲染视频:
desc
Plays a full-screen movie. Note that player will stream movie directly
描述:播放一个全屏视频,但是请注意播放器将会直接读取视频流。
the device storage, therefore you have to provide movie as a separate files and not as a usual asset. You will have to create a folder named StreamingAssets inside your Unity project (inside your Assets folder). Store your movies inside that folder. Unity will automatically copy contents of that folder into the application bundle.
视频存储在设备上,因此,你必须把视频放到一个单独的文件夹作为一个普通的资源,因此你要在Assets文件夹下创建一个名为StreamingAssets的文件夹存储你的视频,Unity 会自动复制文件夹下的内容到应用程序包。
以上是官方网站的描述,经测试可以用. 呵呵