Hello everyone,
I followed the below tutorial
https://developer.playcanvas.com/en/tutorials/video-textures/
and tried to play the video in a simple way, but unfortunately,
it didn’t work. What did I do wrong?
Thank you.
Hello everyone,
I followed the below tutorial
https://developer.playcanvas.com/en/tutorials/video-textures/
and tried to play the video in a simple way, but unfortunately,
it didn’t work. What did I do wrong?
Thank you.
That script generates a video texture. It doesn’t apply it to any entity. You need to do it yourself. The script should expose the generated texture via its property, so you can access it via entity.script.videoTexture.videoTexture
.
You can also do it without this script, by following this example:
https://playcanvas.github.io/#/graphics/video-texture
If you refer to the tutorial, you will see another file called tv-screen.js
.
Try adding that and see how it works.
Looking at the Root Entity in the tutorial might make it easier to understand.
P.S. This script is responsible for applying a video texture to the material set by the user.