- Home /
Question by
JannickL · Mar 16, 2017 at 11:23 PM ·
texturewwwstreamingvideo streamingdownloadable content
Unity for showing a html stream
Hello there, i want to play a livestream from an ip camera in unity (had no luck with android studio though). Stream url looks like "http://192.168.178.50/videostream.cgi?user=admin&pwd="
I am trying this code:
public class GetStream:MonoBehaviour {
private string url = "192.168.178.50/videostream.cgi?user=admin&pwd=";
IEnumerator GetImage() {
Debug.Log("Requested new texture!");
WWW www = new WWW("http://" + url + ":8080/?action=snapshot");
yield return www;
RawImage renderer = GetComponent<RawImage>();
renderer.texture = www.texture;
}
void Update() {
StartCoroutine(GetImage());
}
}
Getting this error:
Anyone wants to help?
Greets
screenshot-1.png
(12.3 kB)
Comment
unity can support some video formats, but i dont believe it sopports any strea$$anonymous$$g. you would need to convert the video into a format that unity can understand before it is downloaded.
unless there is something in the asset store, it would take a mile of code to do video strea$$anonymous$$g.