'How to load mp4 video on AWS EC2 or Lambda using headless Selenium or Puppeteer?

So I am trying to get the video src from this page.

On my local computer, I am able to use Selenium in headless mode and go to this page and the video will appear after a short wait.

On AWS Lambda (using all the correct layers and packages) or an EC2 Instance (with all the correct packages installed), I can get to the webpage however the video doesn't load. The javascript never loads the video.

What I have tried:

Other information:

I have found this question asked on SO and it says that chromium can't load mp4 but chrome can. It says to "set the executablePath as a separately installed Chrome executable", however when I have tried this, it has thrown errors.

I don't quite understand why it would work fine locally on my machine but with all the same packages installed on Lambda or an EC2 instance, it would fail to load.

Any insight is appreciated. I can put up my Lambda layers or EC2 setup instructions if that would be helpful.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source