0

I am building python django application where I need to play a video when request is made from web browser. Scenerio: When I click a button from webapp then I should be directed to next page, and video should play on either mediaplayer such as VLC or something else(pop-up). I tired python openCV and VLC library, but had a very little luck because It wait for video to finish playing, so it doesn't render the page and kills the django server. Here is the code I was trying: play_video() opens the openCV frame and start playing the video, but django view doen't render

def index(request):
   person = person.objects.all()
   context = {'person': person}
   play_video()
   return render(request, 'index.html', context)
Zack
  • 21
  • 2
  • 1
    Playing the video to the user happens on the client side, so you need to stream the data chunk by chunk to the client and play it using JS and HTML or other client side tools. If you’re using the django templating engine search for multipart-data streaming in django template. – Hesam Korki Sep 07 '21 at 00:43
  • @HesamKorki Correct, I am using django just as web interface to interact with bigger display screen I have, so I do not necessarily need to send data to client, but It's still one of the other option to use. – Zack Sep 07 '21 at 01:34

0 Answers0