Hello,
Sorry for horrible title but I didn’t know what else to call it. So using the code below I was able to stream a video with sound. However, with sound the first second or two are cut off. Why? When I do not have the sound from the video, the video plays perfectly in its entirety.
using UnityEngine;
using System.Collections;
public class IntroVideo : MonoBehaviour {
//Variables
public MovieTexture Intro;
public AudioSource audiodata;
WWW videodata;
// Use this for initialization
void Start () {
videodata = new WWW("http://redlightlife.tk/Videos/IntroVideo.ogv");
Intro = videodata.movie;
audiodata = this.GetComponent<AudioSource>();
audiodata.clip = Intro.audioClip;
}
// Update is called once per frame
void OnGUI () {
if (Intro.isReadyToPlay && !Intro.isPlaying)
{
Intro.Play();
audiodata.Play();
}
GUI.DrawTexture(new Rect(0,0,Screen.width,Screen.height),Intro,ScaleMode.StretchToFill, false, 0.0f);
}
}