I’ve already done some searching but did not find a working example.
jonas echterhoff has some solution but it didn’t work for me (I cannot send a message to him)
This is working only on desktop builds. But on WebGL the the problem is with MovieTexture.
using UnityEngine;
using System.Collections;
public class Video : MonoBehaviour {
public MovieTexture movie;
// Use this for initialization
void Start () {
GetComponent<Renderer>().material.mainTexture = movie as MovieTexture;
movie.Play();
}
}
You can try this free asset that deploy Movie Textures in WebGL:
I tried it but did not work with me… maybe you have better luck
I read a lot of things about WebGL and videos, both in documentation and here in Unity answers… read that WebGL doesn’t support video clips, only URL videos… read that the best video format is .webm with VP8 codec… read that WebGL doesn’t support Movie Textures… but nothing seems to work… I’m almost giving up with the idea of having video in my web game, because it works fine without videos…