Using new Unity VideoPlayer and VideoClip API to play video

后端 未结 4 2232
栀梦
栀梦 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:19

    I used @Programmer 's answer to play videos from a URL, but I couldn't get any sound to play. Eventually I found the answer in the comments of a YouTube tutorial.

    To get the audio to play for a movie loaded via URL, you need to add the following line before the call to EnableAudioTrack:

    videoPlayer.controlledAudioTrackCount = 1;
    

提交回复
热议问题