Django Streaming Videos from Mobile Devices not Working Properly

Viewed 101

Django server does not play videos properly on mobile devices. Video seek options are not available. It works fine if we use media files from another domains but files from own server are not working correctly. Forward, rewind and seek options are not accessible

<video id='main-video' controls style="width:100%;">
<source src='{{ video_format.url }}' title='{{ name }}' type='video/mp4' />
</video>

Should I change any Django core settings?

I have built the server using Nginx + Django + Gunicorn.

1 Answers

I found out the issue on my own. Django is not good at serving static files. So, I created a location block in Nginx config to server media files too along with the static files. It solved the issue. I hope it will be useful for other people building video sites.

location /media/ {
    root /home/django-site/root-folder;
}
Related