vimeo / vimeo-unity-sdk

Easily stream your Vimeo videos into Unity or record and publish out to Vimeo.
MIT License
211 stars 49 forks source link

WEBGL CORS error #133

Closed Rgascoin closed 3 years ago

Rgascoin commented 3 years ago

Describe the issue

Access to video at 'video_url' from origin 'my_server' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I don't know if anyone has ever found a solution to this problem, my app is running on an Nginx server with open CORS policies.

epicoro commented 3 years ago

If you are using AVPRO make sure you select adaptive resolution and for the vimeo token, do not generate it from "Get Token" button because you will get CORS issue. Instead go to https://developer.vimeo.com/ and create a new app, and then you can generate a API token and insert it into Unity. This will fix the CORS issue and you will be able to play the videos from Webgl. Make sure to setup AVPRO (hls.js or dash.js)

If you are not using AVPRO then you will not be able to play the videos on Webgl because Unity Media player does not support adaptive resolution.

If you don't select adaptive resolution vimeo will not return .m3u8 (hls.js) or .mpd (dash.js) and you will get playback error.