8000 GitHub - WhitePeachTea/html-tutorial-ex: A quick example of how to write a simple HTML tutorial
[go: up one dir, main page]

Skip to content

WhitePeachTea/html-tutorial-ex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Adding audio and video in HTML

Videos and audios make your website more interesting:)

This tutorial is to teach you how to use the video and audio tag.

So you could add more contexts to your website.

What is a HTML5 Video?

What is a HTML5 Video

In past, We used plug-in tool such as Adobe Flash Player to play video in website. But Flash is history now, Today we use HTML5 and

This is a example for code to add a

  <video width="320" height="240" controls>
  <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
</video> 

As in any codes, there's a basic structure. Tags width="" height='' adjust the side of containers of video.

<video width="320" height="240" controls>

The tag autoplay allows video to play automatically once the website opened

<video width="320" height="240" autoplay>

The source tag tell the browser to find the video from the link address you provided.

<source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">>

The type tag identifies the format of the video.

<source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">

Youtube Video

In most situations, you would add youtube videos to your website. It is diffcult to add a youtube video by using

Right click to select the "copy the embed code" option.You get codes with tag <iframe>. The <iframe> tag is used to embed another document within the current HTML document.

<iframe width="854" height="480" src="https://www.youtube.com/embed/LSxElWwWVFE" frameborder="0" allowfullscreen></iframe>

About

A quick example of how to write a simple HTML tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 69.7%
  • CSS 30.3%
0