player.js icon indicating copy to clipboard operation
player.js copied to clipboard

Under load, seeing "There was an error fetching the embed code from Vimeo" errors from player

Open daviddfm opened this issue 4 years ago • 3 comments

Expected Behavior

I am hosting webinar videos which attendees join at roughly the same time. There are cases where 200 or 300 attendees start to watch the same video at roughly the same time. At least within a few minutes of each other. Of course, the expectation is that all attendees can load the video successfully.

Actual Behavior

In these cases - under load - a handful see the error fetching embed code from Vimeo error.

Note the code that below that surfaces the actual error code I think is wrong and so only the message above is available. I imagine what was wanted was .concat(xhr.status, '.') not status.

xhr.onerror = function () {
--
  | var status = xhr.status ? " (".concat(xhr.status, ")") : '';
  | reject(new Error("There was an error fetching the embed code from Vimeo".concat(status, ".")));
  | };
  |  
  | xhr.send();

Steps to Reproduce

Tough one - this really only happens under load. I can bring up all the data I have in bugsnag on this if you think you could correlate to your logs. Here's one image of that:

Screen Shot 2020-08-27 at 4 53 14 PM

daviddfm avatar Aug 27 '20 23:08 daviddfm

@daviddfm thanks for reporting. This is under investigation by our API team. There is indeed a certain limit on the oEmbed endpoint which with the numbers you reported 200/300 new viewers per minute it will get maxed out.

While this is being reviewed there is a workaround you can implement right now. That is not relying on the oEmbed API to get the iframe embed code. It's explained here: https://github.com/vimeo/player.js#pre-existing-player

Personally I would always use this method as it doesn't require an extra request to get the iframe embed which doesn't change much anyway, plus you have more control over all the attributes on the iframe.

luwes avatar Sep 03 '20 14:09 luwes

We are facing the same issue for users in USA, it seems in peak hours it kinda doesnt work not able to reproduce also

kasvith avatar Feb 06 '24 02:02 kasvith

@kasvith If possible, I would recommend following the approach that Wesley shared above for generating the embed code.

rkrishnan8594 avatar Feb 06 '24 14:02 rkrishnan8594