Unable to Add Textures due to CORS

Hello all, I was hoping that someone can shed some light on my issue.

I have a 3d model in sketchfab and I am trying to use the AddTexture or AddVideoTexture functions in order to update the texture of the 3d model. I have used the following URL: https://labs.sketchfab.com/experiments/video-textures/videos/facetune.webm

and it works great, however when I try to use a local resource (running sketchfab on my own server) it gives me the errors listed below. I contacted SketchFab and they said…

“As far as I know, local files cannot be used due to cross origin limitations of browsers. However, you shouldn’t need to host videos on Sketchfab’s domain either. Any CORS-enabled domain should be fine.”

I have since attempted other videos from different domains and none of them work.

My question is, has anyone been able to get this to work?

I hope someone can help.

Thanks

Access to image at ‘https://…’ from origin ‘https://sketchfab.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Hello,

You need to enable CORS with an .htaccess file in your specific texture folder on your remote server (not locally).

Create an .htaccess with these lines:

Header set Access-Control-Allow-Origin "*"

OR

<ifModule mod_headers.c>
    Header set Access-Control-Allow-Origin: *
</ifModule>

If you want to secure it, remplace * by the domain name hosting your app using sketchfab api.

Hope it helps.

Bests,

Pierre-Yves

Hello Pierre-Yves,

Thank you for your reply. Let me set that up and I will come back with my result.

I appreciate you taking the time to answer my question

Best regards

Hello Pierre-Yves,

After hosting a page with AWS S3 and putting in the CORS xml I am still getting blocked.
I used the xml example provided by Amazon, seems pretty straight forward and coincides with what others have used. I have allowed access to both sketchfab.com and vimeo.com where an example video is. Still no luck.

Access to image at ‘https://vimeo.com/12345’ from origin ‘https://sketchfab.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Any Ideas what I should try next? How is anyone else been able to do this?

Best regards