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

Make global options a simple property #2461

Closed
wants to merge 3 commits into from

Conversation

dmlap
Copy link
Member

@dmlap dmlap commented Aug 11, 2015

Remove getters and setters for the global options because they imply a contract that we were violating all over the place. Remove Player.players because it was just an alias for videojs.getPlayers(). Convert mergeOptions() so that it does not mutate its first option to follow 4.x behavior.

@dmlap
Copy link
Member Author

dmlap commented Aug 11, 2015

Obsoletes #2418

@pam
Copy link

pam commented Aug 11, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: f377fb042fb532f1d3aedd042e3c5ebf29c19fdc
Build details: https://travis-ci.org/pam/video.js/builds/75111065

(Please note that this is a fully automated comment.)

@@ -1,15 +1,12 @@
/**
* @file global-options.js
* @file default-options.js
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file becomes the record of the initial video.js defaults. The global defaults currently active are always accessible at videojs.options.

@pam
Copy link

pam commented Aug 11, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 30849709098d2a2fc73874b68800ac3d571bf002
Build details: https://travis-ci.org/pam/video.js/builds/75114105

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Aug 11, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 52ac8c6f0ed63773ef97d3c62eb1469a0257f0ba
Build details: https://travis-ci.org/pam/video.js/builds/75178330

(Please note that this is a fully automated comment.)

@@ -17,7 +17,8 @@ import { createTimeRange } from './utils/time-ranges.js';
import { bufferedPercent } from './utils/buffer.js';
import FullscreenApi from './fullscreen-api.js';
import MediaError from './media-error.js';
import globalOptions from './global-options.js';
import videojs from './video.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates a circular dependency between player.js and video.js.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does but videojs isn't referenced until a player is created, which is safe by then.

@heff
Copy link
Member

heff commented Aug 11, 2015

To summarize the code code comments, I'm good with going back to an object and I think the object should just live at Player.prototype.options_, since that's what it really is, and then we can do videojs.options = Player.prototype.options_; in video.js.

This PR currently spreads a lot of videojs around though, which undoes some of the effort to remove global dependencies, so I'd be interested to know why that was needed.


const players_ = {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Players still get added to Player.players when they're initialized, so right now this would always be empty.

@pam
Copy link

pam commented Aug 12, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 0ff1fced942724c4c507605025c7ce6501cf8129
Build details: https://travis-ci.org/pam/video.js/builds/75285013

(Please note that this is a fully automated comment.)

@pam
Copy link

pam commented Aug 12, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 0f7367fa9c3612960a70e4c27b94765c33ff3b0f
Build details: https://travis-ci.org/pam/video.js/builds/75288738

(Please note that this is a fully automated comment.)

flash: {},

// defaultVolume: 0.85,
defaultVolume: 0.00, // The freakin seaguls are driving me crazy!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the default volume intended to be 0?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default volume was removed at some point but this got left behind. It can be removed.

Remove getters and setters for the global options because they imply a contract that we were violating all over the place. Convert mergeOptions() so that it does not mutate its first option to follow 4.x behavior.
Make sure the default language is used if no language was specified in the player construction options.
Add a note about the organization of player.test.js. Use Player.players instead of videojs.getPlayers() in the player tests. Don't create an unnecessary object during merges.
@pam
Copy link

pam commented Aug 12, 2015

Tests failed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: BUSTED

Commit: 729152e
Build details: https://travis-ci.org/pam/video.js/builds/75338157

(Please note that this is a fully automated comment.)

@dmlap dmlap closed this in fecf3a0 Aug 12, 2015
@heff heff mentioned this pull request Aug 12, 2015
@dmlap dmlap deleted the make-globals-a-global branch August 13, 2015 00:21
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.

4 participants