Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change HTML5 video’s quality from JavaScript

In YouTube, we can change the quality of the video from a dropdown like 360p, 144p, 240p, etc. Can we do the same with HTML5 video element from JavaScript?

like image 820
tenstar Avatar asked Jul 12 '13 12:07

tenstar


1 Answers

Manual selection of quality is just a matter of:

  1. Saving the currentTime in a variable
  2. setting the video src to the URL of a different video (with the same content at a different quality)
  3. Setting the currentTime to the value in the variable
  4. Playing the video
like image 175
Quentin Avatar answered Oct 06 '22 01:10

Quentin