[SOLVED] Is there any simple way to play video?

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.

https://playcanvas.com/editor/scene/1921274

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

1 Like

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.

1 Like

@Hizard @LeXXik

Thank you for your reply, It works for me now, have a nice day :smiley:

1 Like