Here is a more complete answer for future reference:
You can solve this issue by attaching to script to said GameObject that enables the shader upon awake, it would look something like this:
void Awake()
{
//get your video material component
VideoMaterial myVideoMaterial = getComponent<VideoMaterial>();
//Look for a shader called "VideoBackground" and apply it to the shader material of the component
myVideoMaterial.material.shader = Shader.find("Custom/VideoBackground");
Destroy(this);//this will remove this script after executing it, just looks a bit cleaner in my opinion but no necessary
}
- More information about material shaders can be found in the unity docs here.
- More information about Shader.find can be found in the docs here
This is assuming that you have a reference to the shader from a material already somewhere in your scene. If you do not you can as per Gowthy's comment add the shader to the "always included shaders" list. This can be found by going to the Graphics
menu under Project Settings, and then scroll down to the "Always Included Shaders" section. Or you can add the shader to a "Resources" folder that gets included in the player build"