Unity开发抖音小游戏播放视频

介绍

最近在做抖音小游戏播放视频,这里我使用的是Unity原生的VideoPlayer组件来播放视频,这里总结了一下我相关的报错以及能够正常播放视频的代码。如果还不知道怎么使用VideoPlayer的可以看我之前的文章

抖音小程序ios端视频无法播放RenderTexture问题

在做播放视频打包到抖音小程序时发现视频无法播放,并且显示报错

10:48:04.220 RenderTexture.Create failed: depth/stencilformat unsupported -D32 SFloat S8 UInt (94). There is nocompatible format on this platform or this fallback to acompatible format is disabled in the import inspector.
在这里插入图片描述
这个是个小问题,只要重新设置一下创建的RenderTexture格式就行,修改如下,我设置