vimeo-unity-sdk icon indicating copy to clipboard operation
vimeo-unity-sdk copied to clipboard

Video Streaming Not Working on WebGL

Open khalidmahmood99 opened this issue 4 years ago • 5 comments

I'm getting the below issue when trying to stream video on WebGl. It's working fine on all other platforms

"Error: Loading failed. File not found, codec not supported, video resolution too high or insufficient system resources"

1- Upload a video on vimeo

2- Test in Unity - Working fine 3- Test in Android and iOS - Working fine 4- Test in Web GL and loading is failed

2019.2.6f1

Mac OS

khalidmahmood99 avatar Sep 22 '20 13:09 khalidmahmood99

Most probably a CORS issue, WebGL can´t fetch url´s outside the domain of the installed build, unless you use a proxy, I´m trying to do the same with other assets, still working on a solution.

parsec3d avatar Sep 22 '20 14:09 parsec3d

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.

epicoro avatar Mar 20 '21 20:03 epicoro

I´m able to play Vimeo videos using the unity media player on WebGL without adaptive resolution. Problem is that 1 out of 25 times I get a CORS error while in the middle of the video because Access-control-allow-origin comes with a value of null. I´m about to stop paying for Vimeo pro and just change the provider.

germanbv avatar May 08 '21 20:05 germanbv

@germancinho Would you mind giving some pointers on how you got it working?

Mosel3y avatar Jul 27 '21 20:07 Mosel3y

@germancinho Would you mind giving some pointers on how you got it working?

this SDK definitely doesn't work well on WebGL, so in the end, I've implemented the Vimeo Player API (https://github.com/vimeo/player.js/) via jslib.

germanbv avatar Jul 28 '21 16:07 germanbv