Class APSMediaPlayerButtonOverlayController
java.lang.Object
com.appscend.overlaycontrollers.APSMediaPlayerOverlayController
com.appscend.overlaycontrollers.APSMediaPlayerButtonOverlayController
- All Implemented Interfaces:
KRAdapter, APSMediaPlayerTrackingEventListener
public class APSMediaPlayerButtonOverlayController
extends APSMediaPlayerOverlayController
implements APSMediaPlayerTrackingEventListener
The
APSMediaPlayerButtonOverlayController allows placing a transparent overlay in a specific area of the player surface, that can trigger the launch of a specific URL. The APSMediaPlayer instance will query the actionDelegate object to interpret and launch the specified URL. If the actionDelegate cannot respond to the URL, and the URL has a web scheme (http or https), it will be launched automatically in the in-app web browser.Configuration
To create an APSMediaOverlay of button type:
- set the overlay object’s
typeproperty toAPSButtonOverlay set the overlay object’s
propertiesproperty to aHashMapinvalid input: '<'String, Object>that can have the following keys and values:- kAPSButtonOverlayClickthrough: set this key to a
Stringrepresenting the URL that should be launched when the overlay is tapped. - kAPSButtonOverlayClicktracking: set this key to a
ArrayListofStringobjects that will be tracked by the player when the overlay is tapped (see[APSMediaPlayer track:forEvent:type:]). Note that thekAPSButtonOverlayClickthroughkey must also be set for tracking to happen
- kAPSButtonOverlayClickthrough: set this key to a
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class APSMediaPlayerOverlayController
overlay -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddViewToContainer(android.view.ViewGroup viewGroup) floatgetAlpha()android.view.ViewgetView()voidvoidload(android.content.Context context) Builds the overlay's view.voidvoidonTrackingEventReceived(APSMediaTrackingEvents.MediaEventType type, android.os.Bundle additionalInfo) Called when a player emits an event.type()Methods inherited from class APSMediaPlayerOverlayController
refreshModifier and TypeMethodDescriptionvoidrefresh(android.content.Context context, android.view.ViewGroup viewGroup)
-
Field Details
-
kAPSButtonOverlayClickthrough
- See Also:
-
kAPSButtonOverlayClicktracking
- See Also:
-
APSButtonOverlay
- See Also:
-
kAPSButtonOverlayWebviewDismissAction
- See Also:
-
-
Constructor Details
-
APSMediaPlayerButtonOverlayController
public APSMediaPlayerButtonOverlayController()
-
-
Method Details
-
type
-
load
public void load(android.content.Context context) Description copied from class:APSMediaPlayerOverlayControllerBuilds the overlay's view. When the Activity is recreated the player moves this view to the new one unchanged, so the view must not keep a reference to the Activity it was built with.- Specified by:
loadin classAPSMediaPlayerOverlayController
-
addViewToContainer
public void addViewToContainer(android.view.ViewGroup viewGroup) - Specified by:
addViewToContainerin classAPSMediaPlayerOverlayController
-
getView
public android.view.View getView()- Specified by:
getViewin classAPSMediaPlayerOverlayController
-
getAlpha
public float getAlpha()- Specified by:
getAlphain classAPSMediaPlayerOverlayController
-
hideOverlay
public void hideOverlay()- Specified by:
hideOverlayin classAPSMediaPlayerOverlayController
-
onDestroy
public void onDestroy() -
onTrackingEventReceived
public void onTrackingEventReceived(APSMediaTrackingEvents.MediaEventType type, android.os.Bundle additionalInfo) Description copied from interface:APSMediaPlayerTrackingEventListenerCalled when a player emits an event.- Specified by:
onTrackingEventReceivedin interfaceAPSMediaPlayerTrackingEventListener- Parameters:
type- The type of event getting firedadditionalInfo- A bundle of additional metadata, such as the current position in CLOCK_TICK events
-