-
Notifications
You must be signed in to change notification settings - Fork 51
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
fix(FEC-8298): SOURCE_SELECTED event triggered before the UI ready when the source provided manually #129
Conversation
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.
@yairans I think we better just differentiate this use case of sources
provided in the setup
call.
IMO we need to separate the sources
from rest of config, call the player with all other settings and then call configure
with the sources
after UI is initialized.
UI relies on certain things in player as well so it's better the player is configured in advance.
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.
@yairans I think we better just differentiate this use case of sources
provided in the setup
call.
IMO we need to separate the sources
from rest of config, call the player with all other settings and then call configure
with the sources
after UI is initialized.
UI relies on certain things in player as well so it's better the player is configured in advance.
… source provided manually
@@ -40,13 +40,16 @@ class KalturaPlayer extends FakeEventTarget { | |||
constructor(options: KPOptionsObject) { | |||
super(); | |||
this._eventManager = new EventManager(); | |||
this._localPlayer = loadPlayer(options); | |||
const {sources} = options; |
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.
what happens if sources
doesn't exist? what is the 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.
we have default sources object
this._logger = getLogger('KalturaPlayer' + Utils.Generator.uniqueId(5)); | ||
this._uiWrapper = new UIWrapper(this, options); | ||
this._provider = new Provider(options.provider, __VERSION__); | ||
this._playlistManager = new PlaylistManager(this, options); | ||
this._playlistManager.configure(options.playlist); | ||
Object.values(CoreEventType).forEach(coreEvent => this._eventManager.listen(this._localPlayer, coreEvent, e => this.dispatchEvent(e))); | ||
this._localPlayer.configure({sources}); |
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.
check if sources exist, don't call if it's null/undefined
Description of the Changes
postpone the
sources
config after the ui initializationCheckLists