0

I have a rails app in production. In this rails app, I'm serving some video content to the user. I have all these videos stored in a Digital Ocean Space.

I'm using VideoJS for showing the videos. However, it's very common that I get this error:

A network error caused the media download to fail part-way.

After looking at a github issue, the consensus was that there was something wrong with the server, and not VideoJS. What do you think I should try doing?

Note: This was happening in development, and storage in that environment was on my hard disk However, I figured that once I was storing the videos in a "bucket," that it would work better but I'm still getting this error.

Has anyone else had this problem?

Update

So the videos are loading, and I'm able to watch them. However, when I'm around half way through the video, i'll get this error and then the video will just stop playing.

Angel Garcia
  • 1,547
  • 1
  • 16
  • 37
  • Are your videos public OR protected by auth/signed urls? – Pavel Mikhailyuk Jul 13 '19 at 10:14
  • Hmm, idk. I'm pretty sure they are auth/signed since I need an api token to access them, my space is on the https protocol, and they're set to private. That might be why. I should add that the videos are loading fine, but after watching for a while, I'll get this error that the video didn't completely download and it's an annoyance. – Angel Garcia Jul 13 '19 at 20:26
  • Your video player needs "Range requests" to be supported: https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests . When you serve your videos locally, you might have that "fail part-way" because of your local Rails server like Puma or Thin. When you serve them in Digital Ocean Space, you might have sign time exceeded issue. – Pavel Mikhailyuk Jul 15 '19 at 06:40
  • What to do? You have to start from simple way: investigate, what the expiration time of your signed urls and check if the video is running over that time. – Pavel Mikhailyuk Jul 15 '19 at 06:43

0 Answers0