-
Notifications
You must be signed in to change notification settings - Fork 428
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
feat: Add useBandwidthFromLocalStorage option #275
feat: Add useBandwidthFromLocalStorage option #275
Conversation
src/videojs-http-streaming.js
Outdated
return null; | ||
} | ||
|
||
return JSON.parse(storedObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this probably needs to be try/catched as well as it's possible someone tampered with the value.
src/videojs-http-streaming.js
Outdated
return null; | ||
} | ||
|
||
const storedObject = window.localStorage.getItem('videojs-vhs'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use LOCAL_STORAGE_KEY
@@ -569,6 +632,15 @@ class HlsHandler extends Component { | |||
this.tech_.one('canplay', | |||
this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)); | |||
|
|||
this.tech_.on('bandwidthupdate', () => { | |||
if (this.options_.useBandwidthFromLocalStorage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to add an explicit default value for useBandwidthFromLocalStorage
in setOptions_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason to set an explicit default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for code as documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to see all option defaults live in an object somewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Description
Replaces videojs/videojs-contrib-hls#1142
Requirements Checklist