I can successfully get a test video playing if I put it locally on the devices StreamingAssets folder but when I try to play the original file that is on the web it never works and there is no useful output from logcat. I just get a black screen very briefly before returning to the default blue.
using UnityEngine;
using System.Collections;
public class VideoTest : MonoBehaviour {
// Use this for initialization
//string moviePath = "famous.3gp";
string moviePath = "http://www.pocketjourney.com/downloads/pj/video/famous.3gp";
//string moviePath = "http://www.unity3d.com/webplayers/Movie/sample.ogg";
// Use this for initialization
void Start () {
Invoke("doPlay",1.0f);
}
void doPlay()
{
Debug.Log("Starting Movie: " + moviePath);
//iPhoneUtils.PlayMovieURL(moviePath, Color.black);
Handheld.PlayFullScreenMovie (moviePath, Color.black, FullScreenMovieControlMode.Full);
Debug.Log("All Done!");
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); }
}
}
As you can see I’ve also tried an ogg file also but this doesn’t work (is supposed to be for www.movie and MovieTextures - but these are not for mobile).
I’m using Unity 4.0.1f2 with Android Pro building to an HTC Sensation XL and it has no problems playing any of these videos in its browser or directly so I’m guessing it’s not a device or source problem.
I know there are many posters of video playback problems, and many unanswered because people make simple mistakes (and Unity gives no useful logs to prevent this - a shame) but since I’m only changing the target path to go from a working local one to a failing streamed one I can’t think of what I might be doing wrong. I even tested the old depricated iPhoneUtils.PlayMovieURL in case it would help but it failed the same way.
Does Unity actually support this, as the documentation is very minimal and not fully updated to Unity 4?
Can anyone share the code for a successful online stream of a video?
Thanks