-
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
Feature/current source #2678
Feature/current source #2678
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2076,7 +2076,15 @@ class Player extends Component { | |
* @method currentSources | ||
*/ | ||
currentSources() { | ||
return this.cache_.sources || [this.currentSource()]; | ||
const source = this.currentSource(); | ||
const sources = []; | ||
|
||
// assume `{}` or `{ src }` | ||
if (Object.keys(source).length !== 0) { | ||
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. seemed like a fine 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. Agreed. I don't know if it's merged yet, but I introduced |
||
sources.push(source); | ||
} | ||
|
||
return this.cache_.sources || sources; | ||
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. should we do the work of setting up the 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. Do you know off the top of your head that I most likely implemented this to follow suit of the original implementation—thinking that there will be a difference between I can investigate further if unknown. 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. I'm not sure this is a big concern. It's fine to leave as is and we can always profile and increase performance in the future. |
||
} | ||
|
||
/** | ||
|
@@ -2086,7 +2094,14 @@ class Player extends Component { | |
* @method currentSource | ||
*/ | ||
currentSource() { | ||
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. updated to return |
||
return this.cache_.source || { src: this.currentSrc() }; | ||
const source = {}; | ||
const src = this.currentSrc(); | ||
|
||
if (src) { | ||
source.src = src; | ||
} | ||
|
||
return this.cache_.source || source; | ||
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. same question here. |
||
} | ||
|
||
/** | ||
|
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.
updated to return
[]
when src is''