-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Deprecate options #2229
Closed
Closed
Deprecate options #2229
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
625ac0a
added deprecation warning to component.options() and removed getter r…
mmcc c8a9a54
switched over to adding playerOptions to child options objects
mmcc ff6673d
removed all options() calls from test suite
mmcc cddcaf5
merge with an empty object for clarity
mmcc cd3c6de
Fixed broken return statement
mmcc 00e8d98
check for undefined options.persistTextTrackSettings
mmcc e2dbf44
Ensure component options get priority and pass playerOptionsCopy to p…
mmcc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,10 @@ class Player extends Component { | |
}, this); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: let's add player options to plugin options also, for the same reasons |
||
} | ||
|
||
// We also want to pass the original player options to each component as well so they don't need to | ||
// reach back into the player for options later. | ||
this.options_.playerOptions = mergeOptions(options, this.options_); | ||
|
||
this.initChildren(); | ||
|
||
// Set isAudio based on whether or not an audio tag was used | ||
|
@@ -1554,7 +1558,7 @@ class Player extends Component { | |
} else { | ||
// We need to wrap this in a timeout to give folks a chance to add error event handlers | ||
this.setTimeout( function() { | ||
this.error({ code: 4, message: this.localize(this.options()['notSupportedMessage']) }); | ||
this.error({ code: 4, message: this.localize(this.options_['notSupportedMessage']) }); | ||
}, 0); | ||
|
||
// we could not find an appropriate tech, but let's still notify the delegate that this is it | ||
|
@@ -1917,7 +1921,7 @@ class Player extends Component { | |
// Clear any existing inactivity timeout to start the timer over | ||
this.clearTimeout(inactivityTimeout); | ||
|
||
var timeout = this.options()['inactivityTimeout']; | ||
var timeout = this.options_['inactivityTimeout']; | ||
if (timeout > 0) { | ||
// In <timeout> milliseconds, if no more activity has occurred the | ||
// user will be considered inactive | ||
|
@@ -2117,7 +2121,7 @@ class Player extends Component { | |
} | ||
|
||
toJSON() { | ||
let options = mergeOptions(this.options()); | ||
let options = mergeOptions(this.options_); | ||
let tracks = options.tracks; | ||
|
||
options.tracks = []; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We might want to consider bringing in util-deprecate so warnings are only logged once. Not required for this PR.