I am unable to play a particular video file using the new VideoPlayer class. It plays fine in the Editor, but in standalone, I get a black screen and the errorReceived callback is sent with the following data.
I have confirmed that the clip is being assigned and videoPlayer.clip is not null, and is the same clip/file that the Editor is correctly playing. I am running this on Unity 5.6.0b4 in OS X 10.11.6, and the standalone is a Mac standalone on the same OS. I am going to try building for Windows next, and will update this post with the results when I do.
Any insight, or if anyone can report either seeing similar errors OR successfully testing VideoPlayer in a standalone, would be greatly appreciated.
I’ve posted the full stacktrace of the error message hoping it may provide some clues as to where to look. Line 13 here may be particularly helpful to any Unity devs looking at this.
videoPlayer.errorReceived += (source, message) => { Debug.Log("Video player error: "+message); };
// In the Player.log
Video player error: Can't play movie []
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
MoviePlayer:<Load>m__0(VideoPlayer, String) (at /Users/nothnagr/editorprototype/Assets/MoviePlayer/MoviePlayer.cs:137)
UnityEngine.Video.VideoPlayer:InvokeErrorReceivedCallback_Internal(VideoPlayer, String) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/modules/Video/VideoPlayerBindings.gen.cs:526)
UnityEngine.Video.VideoPlayer:INTERNAL_CALL_Play(VideoPlayer)
UnityEngine.Video.VideoPlayer:Play() (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/modules/Video/VideoPlayerBindings.gen.cs:211)
MoviePlayer:HandlePlayStop() (at /Users/nothnagr/editorprototype/Assets/MoviePlayer/MoviePlayer.cs:226)
MoviePlayer:update() (at /Users/nothnagr/editorprototype/Assets/MoviePlayer/MoviePlayer.cs:204)
AppisodePlayer:update() (at /Users/nothnagr/editorprototype/Assets/Scripts/Appisodes/AppisodePlayer.cs:94)
AppisodeManager:Update() (at /Users/nothnagr/editorprototype/Assets/Scripts/Appisodes/AppisodeManager.cs:102)