Change HTML5 video’s quality from JavaScript

后端 未结 2 1463
星月不相逢
星月不相逢 2021-02-05 10:28

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?

2条回答
  •  借酒劲吻你
    2021-02-05 10:53

    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

提交回复
热议问题