Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7750867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:24:05+00:00 2026-06-01T11:24:05+00:00

May be its a simple question but it’s really driving me crazy. I just

  • 0

May be its a simple question but it’s really driving me crazy.
I just want to set the height and width of the HTML5 video.

I am using this code:

 <video controls="controls" width="1000" id="video">
            <source src="sintel-trailer.ogv" type='video/ogg; codecs="theora, vorbis"'>
            <source src="sintel-trailer.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
  </video>

Result:
enter image description here

If I add height attribute

<video controls="controls" width="1000" height="300" id="video">
                <source src="sintel-trailer.ogv" type='video/ogg; codecs="theora, vorbis"'>
                <source src="sintel-trailer.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
 </video>

Result:
enter image description here

So am I missing something here?

Can anyone correct the mistake I’m doing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:24:07+00:00Added an answer on June 1, 2026 at 11:24 am

    You can’t change aspect ratio in <video> tag.

    However you can read your video content and write it to <canvas> element.

    For example:

    <canvas id="canvas" height="768" width="1024"></canvas>
    

    And JS:

    function updateVideo( ) {
        var canvas = document.getElementById( 'canvas' );
        var ctx = canvas.getContext( '2d' );
        var myVideo = document.getElementById( 'video' );
        ctx.drawImage( myVideo, 0, 0, 640, 480 );
    }
    setInterval ( updateVideo, 24 );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a relatively new programmer so this may be a really simple question
It may be a simple question, but i could't get the answer and needing
Hy, i have a big question ... it may sound simple but actually it's
Okay this may seem too simple of a question but I've wasted enough time
I'm trying to split a string on its punctuation, but the string may contain
This may seem a trivial question, but it's one that's bothered me a lot
This may be a ridiculous question, but it's been bothering me for a while.
The question may sound a bit stupid but I think it's interesting. Is it
This may be a silly question but... Say you have a sentence like: The
I have an ASP.NET website, but this question isn't really about technology, it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.