From the course: Learning Web Audio and Video

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Specify height and width

Specify height and width

From the course: Learning Web Audio and Video

Start my 1-month free trial

Specify height and width

- [Instructor] Unlike audio elements when dealing with a video tag, we can specify a specific width and height. In order to properly display the visual aspects of the video file, first, we need to specify a source file. Just as with audio, the video element can have a single source specified as an attribute or a number of source elements nested within the video element itself. We'll use a single SRC attribute to keep things simple. So directly on the video element, SRC equals... And we already have some videos within our media folder for this project. So we can go into media and there's our video.mp4. There we are. Let's go ahead and save this and then have a look in the web browser. Now you can see here, it's quite large because the video is displaying at its native resolution. We can play it back and use the controls, as specified, with he controls attribute. However, it's much, much too large. We're going to constrain this with the width attribute. Going back to Visual Studio Code,…

Contents