-
- All Implemented Interfaces:
-
com.glia.androidsdk.comms.Media
public class MediaManager implements Media
-
-
Field Summary
Fields Modifier and Type Field Description public final static intDEBOUNCE_TIME
-
Constructor Summary
Constructors Constructor Description MediaManager(EngagementTracker engagementTracker, ApiDeps apiDeps, GliaEnvironment env)
-
Method Summary
Modifier and Type Method Description <T> voidon(Media.MediaEvent<T> event, Consumer<T> listener)Registers event listeners for Media. <T> voidoff(Media.MediaEvent<T> event, Consumer<T> listener)Removes event listeners from Media. <T> voidoff(Media.MediaEvent<T> event)Removes all event listeners from Media. voidstop(String reason)-
-
Constructor Detail
-
MediaManager
MediaManager(EngagementTracker engagementTracker, ApiDeps apiDeps, GliaEnvironment env)
-
-
Method Detail
-
on
<T> void on(Media.MediaEvent<T> event, Consumer<T> listener)
Registers event listeners for Media.
If a listener is added while the event is being processing,it is not triggered with the current event.
If multiple identical listeners are registered on the same event typethe duplicate instances are discarded. They do not cause the listenerto be called twice and do not need to be removed with the off or off method.
- Parameters:
event- One of Eventslistener- Event listener to register
-
off
<T> void off(Media.MediaEvent<T> event, Consumer<T> listener)
Removes event listeners from Media.
If a listener is removed while the event is being processing,it is not triggered with the current event.
Calling
{@code off}with arguments which do not identify any currently registeredlistener has no effect.- Parameters:
event- One of Eventslistener- Event listener to remove
-
off
<T> void off(Media.MediaEvent<T> event)
Removes all event listeners from Media.
Behaves the same way as off but removes all listeners of specified type
- Parameters:
event- One of Events
-
-
-
-