-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is the Unity Video Player not working? #77
Comments
Check whether there is an error console. |
Thanks for replying soon. But I didn't see any error in my console. P.S. I tested it on Android. |
My project is based on the demo repo as well and i have worked with the default Unity video components without any problems. Does the video work if you export it as „stand-alone“ XCode / Android Project through the default Build Settings? |
@JanOwiesniak thanks for your reply. I have tried many video types, including WebM, MP4, and MOV. All videos I've tried were played successfully when I exported my Unity project alone with default settings and built it through Android Studio. But only two videos were played successfully when I built the Unity project as AAR, and imported it to my Android Studio project, or used react-native-unity-view. One of the successful video format and codec is MOV and H.264 High, and the other one is WebM and VP8. But the weird thing is I have these two formats and codecs in those fail videos too. That very confuses me, maybe Unity project has different video support rule when it used as a Library? |
Hm, i tested the default packages only with mp4 files and had no problems. Recently i switched to this package which offers support for many different file formats out of the box and is highly configurable. You could give it a try. |
Finally, I fixed this problem by add aaptOptions in my build.gradle
And I found a note in Unity docs
that may be related to this problem, but still can't answer me why some videos can be played, and others can't. @JanOwiesniak I've tried the AVPro Video package, which is very powerful. I will use it if I need more video features. Thanks for your help. |
I need to use Vuforia to play a video when I found a specific target. And my implement way was attaching VideoPlayer to a Plane object.
But for now, the Plane attached by VideoPlayer is always a blank, nothing showed.
I alos tried to use the normal Unity project to implement the VideoPlayer, but it is still showing blank.
However, it works if I use Unity to build and run apk ,not by react-native .
Does anyone have this problem before?
I will be grateful for any help you can provide. Thank you!
The text was updated successfully, but these errors were encountered: