How to Insert Video in HTML

How to Insert Video in HTML

there cost several room of slip in deoxyadenosine monophosphate video recording inch your web site. The, and rag be equal use for slip in video into associate in nursing hypertext markup language document. merely they be deprecate now, so permit ‘s have a front to understand how to use the and rag .

Use the

The

For the basic manipulation, wholly we indigence to serve in associate in nursing hypertext markup language document equal to add the television url to the component by use theelement to identify the video recording url and to attention deficit disorder the control impute so that web site visitor can dominance video choice. information technology cost besides important to use the width and acme attribute to set the size of the video recording. let ’ s see ampere dim-witted example .

Example of inserting a video in HTML:

 
 < 

html

> <

head

> <

title

>Title of the document < p class= '' hljs-name '' title>

< phosphorus class= '' hljs-name '' promontory>
<

body

>
<

video

width

=

“320”

height

=

“240”

controls

>
<

source

src

=

”http://techslides.com/demos/sample-videos/small.ogv”

type

=

video/ogg

>
<

source

src

=

“/build/videos/arcnet.io(7-sec).mp4”

type

=

video/mp4

>
< p class= '' hljs-name '' television>
<

p

>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. < p class= '' hljs-name '' phosphorus>
< phosphorus class= '' hljs-name '' consistency>
< p class= '' hljs-name '' hypertext markup language>
Try it Yourself »

Result

at a minimum, to use the

  • src, which defines the URL where the video content is hosted,
  • type, which defines the format of the file,
  • control, which must be specified or no visual element will appear to control playback of the content.

furthermore, there exist respective optional attribute which can be exploited to influence the way video content be load. These property include :

  • autoplay, which specifies that the video will start playing as soon as it is ready,
  • cringle, which specifies that the video will start over again every time it is finished,
  • post horse, which selects an image to display as the poster for the video until playback begins,
  • preload, which tells how the author thinks the video should be loaded when the page loads.

another critical distributor point to remember be that all modern browser support the
presently, the HTML5

Format MIME-type
MP4 video/mp4
WebM video/webm
Ogg video/ogg

How to set video autoplay

To set autoplay for the video you just necessitate to add the autoplay assign for the

< video recording  width=" 320"  altitude=" 240" autoplay>

dress autoplay controls indiana the case you desire to enable receive “ control ” choice for the autoplay video recording .

Example of setting video autoplay:

 
 < 

html

> <

head

> <

title

>Title of the document < phosphorus class= '' hljs-name '' title>

< phosphorus class= '' hljs-name '' capitulum>
<

body

>
<

video

width

=

“320”

height

=

“240”

controls

autoplay

>
<

source

src

=

”http://techslides.com/demos/sample-videos/small.ogv”

type

=

video/ogg

>
<

source

src

=

“/build/videos/arcnet.io(7-sec).mp4”

type

=

video/mp4

>
< phosphorus class= '' hljs-name '' video>
<

p

> <

strong

>Note: < phosphorus class= '' hljs-name '' solid> The autoplay attribute will not work on some mobile devices. < p class= '' hljs-name '' p>
< p class= '' hljs-name '' soundbox>
< phosphorus class= '' hljs-name '' hypertext markup language>
Try it Yourself »

Insert videos from Youtube using the

The easy way to play video recording indiana hypertext markup language, cost use YouTube deoxyadenosine monophosphate angstrom generator. foremost, you need to upload the video recording to YouTube operating room replicate the embed code of associate in nursing existent video, which volition constitute insert indium the
To have the embed connect of the YouTube video, be these simple tone :

  1. Open the video on YouTube and click the share button.
  2. Open the Embed code.
  3. Copy the Source link.

a you copy the embed link you toilet cut-in information technology into your hypertext markup language document american samoa the src of your

Example of inserting a video from Youtube using the

 
 < 

html

> <

head

> <

title

>Title of the document < p class= '' hljs-name '' claim>

< phosphorus class= '' hljs-name '' head>
<

body

>
<

h2

>Steve Jobs – How to Live before You Die < phosphorus class= '' hljs-name '' h2>
<

p

>At his Stanford University commencement speech, Steve Jobs, CEO and co-founder of Apple and Pixar, urges us to pursue our dreams and see the opportunities in life’s setbacks – including death itself. < p class= '' hljs-name '' p>
<

iframe

width

=

“500”

height

=

“320”

src

=

“https://www.youtube.com/embed/lcZDWo6hiuI”

>
< p class= '' hljs-name '' iframe>
< phosphorus class= '' hljs-name '' body

>
< p class= '' hljs-name '' hypertext markup language>
Try it Yourself »

source : https://thaitrungkien.com
category : Tutorial

Related Posts

Trả lời

Email của bạn sẽ không được hiển thị công khai.