Search Unity

Video VideoPlayer.Stop() crash on Android

Discussion in 'Audio & Video' started by TomChaniii, Apr 7, 2017.

  1. TomChaniii

    TomChaniii

    Joined:
    Apr 7, 2017
    Posts:
    1
    I use the following code to change the video source at runtime, however, it crashes sometimes on Android.

    Code (CSharp):
    1.     void loadVideoToSphere(string url) {
    2.         VideoPlayer videoPlayer = innerSphere.GetComponent<VideoPlayer> ();
    3.  
    4.         Debug.Log ("loadImageToSphere 1");
    5.  
    6.         if (videoPlayer != null) {
    7.             Debug.Log ("loadImageToSphere 2");
    8.             videoPlayer.Stop (); // it crashes sometimes (works fine on editor and iOS)
    9.             Debug.Log ("loadImageToSphere 3");
    10.         }
    11.  
    12.         Debug.Log ("loadImageToSphere 4");
    13.  
    14.         StartCoroutine (checkVideoExist(new WWW (TomsUtil.getAssetPath () + url + ".mp4")));
    15.  
    16.         Debug.Log ("loadImageToSphere 5");
    17.     }

    Here is the log:
     
  2. plindberg

    plindberg

    Joined:
    Nov 25, 2016
    Posts:
    18
    Experiencing the same issue. Have you had any progress with this?

    Edit: as a workaround, you can use pause and set the video time to 0 instead.
     
    Last edited: Apr 10, 2017
  3. d_matrix

    d_matrix

    Joined:
    Feb 12, 2016
    Posts:
    1
    This issue is fixed and it will be updated into 2017.2, 2017.1 and the next 5.6
     
  4. tanveerm

    tanveerm

    Joined:
    Feb 24, 2016
    Posts:
    22
    I'm Using Unity version 5.6.2f1, i still see the crash sometimes on windows IDE. Its not fixed.
     
  5. alan_motionlab

    alan_motionlab

    Joined:
    Nov 27, 2014
    Posts:
    99
    Getting this crash on Android as well - Running 5.6.2f1

    @d_matrix When was this supposed to be fixed?
     
  6. Alienjack

    Alienjack

    Joined:
    Nov 26, 2018
    Posts:
    1
    I solved this bug. call stop method in nextframe's update,never crash again