A quick introduction to using video on the web, how to export it, and where to upload it.
Video
Host your video on a dedicated video platform like YouTube or Vimeo as a first choice
But, hosting video yourself gives you more control
You’ll wreck your repo & won’t be able to sync
If you want to self-host video you need to put it onto a Content Delivery Network
KeyCDN† is easy to set up and works really well (This whole website is on KeyCDN)
Only one format will work reliably in all browsers: MPEG-4, H.264 encoding
Unlike many web features this isn’t open source—all browsers pay exorbitant fees to let you watch video
Adobe Media Encoder
Handbrake is a wonderful open source alternative
<!-- The <video> tag for self-hosted videos --> <video controls src="https://assets.learntheweb.courses/web-dev-5/liftoff-of-spacex-crs-5.mp4"></video>
<!-- Embed containers make <video> responsive --> <div class="embed embed-16by9"> <video class="embed-item" controls src="https://assets.learntheweb.courses/web-dev-5/liftoff-of-spacex-crs-5.mp4"></video> </div>
<div class="embed embed-16by9"> <video id="my-video" class="embed-item" src="https://assets.learntheweb.courses/web-dev-5/liftoff-of-spacex-crs-5.mp4"></video> </div> <button id="my-button">Play/Pause</button>
var myVideo = $('#my-video').get(0); $('#my-button').on('click', function () { if (myVideo.paused) { myVideo.play(); } else { myVideo.pause(); } });