[SOLVED] Playing a video

Hi I am trying to follow the tutorial found in PlayCanvas 3D HTML5 Game Engine to play a video, I did exactly the same as the tutorial with the same scripts used and when I launch the game and inspect the page it says script ‘preloadVideo’ is not found, awaiting it to be added to registry in the inspect. Please advice

Hello @AhmedFarahat,

Can you please share your project so I can take a look?

can you tell me your username to add you please?

Sure, it’s leonidas.

Done , Please check

1 Like

Any clues?

From what I’m seeing in your project, you have some noticeable errors on the script, that’s plain JS and not in the Playcanvas format, which is expected by the parser. To be attached to a Playcanvas entity.

I will advice you to take a look again on the manual here: https://developer.playcanvas.com/en/user-manual/scripting/

It explains the exact structure a Playcanvas script should have.

The script I am using is the same as the one in the tutorial, I just copied & pasted it.

You have added a video_texture.js script in your assets, which still isn’t a pc.Script. Where did you find this?

Here is how it’s supposed to look, taken from the tutorial project:

https://playcanvas.com/editor/code/405850?tabs=4468335

Also attached to the entity you have the preload_video.js, not that.

1 Like

Can you please send me the tutorial link, it seems like I am using an outdated one

1 Like

Sure, here you go:

https://developer.playcanvas.com/en/tutorials/video-textures/

1 Like

Thanks It got solved, :slight_smile:

1 Like