I was trying to download movie(mp4)file from webserver and create file into
Application.persistentDataPath
and play the movie file ( mp4 file).
private void Awake()
{
//mediaplayer gameobject. use this to Play movies.
uniplayer = GameObject.Find("UniversalMediaPlayer").GetComponent<UniversalMediaPlayer>();
_filePath = Application.persistentDataPath + "/Unity.mp4";
}
public void downloadBtn()
{
StartCoroutine("moviedown");
}
public IEnumerator moviedown()
{
if (!Caching.ready)
{
yield return null;
}
var www = new WWW("http://cupzip2016.cafe24.com/bomsoft/AssetBundleTest/Unity.mp4");
while (!www.isDone)
{
percentslider.value = www.progress;
movieDnBtn.text = (www.progress * 100).ToString("##.#") + "%..";
yield return null;
}
if(www.isDone)
{
Handheld.Vibrate();
FileStream stream = new FileStream(_filePath, FileMode.Create);
stream.Write(www.bytes, 0, www.bytes.Length);
stream.Close();
percentslider.value = www.progress;
}
}
public void pressPlaybtn()
{
uniplayer._path = "file://" + _filePath;
uniplayer.Play();
}
this code works on android/ window/ mac but Iphone does’nt working at all
I have no idea .I don’nt know why only IOS does not working … I spend more than 10 days to solve this problem!! but I could’nt …