using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UIpopulator : MonoBehaviour {
public GameObject[] Recentthumb;
public GameObject featuredThumb;
//public GameObject videoThumb;
jsonparse jp;
public Text uu;
// Use this for initialization
void Start()
{
}
public IEnumerator changeText(int i,RawImage img)
{
jp = GetComponent<jsonparse>();
// Start a download of the given URL
WWW www = new WWW(jp.turl[i]);
// Wait for download to complete
yield return www;
if (www.error == null)
{
uu.text = "success";
img.texture = www.texture;
}
else
{
uu.text = www.error;
}
img.GetComponent<videoUrl>().setUrl(jp.vurl[i]);
}
void setRecentThumb()
{
int i = jsonparse.videoCount;
StartCoroutine(changeText(i - 1, Recentthumb[0].GetComponent<RawImage>()));
StartCoroutine(changeText(i - 2, Recentthumb[1].GetComponent<RawImage>()));
}
void setFeatured()
{
int i = jsonparse.videoCount;
StartCoroutine(changeText(0, featuredThumb.GetComponent<RawImage>()));
}
public void UiSetup()
{
setRecentThumb();
setFeatured();
}
}
the above code runs fine in the editor itself but gives but it gives the following error on android device
this is the url from where I am getting the json file
http://192.168.0.5/chillivr/wp-content/content/vid.json
WWW.text seems to work fine on android as I am getting all the urls on the device. the problem occurs when I try to get the png image.
I am using xampp on desktop
thank you.