Using new Unity VideoPlayer and VideoClip API to play video

后端 未结 4 2244
栀梦
栀梦 2020-11-22 01:50

MovieTexture is finally deprecated after Unity 5.6.0b1 release and new API that plays video on both Desktop and Mobile devices is now released.

VideoPlayer and Video

4条回答
  •  后悔当初
    2020-11-22 02:24

    By now the VideoPlayer should be updated enough you don't need to write code to get to work correctly. Here are the settings I found to have the most desirable effect:

    These settings are:

    Video Player:

    • Play On Awake: True
    • Wait For First Frame: False
    • Audio Output Mode: None

    Audio Source:

    • Play On Awake: True

    Don't forget to have a VideoClip for the VideoPlayer and an AudioClip for the AudioSource. The file formats I found to work the best are .ogv for video and .wav for audio.

提交回复
热议问题