-
Notifications
You must be signed in to change notification settings - Fork 28
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
Failed to create player #37
Comments
Hello! I'm facing the exact same issue. If I close the app with Application.Quit(); during the video play, then I can re open it with no problem. If I close the app after the video finishes playing, then I got the message: "[AVProVideo] Failed to create player instance". |
We've just released a new version of AVPro Video (v.1.9.17) which should fix this issue. Please do test it and let us know if if this resolves it for you. Thanks, |
We'll close this issue in a couple of days, as we've proposed a solution (new plugin version) but haven't heard anything back. If you're still having this issue with the new version please do let us know. Thanks, |
The issue still persist after update. My setup: Unity version: 2018.4.2f1 2019-06-20 19:03:52.928 15070-15387/com.GizmoVR.GizmoVR E/Unity: [AVProVideo] Failed to create player instance |
@joker-gizmo |
The problem was with another native plugin which is not terminate their thread correctly on quit. There was a bunch of errors on quit and after restart no one plugin was able to init. Sorry, for misleading you |
Great to hear you found the issue, i'll close this ticket now |
Hi! Sorry for the delayed response. I tested the new version (1.9.17) and have to say that the problem is still present. I made a small test project to show the issue, and realized that I'm when the video ends I disable the GameObject with the MediaPlayer attached and that is causing the problem. If I don't disable the GameObject or quit the app before the video ends, all goes fine. To reproduce:
using RenderHeads.Media.AVProVideo;
using UnityEngine;
public class Manager : MonoBehaviour{
public MediaPlayer player;
void Start() {
player.Events.AddListener(PlayerEvent);
}
void Update() {
if(Input.GetKeyDown(KeyCode.Escape)){
Application.Quit();
}
}
public void PlayerEvent(MediaPlayer player, MediaPlayerEvent.EventType eventType, ErrorCode error){
switch(eventType){
case MediaPlayerEvent.EventType.FinishedPlaying:
player.CloseVideo(); // The problem occurs regardless of this line
player.gameObject.SetActive(false); // <-- If you remove this line, the problem dissapears.
break;
}
}
}
If you want I can send you the project I made to test it. Thanks! |
Also receiving this issue on Android 9 with unity 2019.1.11f, happens always after Any fix for this or maybe should i use something to dipose AVPRO on Application.quit?
|
Hmm...seems that this issue is still happening (sorry we only noticed now as we don't get notifications on Closed issues) |
Yes, it does :\ Whatever I tried to clean AVProVideo before quit game did not work. |
Any update on this? |
Hi, I can confirm that this is still happening. My workarround was to quit the app using Android native code: public static void QuitApp(){
#if UNITY_ANDROID
AndroidJavaClass player = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject androidActivity = player.GetStatic<AndroidJavaObject>("currentActivity");
if(androidActivity!=null){
androidActivity.Call("finishAffinity");
AndroidJavaClass system = new AndroidJavaClass("java.lang.System");
system.CallStatic("exit", new object[]{0});
}
#else
Application.Quit();
#endif
} This is working on Unity 2019.1.14f1, Unity 2018.4.2f1, on Android 8 and 9. |
@parmaia thanks for the update. I less prefer this solution, but it's better than nothing until fixed. |
@parmaia For some reason, i get an error on: |
@ColorTwist sorry, I kind of messed up with my sample code. I have a class for native calls and one line went into my sample code. This is the good code: public static void QuitApp(){
#if UNITY_ANDROID
AndroidJavaClass player = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject androidActivity = player.GetStatic<AndroidJavaObject>("currentActivity");
if(androidActivity!=null){
androidActivity.Call("finishAffinity");
AndroidJavaClass system = new AndroidJavaClass("java.lang.System");
system.CallStatic("exit", new object[]{0});
}
#else
Application.Quit();
#endif
} I tested this on Unity 2018.4.2f1 and Untiy 2019.1.14f1 and on Android 8 and Android 9. Again, sorry for the mistake. |
I have this problem too, but I dont have any native code, is there way to do it from C# in unity? |
@nsmith1024 You can use the QuitApp() method in my previous comment. It is C#. |
OK, thanks i w ill try it, i was wondering should I replace "com.unity3d.player.UnityPlayer" with my app package name? what about "currentActivity" do i have to change that? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing due to inactivity |
Describe the bug
Using AVPro Video for splash scene.
Quit app and restart app quickly then "Failed to create player".
Your Setup (please complete the following information):
To Reproduce
Logs
Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE
Instead email the link to us unitysupport@renderheads.com
The text was updated successfully, but these errors were encountered: