0

I have saved some of videos in specific paths. I want the video to be displayed when the API is called. I do this using c.SendFile(). The problem is that by calling the API once by vlc or browser, it is called several times. I realized this from fmt.Println("called").

What is the problem?

func main() {

    app := fiber.New()

    app.Get("/video", func(c *fiber.Ctx) error {
        fmt.Println("called")
        return c.SendFile("./videos/2022/12/17/1a191775-a3ab-427a-932e-ebbb3d2879b1/video-360.mp4");
      
      })

    app.Listen(":3030")
}
Trevor Johnson
  • 874
  • 5
  • 19
  • Can you please provide an example of how you are calling the api? – Trevor Johnson Dec 18 '22 at 19:52
  • @TrevorJohnson I put 127.0.0.1:3030/video URL in VLC in the path Media/Open network Stream, I also call the API in the browser (google chrome). The video is played, there is no problem, but the API is called several times – Esmail Ebrahimi Dec 20 '22 at 08:51

0 Answers0