Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the resolution automatically? #121

Open
clyde1021 opened this issue Jul 17, 2018 · 2 comments
Open

How to change the resolution automatically? #121

clyde1021 opened this issue Jul 17, 2018 · 2 comments

Comments

@clyde1021
Copy link

I would like to know if there is a way to automatically change the video resolution according to the bandwidth? Kind of like on Youtube with the "auto" resolution?

@cinques
Copy link

cinques commented Dec 17, 2018

You need videojs 7.xx and HLS technology on the server

@kellertobias
Copy link

at least in chrome, you don't need HLS. you can use the NetworkConnection framework.

We also use this:

connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
connectionType = connection.effectiveType
downlinkMax = navigator.connection.downlinkMax || navigator.connection.downlink
dataSaving = navigator.connection.saveData || false

if (dataSaving) return 'low'
if(not downlinkMax) return 'low'
// now distinguish your resolution based on your video profiles and the downlinkMax (in Mbps)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants