AI-generated Key Takeaways
-
The
PlayerDataBinder
class binds a player data object to the current player state, updating the data to reflect the state without triggering change events. -
It provides methods to add and remove listeners for player data changes, allowing developers to react to specific events.
-
The
addEventListener
method enables listening for various player data changes, including any change usingcast.framework.ui.PlayerDataEventType.ANY_CHANGE
. -
The
removeEventListener
method allows removing previously registered listeners for player data changes.
cast.framework.ui. PlayerDataBinder
The player data binder. This binds a player data object to the player state. The player data is updated to accurately reflect the current player state without firing any change events.
Constructor
PlayerDataBinder
new PlayerDataBinder(playerData)
Parameter |
|
---|---|
playerData |
(non-null Object or non-null cast.framework.ui.PlayerData) The object to bind to the current player state. The Object attributes (See cast.framework.ui.PlayerData for details) are updated to reflect the player state without firing a change event. |
Methods
addEventListener
addEventListener(type, listener)
Adds a listener for player data changes.
Parameter |
|
---|---|
type |
cast.framework.ui.PlayerDataEventType The event type.
Use Value must not be null. |
listener |
function(non-null cast.framework.ui.PlayerDataChangedEvent) |
removeEventListener
removeEventListener(type, listener)
Removes a listener to player data changes.
Parameter |
|
---|---|
type |
cast.framework.ui.PlayerDataEventType The event type. Value must not be null. |
listener |
function(non-null cast.framework.ui.PlayerDataChangedEvent) |