• Home
  • SEM
    • PPC
    • SEO
    • How To
  • Bangladesh
  • School
    • HTTP
    • REP
    • Bots n’ htaccess
    • Source Code
    • Excel 2010
    • HTML XHTML Entities
    • Gmail Operators
    • HTML & ASCII
  • About
    • Privy
    • About This Blog
  • Contact
  • বাংলা

Saidul Hassan

Digital Marketing Evangelist

Home / School / HTML5 Video Embedding

HTML5 Video Embedding

27 Sep, 2020 By Saidul Hassan · Filed Under: School

With YouTube reigning the universe, there’s really random cases where you might need to host your videos by yourselves. Also converting videos to different formats for maximum compatibilities is difficult, time consuming, even sometimes costly. 

BrowserMP4WebMOgg
Chrome☑☑☑
Firefox☑☑☑
Safari☑☑☒
Edge☑☑☑
Opera☑☑☑
Browser support for video formats

HTML Video element <video> is used to embed a media player to load and play video in webpages. Even an audio files can be payed using the <video> tag, tough more appropriate way is to use the <audio> tag. Typical video tag contains video start tag, source tag, and the text between the tags to be displayed in browsers that do not support the <video> tag. Multiple source tags are used so the browser can choose the proper source. A typical <video> element is like this:

<video width="480" height="270" autoplay controls>
  <source src="/blog/wp-content/uploads/2020/09/flower.mp4" type="video/mp4">
  <source src="/blog/wp-content/uploads/2020/09/flower.webm" type="video/webm">
Sorry, your browser does not support HTML embedded videos.
</video>
Sorry, your browser does not support HTML embedded videos.

However, using JavaScript, videos can be loaded like this with advanced customizations:



Your browser does not support HTML video.

This is embedding YouTube video:

Same video with different settings:

And this one is with autoplay but muted. Chrome does not allow autoplay in all cases. However, muted autoplay is always allowed.

Learn more about YouTube Embedded Players and Player Parameters at Google Developers.

More on HTML5 Video embed element at MDN web docs.

The following two tabs change content below.
  • Bio
  • Latest Posts
My Twitter profileMy Facebook profileMy LinkedIn profileMy Instagram profileMy Pinterest profile

Saidul Hassan

Managing Partner at Up Arrow Consulting
COO at Up Arrow Consulting, MCC manager, & Technical SEO consultant. Certified Google Partners and Microsoft Bing Ads Accredited Professional, Python enthusiast, wannabe SysAdmin. Graduated from School of Management & Business Administration (SOMBA), Khulna University.
My Twitter profileMy Facebook profileMy LinkedIn profileMy Instagram profileMy Pinterest profile

Latest posts by Saidul Hassan (see all)

  • Batch script to create directories & moving fixed number of files to those directories - 30 Apr, 2021
  • How to use PrismJS syntax highlighter on WordPress without plugin - 30 Mar, 2020
  • Download an Entire Website for Offline Viewing - 26 Nov, 2019

Share:

  • Twitter
  • Facebook
  • LinkedIn
  • Pinterest
  • Pocket
  • Email
  • Print

First published on 30 Sep, 2013 · Last updated 27 Sep, 2020 · Tagged With: HTML5, Loop, Video

Batch script to create directories & moving fixed number of files to those directories

30 Apr, 2021 By Saidul Hassan

How to use PrismJS syntax highlighter on WordPress without plugin

30 Mar, 2020 By Saidul Hassan

Download an Entire Website for Offline Viewing

26 Nov, 2019 By Saidul Hassan

How to color highlight .htaccess files in Xed/Gedit

20 Aug, 2018 By Saidul Hassan

HMA Pro VPN Setup for Multiple Locations without User/Password Every time in Linux CLI

14 May, 2018 By Saidul Hassan

  • ♥ Bangladesh ♥
    Log in · Privacy Policy · Contact
    Copyright © 2011 Saidul Hassan

  • DMCA