- Home /
VideoPlayer ios StreamingAssets black render
Hey there,
I'm having some issue to play a video on an iPhone 6 (u2019.3.5f1)
I'm using that method : https://docs.unity3d.com/ScriptReference/Application-streamingAssetsPath.html
The video is a mp4 video file, provided using StreamingAssets datapath to the url property of the VideoPlayer.
Video: MPEG4 Video (H264) 1280x720 25fps 1851kbps [V: h264 main L3.1, yuv420p, 1280x720, 1851 kb/s]
Audio: AAC 48000Hz stereo 2kbps [A: Stereo [eng] (aac lc, 48000 Hz, stereo, 2 kb/s)]
The video plays (time is progressing, isPrepared is true, length is coherent, callbacks are called) but it's a black square on the screen.
It works fine in the editor. It shows a black screen only on the device.
Any insight ?
Thanks for the help !
EDIT
Documentation suggests that ios need to use SDK 11+ for H265 support. I tried to change is and rebuild and it works. But then how do you support older devices ?
( Note that my video file is H264, it was just a test )
Answer by ABerlemont · Apr 29, 2020 at 06:00 PM
It seems that my issue was linked to :
the use of a UnityEngine.UI Image.
the use (on that component) of an Unlit shadered material.
the use of a render texture setup on that material (VideoPlayer is setup to write in that render texture).
You need to use RawImage to handle render textures properly when using UI.
(This works even when player settings are setup for iOS 10.0)
Your answer
Follow this Question
Related Questions
Playing a fullscreen movie in iOS without Pro version 1 Answer
Best Paying Interstitial Video Ads with Unity Bindings 1 Answer
Occasional black screen and lock up when using Handheld.PlayFullScreenMovie 1 Answer
HTTP Live Streaming from Kii Cloud Storage? 1 Answer
Access Native Video files from Unity on Android / iOS 0 Answers