Avatar of David Schure
David Schure
 asked on

Video Not Being Responsive

I have a video on a website.  The problem that I have that it's not resizing to fit phones, tablets, etc,

http://www.mediascrubber.com

margin-right: auto;
margin-left: auto;
display:block;

Open in new window


<video width="1000" controls>
  					<source src="media/Permission.mp4" type="video/mp4">
  					<source src="media/Permission.mp4" type="video/ogg">
  					Your browser does not support the video tag.
					</video>

Open in new window

CSS

Avatar of undefined
Last Comment
David Schure

8/22/2022 - Mon
lenamtl

Hi,

you can use a script like https://github.com/videojs/video.js

this will be easier to get it resized / responsive
https://docs.videojs.com/tutorial-layout.html#responsive-mode

Plus don't set a fix width as it won't resized...
You can use a min-width instead...

 or you can set your media queries with CSS
https://www.w3schools.com/css/css_rwd_mediaqueries.asp
David Schure

ASKER
Thank you but this is over my head.  This is suppose to work....

video {
margin-right: auto;
margin-left: auto;
display:block;
max-width: 100%;
height: auto;
}

Open in new window


but doesn't....
lenamtl

You have Bootstrap but you are not using it correctly, you have to use the syntax
check the grid layout and follow one of them
https://getbootstrap.com/docs/4.1/layout/grid/

container / row / column

<div class="container">
  <div class="row">
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
    <div class="col-sm">
      One of three columns
    </div>
  </div>
</div>

Open in new window


You may want to take the time to learn Bootstrap 4 on Udemy there are plenty of free course on that topic
https://www.udemy.com/bootstrap-4-tutorials/

 if your video code is outside the grid it won't resized...
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Julian Hansen

What are we looking for?

If I look at the site on a small screen the video resizes - what should I be looking for.
ASKER CERTIFIED SOLUTION
Zakaria Acharki

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
David Schure

ASKER
I just figured that out.  I thought that once that happened The site would center on the phone but I am still getting horizontal scroll bars for some reason.  Any help is appreciated.

video {
    /*margin-right: auto;
    margin-left: auto;
    display:block;*/
    max-width: 100%;
    height: auto;
}

Open in new window

Julian Hansen

Do you get the scroll bars in Mobile emulation
F12
Firefox click the icon on the top right of the dev console that looks like a small portrait rectangle on a larger one
Chrome Top left of dev bar the icon that looks like a phone.

Do you see scroll bars in either of these?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
David Schure

ASKER
I don't see the scroll bars in Google Chrome Dev. window.  But I get them on my actual iphone 6.