- Home /
Unable to stream a video on Android Pro with PlayFullScreenMovie
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
Hi there, I am trying to accomplish exactly the same as you in your original post, however, I am using Vuforia (Qualcomm) to achieve this. Could do elaborate on how you got Vuforia to stream a video to an Android device? I can't seem to get it to work and there are no useful errors in logcat. $$anonymous$$y Handheld.PlayFullScreen$$anonymous$$ovie always returns false. Do you have any tips or ideas as to why this does not work?
We have now found that the solution was to use a strea$$anonymous$$g server (afraid am not sure what that means exactly) to host the file. If its on youtube etc then these are already strea$$anonymous$$g servers and so the original Handheld.PlayFullScreen$$anonymous$$ovie should work. The error in my original post may have just been that the 3gp file was not on a strea$$anonymous$$g server. (Could also be that it was 3gp - we use mp4 now).
Answer by Ing3nu · May 28, 2014 at 06:41 PM
In order to get the streaming to work, you have to check the "required WiFi connection" in the build settings. for some reason, Unity is not passing the required permission to access the web through to the AndroidManifest unless you have that box checked.
Answer by Chowdery · Jun 02, 2013 at 02:08 PM
Hey Chris, sorry to be the bearer of bad news but I don't think that movie streaming is supported through the WWW class on Android/IOS yet:
http://docs.unity3d.com/Documentation/Manual/iphone-unsupported.html
http://docs.unity3d.com/Documentation/Manual/android-unsupported.html
I'm currently looking for an alternative but not having much luck. Please let me know if you manage to find a work around :).
Answer by ChrisYummi · Jun 03, 2013 at 07:19 AM
Final solution looks like using the video player that you can get from Vuforia (Qualcomm). This handles streaming as well as writing to a texture.
https://developer.vuforia.com/resources/sample-apps/video-playback-sample-app
Your answer
Follow this Question
Related Questions
StreamingAssets Folder Max Size 2 Answers
Unity 5.6 Video Clip stream on Android 0 Answers
Could a privacy error on a video streaming server cause videos not to play in an Android build? 1 Answer
Unity Video ads closing when player leaves app. 0 Answers
UnityEngine.Video.VideoPlayer takes a very long time to load. Can I stream it before it loads? 1 Answer