Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Android] Handheld.PlayFullScreenMovie only plays sound when internet connection is slow

Discussion in 'Android' started by MaestroMMT, Nov 15, 2016.

  1. MaestroMMT

    MaestroMMT

    Joined:
    May 31, 2015
    Posts:
    26
    hi guys,

    I have an issue when my internet connection is slow with Handheld.PlayFullScreenMovie (the video is passed by URL "http://...")

    Code (CSharp):
    1.     IEnumerator PlayNativeVideoCoroutine(string videoPath)
    2.     {
    3.         yield return new WaitForSeconds(1f);
    4.  
    5.         try
    6.         {
    7.             Handheld.PlayFullScreenMovie(videoPath, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFit);
    8.         }
    9.         catch (Exception ex)
    10.         {
    11.             Debug.Log(ex.Message);
    12.         }
    13.     }
    14.  
    15. StartCoroutine(PlayNativeVideoCoroutine(url));
    It's a simple code which only work when my internet connection is stable else an adb error occured " timeout waiting for video" and the video only plays sounds without image.

    Any idea ?
     
  2. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    I'm seeing something similar, but I don't think it's related to connection speed. My Android test device is connected to my wifi network so the speed should be fine. Sometimes the video doesn't play but the audio plays, and I can see the last output from the Unity scene. I can also see the video controls if I tap the screen. It doesn't happen every time; usually the second time I try to play a movie it works.
     
    MaestroMMT likes this.
  3. MaestroMMT

    MaestroMMT

    Joined:
    May 31, 2015
    Posts:
    26
    I have exactly the same thing. Last output and video controls when tapping the screen. I tried to limit my connection, each time the issue occured, my ping was beetween 250ms and 350ms. WIthout limit, it works.
     
  4. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hm interesting. What Unity and Android versions are you on? My device is a Samsung Galaxy J1 running KitKat (4.4.4). My Unity version is 5.4.2f2.
     
  5. MaestroMMT

    MaestroMMT

    Joined:
    May 31, 2015
    Posts:
    26
    I am using Unity pro 5.4.2f1 and I tested on Samsung Galaxy S6, samsung galaxy tab 4, Xperia Z3. I have thousand users who are using my app. I receive 2 - 3 supports emails each day because of this issue.
     
    samizzo likes this.
  6. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Wow ok. It really sounds like a Unity bug. I can't see anything in the logcat logs that indicate what the problem is.. :/
     
  7. MaestroMMT

    MaestroMMT

    Joined:
    May 31, 2015
    Posts:
    26
    When you have this issue, do you see "time out waiting video" in your logcat ? try to put the code in a try catch if not :$
     
  8. funx

    funx

    Joined:
    Jun 9, 2014
    Posts:
    16
    I'm having this issue too. Unity 5.4.0f3, Nexus 5X with Android 7.0. Also happens on Nexus 5 running Android 6.0. This is one the last critical bugs we need to resolve before our next release...
     
  9. Yousician_unity_assets

    Yousician_unity_assets

    Joined:
    Dec 9, 2011
    Posts:
    11
    Having same issue too. Also sometimes the video won't play at all and applications will go the unresponsive state.. Have you created bug ticket of this issue yet?