Package com.castlabs.android.player
Class IPTVPlayerPlugin
java.lang.Object
com.castlabs.android.player.IPTVPlayerPlugin
- All Implemented Interfaces:
PlayerPlugin
A player plugin implementation for IPTV content.
This plugin handles the creation and configuration of media sources and renderers
for IPTV streams, including support for CAS (Conditional Access System) and DRM.
-
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
ConstructorsConstructorDescriptionCreates a new IPTV player plugin with default settings.IPTVPlayerPlugin(boolean playsClearWithExo) Creates a new IPTV player plugin with the specified clear playback mode.IPTVPlayerPlugin(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Creates a new IPTV player plugin with the specified event dispatcher. -
Method Summary
Modifier and TypeMethodDescriptioncreateDrmInitDataProvider(ManifestModifier manifestModifier) Creates aPlayerPlugin.DrmInitDataProviderinstance.com.google.android.exoplayer2.source.MediaSourcecreateMediaSource(PlayerConfig config, boolean attachInitialPositionProvider, PlayerController playerController) Create the content media source based on the supplied path and thePlayerControllercreateRendererContainers(PlayerController playerController, DrmConfiguration drmConfiguration) Create the list of renderer containers based on the suppliedDrmConfigurationandPlayerControllercom.google.android.exoplayer2.RendererCapabilities[]getRendererCapabilities(Context context, DrmConfiguration drmConfiguration) Retrieve array of supported RendererCapabilities.booleanisFormatSupported(int format, DrmConfiguration configuration) Check if this plugin can create a player for the given content format and DRM configuration.voidremoveWVCASLicense(String lic) Removes a Widevine CAS license.voidsetDiscontiniuityThreshold(long discontinuityThreshold) Sets the discontinuity threshold for stream synchronization.voidsetDispatcher(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Sets the event dispatcher for analytics events.voidsetIgnoreDataTillVideoKeyframe(boolean ignoreDataTillVideoKeyframe) Sets whether to ignore data until a video keyframe is received.voidsetRtpQueueSizeInPackets(int rtpQueueSizeInPackets) Sets the RTP queue size in packets.voidsetTransferListener(com.google.android.exoplayer2.upstream.TransferListener transferListener) Sets the transfer listener for monitoring data transfer events.
-
Constructor Details
-
IPTVPlayerPlugin
public IPTVPlayerPlugin(boolean playsClearWithExo) Creates a new IPTV player plugin with the specified clear playback mode.- Parameters:
playsClearWithExo- Whether to use ExoPlayer for clear content playback
-
IPTVPlayerPlugin
public IPTVPlayerPlugin()Creates a new IPTV player plugin with default settings. -
IPTVPlayerPlugin
public IPTVPlayerPlugin(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Creates a new IPTV player plugin with the specified event dispatcher.- Parameters:
dispatcher- The event dispatcher to use for analytics events
-
-
Method Details
-
setDispatcher
public void setDispatcher(com.google.android.exoplayer2.analytics.IptvAnalyticsListener.EventDispatcher dispatcher) Sets the event dispatcher for analytics events.- Parameters:
dispatcher- The event dispatcher to use
-
setRtpQueueSizeInPackets
public void setRtpQueueSizeInPackets(int rtpQueueSizeInPackets) Sets the RTP queue size in packets.- Parameters:
rtpQueueSizeInPackets- The number of packets to buffer in the RTP queue
-
setDiscontiniuityThreshold
public void setDiscontiniuityThreshold(long discontinuityThreshold) Sets the discontinuity threshold for stream synchronization.- Parameters:
discontinuityThreshold- The threshold in microseconds
-
setIgnoreDataTillVideoKeyframe
public void setIgnoreDataTillVideoKeyframe(boolean ignoreDataTillVideoKeyframe) Sets whether to ignore data until a video keyframe is received.- Parameters:
ignoreDataTillVideoKeyframe- true to ignore data until keyframe, false otherwise
-
removeWVCASLicense
Removes a Widevine CAS license.- Parameters:
lic- The license to remove
-
isFormatSupported
Description copied from interface:PlayerPluginCheck if this plugin can create a player for the given content format and DRM configuration.- Specified by:
isFormatSupportedin 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:PlayerPluginRetrieve array of supported RendererCapabilities.- Specified by:
getRendererCapabilitiesin 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:PlayerPluginCreates aPlayerPlugin.DrmInitDataProviderinstance.- Specified by:
createDrmInitDataProviderin interfacePlayerPlugin- Parameters:
manifestModifier- The manifest modifier.- Returns:
- The created
PlayerPlugin.DrmInitDataProvideror 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:PlayerPluginCreate the content media source based on the supplied path and thePlayerController- Specified by:
createMediaSourcein interfacePlayerPlugin- Parameters:
config- ThePlayerConfigattachInitialPositionProvider- Whether toattach the initial position provider to the media sourceplayerController- ThePlayerControllerinstance- Returns:
- The media source
-
createRendererContainers
@NonNull public List<TrackRendererPlugin.TrackRendererContainer> createRendererContainers(@NonNull PlayerController playerController, @Nullable DrmConfiguration drmConfiguration) throws CastlabsPlayerException Description copied from interface:PlayerPluginCreate the list of renderer containers based on the suppliedDrmConfigurationandPlayerController- Specified by:
createRendererContainersin interfacePlayerPlugin- Parameters:
playerController- ThePlayerControllerinstancedrmConfiguration- TheDrmConfiguration, might benull- Returns:
- The list of renderer containers
- Throws:
CastlabsPlayerException- when render containers can not be created or an error occurs
-
setTransferListener
public void setTransferListener(com.google.android.exoplayer2.upstream.TransferListener transferListener) Sets the transfer listener for monitoring data transfer events.- Parameters:
transferListener- The transfer listener to use
-