I am not able to play video on my Django website. I think something is wrong in my views.py render function
videoplay.html:
{% block contents %} <video name='demo' controls autoplay width='50%' height='40%'> <source src="{{STATIC_URL}}sample1.mp4" type="video/mp4"></source> </video> {% endblock %} Included this in settings.py:
STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media')` Views.py is:
from django.shortcuts import render, redirect from django.conf import settings from django.core.files.storage import FileSystemStorage from django.views.generic.base import TemplateView from uploads.core.models import Document from uploads.core.forms import DocumentForm def index(request): return render(request, "core/videoplay.html")`