Do you need to use the JavaScript viewer API? You can add a video texture using the built-in features - just select your video file as the “Base color” texture (see: https://www.youtube.com/watch?v=aRgpkdDNMAE)
Thanks for your answer. Well, yes, I need to use the JavaScript viewer API.In order to set timer to control when the video plays or pause.To be exact. I need to play the video automatically after I reach the viewpoint.The video don’t loop, don’t autoplay immediately, and it’s muted.
Video files can be put into the extra-assets subdirectory of the scene directory Documents\Shapespark\<SCENE-NAME>. Then, they are uploaded together with the scene, and can be referred in HTML/JS code as $EXTRA_ASSETS/<FILE-NAME>.
You can use the Script extension to put your own code that starts the video when the trigger is clicked.
The console of firefox shows error as follows: Cross-origin request blocked: The Same Origin Policy disallows reading remote resources at the https://cdn0.shapespark.com/kcLjzdzXD3YW/cbt-0719/v19/extra-assets/Elevator2.mp4. (Reason: CORS request failed)
and material is null
So why CORS request did not succeed?
How to fix material is null?