Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Video Unable to stream video in Android using unity video player

Discussion in 'Audio & Video' started by abhayaagrawal, Aug 29, 2017.

  1. abhayaagrawal

    abhayaagrawal

    Joined:
    Sep 30, 2016
    Posts:
    8
    This is my code to stream video. It's working fine in editor but in android it's just printing "Preparing" . Basically it went into infinite loop.

    IEnumerator PlayVideo(string URL)
    {
    ScreenFactory.Instance.Activate<ScreenVideo>();
    videoPlayer.url = URL;
    videoPlayer.Prepare();
    WaitForSeconds wait = new WaitForSeconds(1);
    while (!videoPlayer.isPrepared)
    {
    Debug.Log("Preparing");
    yield return wait;
    break;
    }

    videoPlayer.Play();
    }