Package com.castlabs.android.player
Class PlayerConfig
java.lang.Object
com.castlabs.android.player.PlayerConfig
- All Implemented Interfaces:
Parcelable
Object which represents a specific Player configuration.
You can use a PlayerConfig object to start playback on a PlayerController calling
its PlayerController.open(PlayerConfig) method.
An instance can be built with the PlayerConfig.Builder. The Builder can be populated with
an already existing PlayerConfig or with a Bundle.
It is possible to convert an instance of PlayerConfig toBundle(). This
Bundle can also be used to PlayerController.open(Bundle) the
PlayerController.
This class is Parcelable.
- Since:
- 4.2.1
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AbrConfigurationThe initial video qualityfinal AdRequestThe Ad request (if any)Describes a custom ad schedule.final booleanIf set to true, chunk-less preparation of hls tracks are allowedThe analytics meta-datafinal intAnalytics session typeThe Audio Attributes.final booleanIf true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder.final intThe index of the selected audio track groupfinal intThe index of the selected audio trackfinal booleanWhether to autoplay or notfinal BufferConfigurationThe buffer configurationfinal CasConfigurationCas configuration (if any)final booleanIf true then media periods will be clipped to their durations (currently is only applicable for DASH streams)final longThe clipping end position in microsecondsfinal longThe clipping start position in microsecondsfinal StringOptional configuration backend urlfinal BundleHeader params to add to content (manifest) requestsfinal BundleQuery params to add to content (manifest) requestsfinal intThe content formatfinal StringPlayback urlstatic final Parcelable.Creator<PlayerConfig> Creator for thePlayerConfigclass.final StringDownload folder in case the content is played offlinefinal DrmConfigurationDrm configuration (if any)final booleanThe flag to enable or disable automatic setting of a speed to 1x when playing ads.final booleanEnable internal handling of DASH event callbacksfinal booleanIf set to true then the playback looping will be enabled and the player will automatically restart the playback after reaching end of contentfinal booleanEnable Trickplay mode at the start of the playback.final booleanEnable tunneling supportfinal booleanForce using of tunneling when audio track is disabled.final booleanIf True, the workaround will be enabled to not treat the video frames as sync frames except the very first one.final booleanIf true then DRM init data from segments will be used instead of the one from manifest (currently is only applicable for DASH streams)final StringID for this contentstatic final StringA unique ID for the configurationstatic final StringIntent key to specify an optional URL to an API endpoint that can be used to refresh the configuration.static final StringIndicates live contentstatic final StringAdditional Bundle-formatted meta-data such as poster images, titles, byline and any custom meta-datastatic final StringPreferred media codec infosstatic final StringIndicates 360 degree contentfinal booleanContent live or VoDfinal LiveConfigurationThe Live configurationfinal booleanIf True, the video tracks will be merged into a single video trackfinal BundleOptional metadatafinal NetworkConfigurationThe network configurationfinal booleanEnable or disable automatic pausing on HDMI disconnectedfinal longThe position in microseconds.final StringPreferred audio languagefinal List<MediaCodecInfo> List of preferred MediaCodecInfos.final StringPreferred subtitles languagefinal booleanIf set to true, the playback resources (codecs, renderers) will be preserved when the player player is released.final booleanIf set to true and thePlayerViewis used, the playback surface be kept on screen and preserved when the player player is released.final booleanIf true, indicates if the decoder should push a black screen to the surface when disposed.final booleanThe flag to enable or disable automatic restoring of a speed after playing ads.final BundleHeader params to add to segment requestsfinal BundleQuery params to add to segment requestsfinal List<SideloadedTrack> Array of side-loaded tracks, either subtitles or thumbnailsfinal intThe index of the selected subtitle track group or -1 for if subtitles are disabledfinal intThe index of the selected subtitle track or -1 for if subtitles are disabledfinal intDefines whether the subtitle times are absolute or relative.final boolean360 supportfinal TrickplayConfigurationThe Trickplay configurationfinal booleanIf true (default), allows the player to fallback to unsecure decoders if it failed to initialize the primary decoder.final booleanA boolean flag to indicate to use eth0 for multicast receptionfinal StringUser ID.booleanIf set to true, will use Exoplayer'sStandaloneMediaClockinstead of the Renderer Clock.final intThe video codec filterfinal booleanIf true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder.final VideoFilterConfigurationThe video filter configurationfinal PointDeprecated.final intThe index of the selected video track groupfinal floatThe audio track volumeFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE -
Method Summary
Modifier and TypeMethodDescriptionSet theBuildervalues to the stored values in theBundle.intbooleanstatic intguessFormat(String url) Guess the format of the or returnSdkConsts.CONTENT_TYPE_UNKNOWN.inthashCode()voidSaves the current configuration into aBundle.toBundle()Obtain aBundlefilled with key-value pairs representing the current configuration.voidwriteToParcel(Parcel dest, int flags)
-
Field Details
-
INTENT_CONFIGURATION_URL
Intent key to specify an optional URL to an API endpoint that can be used to refresh the configuration.This is intended only informative purposes, no actual refreshing will be performed by the SDK.
- See Also:
-
INTENT_CONFIGURATION_ID
A unique ID for the configuration- See Also:
-
INTENT_LIVE
Indicates live content- See Also:
-
INTENT_THREESIXTY
Indicates 360 degree content- See Also:
-
INTENT_METADATA
Additional Bundle-formatted meta-data such as poster images, titles, byline and any custom meta-data- See Also:
-
INTENT_PREFERRED_CODEC_INFOS
Preferred media codec infos- See Also:
-
positionUs
public final long positionUsThe position in microseconds. If set,LiveConfiguration.liveEdgeLatencyMswill be ignored. If there's anInitialPositionProvider, it will take precedence over this setting. -
clippingStartUs
public final long clippingStartUsThe clipping start position in microseconds -
clippingEndUs
public final long clippingEndUsThe clipping end position in microseconds -
subtitlesTrackGroupIndex
public final int subtitlesTrackGroupIndexThe index of the selected subtitle track group or -1 for if subtitles are disabled -
subtitlesTrackIndex
public final int subtitlesTrackIndexThe index of the selected subtitle track or -1 for if subtitles are disabled -
audioTrackGroupIndex
public final int audioTrackGroupIndexThe index of the selected audio track group -
audioTrackIndex
public final int audioTrackIndexThe index of the selected audio track -
volume
public final float volumeThe audio track volume -
pauseOnHdmiDisconnected
public final boolean pauseOnHdmiDisconnectedEnable or disable automatic pausing on HDMI disconnected -
videoTrackGroupIndex
public final int videoTrackGroupIndexThe index of the selected video track group -
abrConfiguration
The initial video quality -
bufferConfiguration
The buffer configuration -
liveConfiguration
The Live configuration -
networkConfiguration
The network configuration -
trickplayConfiguration
The Trickplay configuration -
enableTrickplayMode
public final boolean enableTrickplayModeEnable Trickplay mode at the start of the playback.- See Also:
-
enableDashEventCallback
public final boolean enableDashEventCallbackEnable internal handling of DASH event callbacks -
mergeVideoTracks
public final boolean mergeVideoTracksIf True, the video tracks will be merged into a single video track -
enableWorkaroundEveryVideoFrameIsSyncFrame
public final boolean enableWorkaroundEveryVideoFrameIsSyncFrameIf True, the workaround will be enabled to not treat the video frames as sync frames except the very first one. This flag may be needed to set up when the metadata of a video frame reports the video frame to be a sync frame (which is not in fact) but should not be treated as a sync frame by the decoder i.e. without the workaround the video artifacts appear upon every playback start and seek until the real key frame is rendered. -
clipPeriods
public final boolean clipPeriodsIf true then media periods will be clipped to their durations (currently is only applicable for DASH streams) -
forceInStreamDrmInitData
public final boolean forceInStreamDrmInitDataIf true then DRM init data from segments will be used instead of the one from manifest (currently is only applicable for DASH streams) -
videoCodecFilter
public final int videoCodecFilterThe video codec filter -
videoSizeFilter
Deprecated.UseVideoFilterConfiguration.maxPixelinstead.The video size filter -
preferredCodecInfos
List of preferred MediaCodecInfos. -
downloadFolder
Download folder in case the content is played offline -
enableTunneling
public final boolean enableTunnelingEnable tunneling support -
enableTunnelingWithoutAudio
public final boolean enableTunnelingWithoutAudioForce using of tunneling when audio track is disabled. To take effect theenableTunnelingshould also be on. -
analyticsSessionType
public final int analyticsSessionTypeAnalytics session type -
userID
User ID. Unique identifier for the current user. -
adRequest
The Ad request (if any) -
enableAdSpeedUp
public final boolean enableAdSpeedUpThe flag to enable or disable automatic setting of a speed to 1x when playing ads. -
restoreSpeed
public final boolean restoreSpeedThe flag to enable or disable automatic restoring of a speed after playing ads. -
configurationUrl
Optional configuration backend url -
id
ID for this content -
contentUrl
Playback url -
contentType
public final int contentTypeThe content format -
autoPlay
public final boolean autoPlayWhether to autoplay or not -
live
public final boolean liveContent live or VoD -
threesixty
public final boolean threesixty360 support -
preferredTextLanguage
Preferred subtitles language -
preferredAudioLanguage
Preferred audio language -
sideloadedTracks
Array of side-loaded tracks, either subtitles or thumbnails -
metaData
Optional metadata -
contentParameters
Header params to add to content (manifest) requests -
segmentParameters
Header params to add to segment requests -
contentQueryParameters
Query params to add to content (manifest) requests -
segmentQueryParameters
Query params to add to segment requests -
drmConfiguration
Drm configuration (if any) -
casConfiguration
Cas configuration (if any) -
preservePlayerViewSurface
public final boolean preservePlayerViewSurfaceIf set to true and thePlayerViewis used, the playback surface be kept on screen and preserved when the player player is released. This allows to reuse (instead of re-create) the playback surface and can also be used to keep the last frame on screen even if the underlying player was already released. -
preservePlayerResources
public final boolean preservePlayerResourcesIf set to true, the playback resources (codecs, renderers) will be preserved when the player player is released. This allows to reuse (instead of re-create) the playback resources and can also be used to keep the last frame on screen whenpreservePlayerViewSurfaceis set. -
pushBlackScreenOnDispose
public final boolean pushBlackScreenOnDisposeIf true, indicates if the decoder should push a black screen to the surface when disposed. This is only relevant if you enabledpreservePlayerViewSurface -
useStandaloneMediaClock
public boolean useStandaloneMediaClockIf set to true, will use Exoplayer'sStandaloneMediaClockinstead of the Renderer Clock. -
enableLooping
public final boolean enableLoopingIf set to true then the playback looping will be enabled and the player will automatically restart the playback after reaching end of content -
analyticsMetaData
The analytics meta-data -
audioAttributes
The Audio Attributes. If set toSdkConsts.AUDIO_ATTRIBUTES_FOCUS_DISABLED, the SDK won't request Audio Focus and play sound regardless of it. It is recommended to provide an instance ofAudioAttributes, or at least use the default configuration. -
adSchedule
Describes a custom ad schedule. -
videoFilterConfiguration
The video filter configuration -
useEth0
@Nullable public final boolean useEth0A boolean flag to indicate to use eth0 for multicast reception -
videoDecoderFallback
public final boolean videoDecoderFallbackIf true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder. This can for instance happen if the primary decoder is a hardware implementation and is already blocked by another playback session. In that case, secondary decoders, i.e. software implementations, will be used if possible. -
audioDecoderFallback
public final boolean audioDecoderFallbackIf true (default), allows the player to fallback to other decoders if it failed to initialize the primary decoder. This can for instance happen if the primary decoder is a hardware implementation and is already blocked by another playback session. In that case, secondary decoders, i.e. software implementations, will be used if possible. -
unsecureDecoderFallback
public final boolean unsecureDecoderFallbackIf true (default), allows the player to fallback to unsecure decoders if it failed to initialize the primary decoder. This requiresvideoDecoderFallbackto also be enabled. -
allowHlsChunklessPreparation
public final boolean allowHlsChunklessPreparationIf set to true, chunk-less preparation of hls tracks are allowed -
subtitleSubSampleType
public final int subtitleSubSampleTypeDefines whether the subtitle times are absolute or relative. Could be one ofSdkConsts.SUBTITLE_SUB_SAMPLE_TYPE_ABSOLUTEorSdkConsts.SUBTITLE_SUB_SAMPLE_TYPE_RELATIVE -
CREATOR
Creator for thePlayerConfigclass.
-
-
Method Details
-
guessFormat
Guess the format of the or returnSdkConsts.CONTENT_TYPE_UNKNOWN.- Parameters:
url- the url to the content- Returns:
- the format or
SdkConsts.CONTENT_TYPE_UNKNOWN
-
save
Saves the current configuration into aBundle.- Parameters:
bundle- the Bundle to which store thePlayerConfig
-
toBundle
Obtain aBundlefilled with key-value pairs representing the current configuration. This Bundle can be used tostart playbackon aPlayerController.- Returns:
- the Bundle
-
buildUpon
Set theBuildervalues to the stored values in theBundle.- Returns:
- the Builder
-
describeContents
public int describeContents()- Specified by:
describeContentsin interfaceParcelable
-
writeToParcel
- Specified by:
writeToParcelin interfaceParcelable
-
hashCode
public int hashCode() -
equals
-
VideoFilterConfiguration.maxPixelinstead.