videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.95k stars 7.43k forks source link

Download/stream video in chunks with quality selecton #5352

Closed papigers closed 6 years ago

papigers commented 6 years ago

This isn't really a bug, more of a feature request/question. I want to create a video streaming website, like youtube and I've been stuck on 2 requirements which I'm not sure if videojs solves or not.

  1. Say there's a 1-hour video, I want the video to be downloaded and streamed in chunks, and not the whole file. I've seen that streaming format like HLS and DASH, solves that (looking on the network tab of chrome, I see chunks downloaded as the video plays). But on the other hand, I think it prevents my 2nd requirement.
  2. Different quality selection. I was looking into videojs-contrib-hls and saw and by looking in the demo and the adaptive bitrate switching documentation, it seems that the quality of the video is chosen automatically by some policy (which can be overridden), but cannot be chosen specifically by the user.

I was wondering if maybe I'm not understanding things correctly? Are browsers smart enough to achieve my 1st requirement on their own?

Any help would be welcomed :D

gkatsev commented 6 years ago

HLS or DASH does sound like the way to go. ABR is still definitely useful and most users prefer that, though, some (I'm one of them) do want to pin to a particular version sometimes.

Contrib-hls has been replaced by videojs/http-streaming (VHS for short), but both support videojs-contrib-quality-levels. Using this API you can select which rendition should play. There isn't an official selector UI for it but I've found https://www.npmjs.com/package/videojs-http-source-selector or https://www.npmjs.com/package/videojs-hls-quality-selector which works decently well or you can create your own UI based on the API in contrib-quality-levels.

Also, feel free to drop by our slack.

Hope this helps!

papigers commented 6 years ago

Seems like you've solved all my problems :) Thanks, I'm closing this now.

gkatsev commented 6 years ago

You're welcome!

mohitmca01 commented 3 years ago

@gkatsev could u please help or guide me how may play video from file server in mvc application using jquery in chunk or without streaming like hotstar, netflix etc.

please guide me if you have any solution for my problem.