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

feat: Add useBandwidthFromLocalStorage option #275

Merged
merged 5 commits into from
Nov 13, 2018

Conversation

gesinger
Copy link
Contributor

Description

Replaces videojs/videojs-contrib-hls#1142

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

return null;
}

return JSON.parse(storedObject);
Copy link
Member

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.

return null;
}

const storedObject = window.localStorage.getItem('videojs-vhs');
Copy link
Member

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) {
Copy link
Contributor

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_

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor

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

@forbesjo forbesjo changed the title Add useBandwidthFromLocalStorage option feat: Add useBandwidthFromLocalStorage option Nov 1, 2018
Copy link
Contributor

@forbesjo forbesjo left a 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

@gesinger gesinger merged commit 60c88ae into videojs:master Nov 13, 2018
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

Successfully merging this pull request may close these issues.

3 participants