Package com.castlabs.android.player
Class AmLogicPlayerPlugin
java.lang.Object
com.castlabs.android.player.AmLogicPlayerPlugin
- All Implemented Interfaces:
PlayerPlugin
Player plugin for AmLogic devices.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.castlabs.android.player.PlayerPlugin
PlayerPlugin.DrmInitDataProvider<T extends com.google.android.exoplayer2.offline.FilterableManifest>
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AmLogicPlayerPlugin
(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateDrmInitDataProvider
(ManifestModifier manifestModifier) Creates aPlayerPlugin.DrmInitDataProvider
instance.com.google.android.exoplayer2.source.MediaSource
createMediaSource
(PlayerConfig config, boolean attachInitialPositionProvider, PlayerController playerController) Create the content media source based on the supplied path and thePlayerController
createRendererContainers
(PlayerController playerController, DrmConfiguration drmConfiguration) Create the list of renderer containers based on the suppliedDrmConfiguration
andPlayerController
com.google.android.exoplayer2.RendererCapabilities[]
getRendererCapabilities
(Context context, DrmConfiguration drmConfiguration) Retrieve array of supported RendererCapabilities.boolean
isFormatSupported
(int format, DrmConfiguration configuration) Check if this plugin can create a player for the given content format and DRM configuration.void
removeWVCASLicense
(String lic) Removes the Widevine CAS license.void
setDispatcher
(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Sets the event dispatcher for IPTV analytics.void
setRtpQueueSizeInPackets
(int rtpQueueSizeInPackets) Sets the RTP queue size in packets.
-
Constructor Details
-
AmLogicPlayerPlugin
public AmLogicPlayerPlugin()Default constructor. -
AmLogicPlayerPlugin
public AmLogicPlayerPlugin(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Constructor.- Parameters:
dispatcher
- Event dispatcher for IPTV analytics.
-
-
Method Details
-
setDispatcher
public void setDispatcher(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Sets the event dispatcher for IPTV analytics.- Parameters:
dispatcher
- Event dispatcher.
-
setRtpQueueSizeInPackets
public void setRtpQueueSizeInPackets(int rtpQueueSizeInPackets) Sets the RTP queue size in packets.- Parameters:
rtpQueueSizeInPackets
- RTP queue size in packets.
-
removeWVCASLicense
Removes the Widevine CAS license.- Parameters:
lic
- License string.
-
isFormatSupported
Description copied from interface:PlayerPlugin
Check if this plugin can create a player for the given content format and DRM configuration.- Specified by:
isFormatSupported
in interfacePlayerPlugin
- Parameters:
format
- the content format (one ofSdkConsts.CONTENT_TYPE_UNKNOWN
,SdkConsts.CONTENT_TYPE_DASH
,SdkConsts.CONTENT_TYPE_HLS
,SdkConsts.CONTENT_TYPE_SMOOTHSTREAMING
, orSdkConsts.CONTENT_TYPE_MP4
)configuration
- the drm configuration- Returns:
- true if this plugin can create a player for the given content format and drm configuration
-
getRendererCapabilities
@Nullable public com.google.android.exoplayer2.RendererCapabilities[] getRendererCapabilities(@NonNull Context context, @Nullable DrmConfiguration drmConfiguration) Description copied from interface:PlayerPlugin
Retrieve array of supported RendererCapabilities.- Specified by:
getRendererCapabilities
in interfacePlayerPlugin
- Parameters:
context
- the contextdrmConfiguration
- the drm configuration- Returns:
- RendererCapabilities array supported by the player plugin or null
-
createDrmInitDataProvider
@Nullable public PlayerPlugin.DrmInitDataProvider createDrmInitDataProvider(ManifestModifier manifestModifier) Description copied from interface:PlayerPlugin
Creates aPlayerPlugin.DrmInitDataProvider
instance.- Specified by:
createDrmInitDataProvider
in interfacePlayerPlugin
- Parameters:
manifestModifier
- The manifest modifier.- Returns:
- The created
PlayerPlugin.DrmInitDataProvider
or null if not supported.
-
createMediaSource
@RequiresApi(api=19) @NonNull public com.google.android.exoplayer2.source.MediaSource createMediaSource(@NonNull PlayerConfig config, boolean attachInitialPositionProvider, @NonNull PlayerController playerController) Description copied from interface:PlayerPlugin
Create the content media source based on the supplied path and thePlayerController
- Specified by:
createMediaSource
in interfacePlayerPlugin
- Parameters:
config
- ThePlayerConfig
attachInitialPositionProvider
- Whether toattach the initial position provider to the media sourceplayerController
- ThePlayerController
instance- Returns:
- The media source
-
createRendererContainers
@NonNull public List<TrackRendererPlugin.TrackRendererContainer> createRendererContainers(@NonNull PlayerController playerController, @Nullable DrmConfiguration drmConfiguration) throws CastlabsPlayerException Description copied from interface:PlayerPlugin
Create the list of renderer containers based on the suppliedDrmConfiguration
andPlayerController
- Specified by:
createRendererContainers
in interfacePlayerPlugin
- Parameters:
playerController
- ThePlayerController
instancedrmConfiguration
- TheDrmConfiguration
, might benull
- Returns:
- The list of renderer containers
- Throws:
CastlabsPlayerException
- when render containers can not be created or an error occurs
-