I'm new to Unity and am trying to update a VideoPlayer via my script. I have confirmed the code is working with a preset value but when I run videoPlayer.url = "new video url"
it will not play.
Here is my code for playing videos. This will work but once I give it a url to update to, it just changes the source but does not play the video.
public IEnumerator playVideo(string videoYear) {
// This line updates the url but the video will not actually play.
videoPlayer.url = "example.com/app/" + videoYear + ".mp4";
videoPlayer.Prepare();
WaitForSeconds waitForSeconds = new WaitForSeconds(1);
while(!videoPlayer.isPrepared)
{
yield return waitForSeconds;
break;
}
rawImage.texture = videoPlayer.texture;
videoPlayer.Play();
}
http://
– Joe ScottovideoPlayer.url = "http://actual_video_url_without_combining"
? – Nitro557