0
votes

I have 4 versions of a video and they're hosted on the server like this:

/1920x1080.mp4

/1280x720.mp4

/640x480.mp4

/426x240.mp4

The videos are using the HTTP 206 partial content for streaming.

I want to make so that you can change the video quality from a small menu bellow like on youtube or twitch without the player having to reload or change the video source. Is this possible with HTML5 video if it is how?

Also please answer if there are other ways to achieve this.

1

1 Answers

0
votes

I want to make so that you can change the video quality from a small menu bellow like on youtube or twitch without the player having to reload or change the video source. Is this possible with HTML5 video if it is how?

Yes, Its is possible with mp4, but extremely complex, and beyond the scope of what I can explain here, especially if the keyframes are not aligned.

So how does YouTube ad twitch do it? They dont use mp4s. The use segmented streaming protocols such as DASH or HLS, then use a player that supports changing resolution like hls.js or video.js.