-2
{% load staticfiles %}
<!DOCTYPE html>
<html>
    <head>
        <title style="font-weight:bold; font-family:cursive">Font Maker </title>
        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
        <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
        <link href='//fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
        <link href='ank1.css' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="{% static 'css/blog.css' %}">
    </head>
    <div class="embed-responsive embed-responsive-4by3">
    <body>
          <div class="page-header">

            <h1><a href="/"style="font-weight:bold; font-family:cursive">FoNt MaKeR</a></h1>
        </div>
        <video autoplay loop muted="background">


        <source src="//player.vimeo.com/external/158148793.hd.mp4?s=8e8741dbee251d5c35a759718d4b0976fbf38b6f&profile_id=119&oauth2_token_id=57447761"type="video/mp4"></source>


    </video> 


        <div class="content container">
            <div class="row">
                <div class="col-md-8">
                    {% block content %}
                    {% endblock %}
                </div>
            </div>
        </div>


</div>
    </body>
    </div>
</html>

By this, video is playing but not in background of the page. Video is playing in another section but not in background. One more thing, I am not able to play video which is downloaded in my system.

  • This is not a django question, but an html question. Also it's unclear what you mean by _playing in the background_. There's plenty of [questions and answers here](https://stackoverflow.com/questions/4958763/ways-to-set-up-a-video-as-a-background-image) on SO on how to embed videos in a web page. – dirkgroten Dec 10 '17 at 14:46
  • Possible duplicate of [video as site background? HTML 5](https://stackoverflow.com/questions/3800813/video-as-site-background-html-5) – dirkgroten Dec 10 '17 at 14:52

2 Answers2

0

You can use iframe tag in html.
Visit: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe

0

This is not a Django Question, but an HTML. in case if you are looking to upload a video or image in the Django background. you need to first add that image/ video in the static folder (please read the Django documentation). and then something like the code below can be added in the index.html to add the video in Django.

background-image: url("{%static 'assets/img/team.jpg'%}");

Please note that in Django we cannot simply add any image as we can add in HTML. We have to use a special format.

Tamanbir
  • 76
  • 7