Video playback behaving differently on Firefox and Chrome - Can anyone explain why?

I am encountering an issue with my banner video when trying to make it stretch at 100% of the width. It seems to work perfectly on Firefox, but not on Chrome. To see an example, visit . Despite using code snippets and attempting to address compatibility issues, I cannot seem to get it to function properly. The best way to illustrate this problem is through the link itself.

Special thanks to @Mav for providing a visual example! Please refer to the images below:

Firefox

https://i.sstatic.net/61fE0.png

Chrome

https://i.sstatic.net/595bc.png

Below is the snippet of my code:

<!-- Main Layout Content -->
<md-content md-colors="accent">

    <!-- Tabs Layout -->
    <md-tabs md-selected="ctrl.tabSelected" md-stretch-tabs="always" class="md-primary" md-dynamic-height md-border-bottom>

        <!-- Home Tab -->
        <md-tab>

            <!-- Home Tab Label -->
            <md-tab-label>
                <h2>
                    <md-icon md-svg-src="media/image/icon/home.svg"></md-icon>
                    <span hide show-gt-sm>
                        &nbsp;Home
                    </span>
                </h2>
            </md-tab-label>

            <!-- Home Tab Body -->
            <md-tab-body>

                <!-- Home Tab Banner -->
                <div layout="column" layout-align="start center" style="overflow-y: hidden; max-height: 275px; text-align: center; background-color: #000;">
                    <div id="banner-title" style="position: absolute;">
                        <img src="media/image/icon/logo-white-192x192.png" alt="GustDive Logo" />
                        <span hide show-gt-xs>
                            <br />
                            <h1 style="font-size: 50px; color: white; text-shadow: 0 0 10px white; letter-spacing: 15px;" flex>
                                GustDive
                            </h1>
                        </span>
                    </div>
                    <video loop muted autoplay style="width: 100%;">
                        <source src="media/video/underwater-720p.mp4" type="video/mp4">
                        <source src="media/video/underwater-360p.mp4" media="(max-width: 640px)" type="video/mp4">
                    </video>
                </div>

                <!-- Home Tab Content -->
                <md-content layout="row" layout-xs="column" layout-wrap>

                </md-content>

            </md-tab-body>

        </md-tab>
    </md-tabs>

    <!-- Website Footer -->
    <div md-colors="{background: 'grey-A200'}" layout-padding>
        <div layout="row" layout-align="end center">
            <a target="_blank" href="https://www.padi.com" aria-label="Padi">
                <img src="media/image/icon/padi.png" alt="Padi" />
            </a>
            <a target="_blank" href="https://www.tripadvisor.com/Attraction_Review-g150793-d11888983-Reviews-GustDive-Puerto_Vallarta.html" aria-label="Trip Advisor">
                <img src="media/image/icon/trip-advisor.png" alt="Trip Advisor" />
            </a>
        </div>
        <div layout-align="center end" style="font-size: 12px; text-align: center;">Copyright © Jonathan-Gagne.com 2018</div>
    </div>

</md-content>

Answer №1

To ensure the width is 100% on Chrome, apply the CSS rule object-fit: fill. It's worth noting that this approach does not have support in IE11 (you can check compatibility on caniuse).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What are some effective ways to improve the loading time of images retrieved from external servers and URLs on a webpage?

Currently, we have developed a basic Django application that retrieves images from ImgUr APIs by utilizing the endpoint provided at: These images are then sent to the front-end for display using simple HTML templates with jQuery. Unfortunately, the loadi ...

tips for obtaining necessary input fields

What is the best way to include mandatory input fields? appreciate it <input type="text" name="name"> ...

Display HTML code inside a specified div

I am attempting to incorporate content from another HTML file into my current web page using jQuery's .load method. Unfortunately, the content is not loading as expected. Can anyone provide me with a solution to this issue? Below is the HTML and jQ ...

Having trouble with ng-show not functioning as planned

Here is the code snippet that I have been working on: HTML Code (updata.html) <form role="form" ng-submit="submit()"> <input type="text" ng-model="query" > <div class="item item-input item-stacked-label item-divider"> <li ...

Internet Explorer is failing to render SVG as content within a pseudo element such as :before or :after

Looking to tackle an issue that stems from the following discussion: Is there a way to use SVG as content in a pseudo element :before or :after. I'm attempting to add a svg triangle after a div using a pseudo-class. div{ background-color: black; w ...

Ways to display content alongside an image

Is there a way to verify if an application is running on another server by displaying an image it provides? The challenge is that altering the content of the image is not an option. If the image is not provided, can I show an alt attribute indicating that ...

How to save a line break in a PHP variable

In the midst of creating a Facebook App, I encounter an obstacle when attempting to display text retrieved from a database on the page. The issue lies in my desire to insert a line break within the text variable – for example, after "to." If I were to co ...

When a child element of the body is set to 100%, it causes the page to overflow

This is the css body, html { height: 100%; width: 100%; } #container { display: flex; position: absolute; flex-flow: column wrap; justify-content: stretch; align-items: center; width: 100%; height: 100%; text-align: ...

What is the most effective approach to seamlessly conceal and reveal a button with the assistance

I have two buttons, one for play and one for pause. <td> <?php if($service['ue_status'] == "RUNNING"){ $hideMe = 'd-none'; } ?> <a href="#" class="btn btn-warning ...

Avoiding the use of mailto links in PHP

One problem I encountered is with a mailto link in my PHP code: <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3f5a525e56537f5b50525e5651114b535b">[email protected]</a>?subject=<?php rawurlencode ...

coming to a halt at a specific location near the bottom

I've searched through numerous threads on stackoverflow regarding this issue and attempted various solutions using jQuery, HTML, and CSS. Unfortunately, none of them seem to be working as expected for my situation. Can someone lend a helping hand? He ...

AngularJS v 1.3.17: ng-click not triggering within modal dialog

It seems like I may have overlooked something here. Here is the code snippet for a module: (function (app) { 'use strict'; app.controller('modalCtrl', modalCtrl); modalCtrl.$inject = ['$scope', '$modalI ...

How can I retrieve values from JSP style tags in an AngularJS HTML view?

How can I retrieve JSP style tag values in an angularjs html view? Specifically, is it possible to extract the ‘principal.firstName’ value from the following tag in the browser and is there an Angularjs approach to achieve this? <sec:authentication ...

What is the proper method for determining the height of a scrollbar's grip?

Have you ever noticed that Facebook has a unique component on the right-most column? When the browser window is maximized, it looks like this: But when you resize your browser window to be smaller, it changes to this: The grip within the overflowing cont ...

Creating a clickable image map for the footer

I have successfully made a navigation bar fixed to the bottom right of the page. However, when I attempted to create an image map out of it in Dreamweaver, the image did not appear for me to draw around. I considered doing it manually, but then questioned ...

Why is Selectpicker (bootstrap-select) not functioning properly and displaying a disabled menu?

Currently, I am attempting to implement the selectpicker feature from Bootstrap-Select in order to create a dropdown menu that supports multiple selections. Below is the snippet of code that I have included in my HTML file: <select class="selectpicker" ...

The values on the x-axis do not appear to be showing up in Fusion Charts when viewing a heat map

I've incorporated the angular-fusion charts directive into my application and successfully created a heat map chart following an example. However, I'm encountering an issue where the values of the x-axis are not displaying in my application. I&ap ...

I'm having trouble getting a response from the user.php file in my login system

I am trying to create a login system using ajax and pdo with a button as the submitter. The issue I am facing is that when I click the button to execute, nothing happens. There are no errors in the console. I can see in the network tab that it sends the us ...

Revisit the promise in AngularJS after making adjustments to the page and reload

1) The login page redirects to the home page after a successful login. if (data.status == CONSTANTS.RETURN_SUCCESS) { $location.path("/home"); $route.reload(); } 2) I have implemented a promise to fetch data from the database before loading ...

After clicking, an created modal is displayed, then disappears on its own

After creating 2 Modals, I encountered an issue where the second modal with the class "category-modal" reverts back to display none when I click the "+" sign on the form. The first modal, with the class "modal," displays correctly when the add button is cl ...