Class VisualComponentProxy

java.lang.Object
com.castlabs.android.player.VisualComponentProxy
All Implemented Interfaces:
PlayerControllerPlugin.Component, PlayerControllerPlugin.ComponentViewListener, PlayerControllerPlugin.VisualComponent
Direct Known Subclasses:
ExoSubtitlesRendererPlugin.ExoSubtitleComponent

public abstract class VisualComponentProxy extends Object implements PlayerControllerPlugin.VisualComponent
VisualComponent whose task is to communicate a PlayerControllerPlugin.ComponentViewListener with the PlayerControllerPlugin.Component machinery.

Here we forward the events to a PlayerControllerPlugin.ComponentViewListener. Thus giving it a chance to update its inner View.

We also take care of async calls. For instance, the SubtitlesTrackRenderer will set the listener in its createRenderer() call. This is too late, for instance in the case where the client code uses PlayerController.scanComponentViews(ViewGroup). In this case, we would be called scanComponentViews(ViewGroup) before having a componentsViewListener.

That's why we save the ViewGroup and forward the pending call to the listener as soon as it is set.

Users of this Class should implement the PlayerControllerPlugin.Component.id() method returning the concrete Class's class. This is why you should *not* create anonymous concrete Classes.

Since:
4.2.2